mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00
chore(core): update doc comments for on(), once(), addEventListener() and removeEventListener()
This commit is contained in:
@ -424,12 +424,16 @@ export class ObservableArray<T> extends Observable {
|
||||
|
||||
export interface ObservableArray<T> {
|
||||
/**
|
||||
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
|
||||
* @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
|
||||
* @param callback - Callback function which will be executed when event is raised.
|
||||
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.
|
||||
* Adds a listener for the specified event name.
|
||||
*
|
||||
* @param eventName The name of the event.
|
||||
* @param callback The event listener to add. Will be called when an event of
|
||||
* the given name is raised.
|
||||
* @param thisArg An optional parameter which, when set, will be bound as the
|
||||
* `this` context when the callback is called. Falsy values will be not be
|
||||
* bound.
|
||||
*/
|
||||
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void;
|
||||
on(eventName: string, callback: (data: EventData) => void, thisArg?: any): void;
|
||||
|
||||
on(event: 'change', callback: (args: ChangedData<T>) => void, thisArg?: any): void;
|
||||
}
|
||||
|
Reference in New Issue
Block a user