Fix Observable signatures.
This commit is contained in:
committed by
Andreas Hocevar
parent
d914006d51
commit
87830c6959
@@ -13,7 +13,7 @@ import {listen, listenOnce, unlistenByKey} from './events.js';
|
|||||||
|
|
||||||
/***
|
/***
|
||||||
* @template {string} Type
|
* @template {string} Type
|
||||||
* @typedef {(type: Type[], listener: (event: import("./events/Event").default) => (void|boolean)) => import("./events").EventsKey|Array<import("./events").EventsKey>} CombinedOnSignature
|
* @typedef {(type: Type[], listener: (event: Event|import("./events/Event").default) => (void|boolean)) => import("./events").EventsKey|Array<import("./events").EventsKey>} CombinedOnSignature
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,7 +73,7 @@ class Observable extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string|Array<string>} type Type.
|
* @param {string|Array<string>} type Type.
|
||||||
* @param {function(import("./events/Event").default): (void|boolean)} listener Listener.
|
* @param {function(?): (void|boolean)} listener Listener.
|
||||||
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Event key.
|
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Event key.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
@@ -93,7 +93,7 @@ class Observable extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string|Array<string>} type Type.
|
* @param {string|Array<string>} type Type.
|
||||||
* @param {function(import("./events/Event").default): (void|boolean)} listener Listener.
|
* @param {function(?): (void|boolean)} listener Listener.
|
||||||
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Event key.
|
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Event key.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
@@ -116,7 +116,7 @@ class Observable extends EventTarget {
|
|||||||
/**
|
/**
|
||||||
* Unlisten for a certain type of event.
|
* Unlisten for a certain type of event.
|
||||||
* @param {string|Array<string>} type The event type or array of event types.
|
* @param {string|Array<string>} type The event type or array of event types.
|
||||||
* @param {function(import("./events/Event").default): (void|boolean)} listener The listener function.
|
* @param {function((Event|import("./events/Event").default)): (void|boolean)} listener The listener function.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
un(type, listener) {
|
un(type, listener) {
|
||||||
@@ -137,7 +137,7 @@ class Observable extends EventTarget {
|
|||||||
* Listen for a certain type of event.
|
* Listen for a certain type of event.
|
||||||
* @function
|
* @function
|
||||||
* @param {string|Array<string>} type The event type or array of event types.
|
* @param {string|Array<string>} type The event type or array of event types.
|
||||||
* @param {function(import("./events/Event").default): (void|boolean)} listener The listener function.
|
* @param {function((Event|import("./events/Event").default)): (void|boolean)} listener The listener function.
|
||||||
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Unique key for the listener. If
|
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Unique key for the listener. If
|
||||||
* called with an array of event types as the first argument, the return
|
* called with an array of event types as the first argument, the return
|
||||||
* will be an array of keys.
|
* will be an array of keys.
|
||||||
@@ -149,7 +149,7 @@ Observable.prototype.on;
|
|||||||
* Listen once for a certain type of event.
|
* Listen once for a certain type of event.
|
||||||
* @function
|
* @function
|
||||||
* @param {string|Array<string>} type The event type or array of event types.
|
* @param {string|Array<string>} type The event type or array of event types.
|
||||||
* @param {function(import("./events/Event").default): (void|boolean)} listener The listener function.
|
* @param {function((Event|import("./events/Event").default)): (void|boolean)} listener The listener function.
|
||||||
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Unique key for the listener. If
|
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Unique key for the listener. If
|
||||||
* called with an array of event types as the first argument, the return
|
* called with an array of event types as the first argument, the return
|
||||||
* will be an array of keys.
|
* will be an array of keys.
|
||||||
|
|||||||
Reference in New Issue
Block a user