chore(core): update doc comments for on(), once(), addEventListener() and removeEventListener()

This commit is contained in:
shirakaba
2024-05-08 12:12:21 +09:00
parent 9be392fbb0
commit 5d08e44b79
16 changed files with 167 additions and 89 deletions

View File

@ -183,12 +183,16 @@ export class VirtualArray<T> extends Observable {
}
export interface VirtualArray<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;
/**
* Raised when still not loaded items are requested.
*/