@fluidframework/core-interfaces 2.74.0-365691 → 2.74.0-368706
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-report/core-interfaces.beta.api.md +0 -1
- package/api-report/core-interfaces.legacy.alpha.api.md +0 -1
- package/api-report/core-interfaces.legacy.beta.api.md +0 -1
- package/api-report/core-interfaces.legacy.public.api.md +0 -1
- package/api-report/core-interfaces.public.api.md +0 -1
- package/dist/events/listeners.d.ts +11 -0
- package/dist/events/listeners.d.ts.map +1 -1
- package/dist/events/listeners.js.map +1 -1
- package/lib/events/listeners.d.ts +11 -0
- package/lib/events/listeners.d.ts.map +1 -1
- package/lib/events/listeners.js.map +1 -1
- package/package.json +2 -2
- package/src/events/listeners.ts +0 -2
|
@@ -310,7 +310,6 @@ export interface ITelemetryBaseProperties {
|
|
|
310
310
|
// @public @sealed
|
|
311
311
|
export interface Listenable<TListeners extends object> {
|
|
312
312
|
off<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;
|
|
313
|
-
// (undocumented)
|
|
314
313
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
315
314
|
}
|
|
316
315
|
|
|
@@ -418,7 +418,6 @@ export interface IThrottlingWarning extends IErrorBase {
|
|
|
418
418
|
// @public @sealed
|
|
419
419
|
export interface Listenable<TListeners extends object> {
|
|
420
420
|
off<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;
|
|
421
|
-
// (undocumented)
|
|
422
421
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
423
422
|
}
|
|
424
423
|
|
|
@@ -393,7 +393,6 @@ export interface IThrottlingWarning extends IErrorBase {
|
|
|
393
393
|
// @public @sealed
|
|
394
394
|
export interface Listenable<TListeners extends object> {
|
|
395
395
|
off<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;
|
|
396
|
-
// (undocumented)
|
|
397
396
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
398
397
|
}
|
|
399
398
|
|
|
@@ -310,7 +310,6 @@ export interface ITelemetryBaseProperties {
|
|
|
310
310
|
// @public @sealed
|
|
311
311
|
export interface Listenable<TListeners extends object> {
|
|
312
312
|
off<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;
|
|
313
|
-
// (undocumented)
|
|
314
313
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
315
314
|
}
|
|
316
315
|
|
|
@@ -310,7 +310,6 @@ export interface ITelemetryBaseProperties {
|
|
|
310
310
|
// @public @sealed
|
|
311
311
|
export interface Listenable<TListeners extends object> {
|
|
312
312
|
off<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;
|
|
313
|
-
// (undocumented)
|
|
314
313
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
315
314
|
}
|
|
316
315
|
|
|
@@ -44,6 +44,17 @@ export type Listeners<T extends object> = {
|
|
|
44
44
|
* @sealed @public
|
|
45
45
|
*/
|
|
46
46
|
export interface Listenable<TListeners extends object> {
|
|
47
|
+
/**
|
|
48
|
+
* Register an event listener.
|
|
49
|
+
* @param eventName - The name of the event.
|
|
50
|
+
* @param listener - The listener function to run when the event is fired.
|
|
51
|
+
* @returns A {@link Off | function} which will deregister the listener when called.
|
|
52
|
+
* Calling the deregistration function more than once will have no effect.
|
|
53
|
+
*
|
|
54
|
+
* Listeners may also be deregistered by passing the listener to {@link Listenable.off | off()}.
|
|
55
|
+
* @remarks Registering the exact same `listener` object for the same event more than once will throw an error.
|
|
56
|
+
* If registering the same listener for the same event multiple times is desired, consider using a wrapper function for the second subscription.
|
|
57
|
+
*/
|
|
47
58
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
48
59
|
/**
|
|
49
60
|
* Deregister an event listener.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listeners.d.ts","sourceRoot":"","sources":["../../src/events/listeners.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,SAAS,IAAI,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAE9F;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI;KACxC,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;CACrF,CAAC;
|
|
1
|
+
{"version":3,"file":"listeners.d.ts","sourceRoot":"","sources":["../../src/events/listeners.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,SAAS,IAAI,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAE9F;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI;KACxC,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;CACrF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,UAAU,CAAC,UAAU,SAAS,MAAM;IACpD;;;;;;;;;;OAUG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,SAAS,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IAEtF;;;;;;;OAOG;IACH,GAAG,CAAC,CAAC,SAAS,MAAM,SAAS,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CACxF;AAED;;;;;GAKG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listeners.js","sourceRoot":"","sources":["../../src/events/listeners.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * `true` iff the given type is an acceptable shape for a {@link Listeners | event} listener\n * @public\n */\nexport type IsListener<TListener> = TListener extends (...args: any[]) => void ? true : false;\n\n/**\n * Used to specify the kinds of events emitted by a {@link Listenable}.\n *\n * @remarks\n * Any object type is a valid {@link Listeners}, but only the {@link IsListener | event-like} properties of that\n * type will be included.\n *\n * @example\n * ```typescript\n * interface MyEvents {\n * load: (user: string, data: IUserData) => void;\n * error: (errorCode: number) => void;\n * }\n * ```\n *\n * @public\n */\nexport type Listeners<T extends object> = {\n\t[P in (string | symbol) & keyof T as IsListener<T[P]> extends true ? P : never]: T[P];\n};\n\n
|
|
1
|
+
{"version":3,"file":"listeners.js","sourceRoot":"","sources":["../../src/events/listeners.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * `true` iff the given type is an acceptable shape for a {@link Listeners | event} listener\n * @public\n */\nexport type IsListener<TListener> = TListener extends (...args: any[]) => void ? true : false;\n\n/**\n * Used to specify the kinds of events emitted by a {@link Listenable}.\n *\n * @remarks\n * Any object type is a valid {@link Listeners}, but only the {@link IsListener | event-like} properties of that\n * type will be included.\n *\n * @example\n * ```typescript\n * interface MyEvents {\n * load: (user: string, data: IUserData) => void;\n * error: (errorCode: number) => void;\n * }\n * ```\n *\n * @public\n */\nexport type Listeners<T extends object> = {\n\t[P in (string | symbol) & keyof T as IsListener<T[P]> extends true ? P : never]: T[P];\n};\n\n/**\n * An object which allows the registration of listeners so that subscribers can be notified when an event happens.\n * @param TListeners - All the {@link Listeners | events} that this subscribable supports\n *\n * @privateRemarks\n * {@link @fluid-internal/client-utils#CustomEventEmitter} can be used as a base class to implement this via extension.\n * ```ts\n * type MyEventEmitter = IEmitter<{\n * load: (user: string, data: IUserData) => void;\n * error: (errorCode: number) => void;\n * }>\n * ```\n * {@link @fluid-internal/client-utils#createEmitter} can help implement this interface via delegation.\n *\n * @sealed @public\n */\nexport interface Listenable<TListeners extends object> {\n\t/**\n\t * Register an event listener.\n\t * @param eventName - The name of the event.\n\t * @param listener - The listener function to run when the event is fired.\n\t * @returns A {@link Off | function} which will deregister the listener when called.\n\t * Calling the deregistration function more than once will have no effect.\n\t *\n\t * Listeners may also be deregistered by passing the listener to {@link Listenable.off | off()}.\n\t * @remarks Registering the exact same `listener` object for the same event more than once will throw an error.\n\t * If registering the same listener for the same event multiple times is desired, consider using a wrapper function for the second subscription.\n\t */\n\ton<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;\n\n\t/**\n\t * Deregister an event listener.\n\t * @param eventName - The name of the event.\n\t * @param listener - The listener function to remove from the current set of event listeners.\n\t * @remarks If `listener` is not currently registered, this method will have no effect.\n\t *\n\t * Listeners may also be deregistered by calling the {@link Off | deregistration function} returned when they are {@link Listenable.on | registered}.\n\t */\n\toff<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;\n}\n\n/**\n * A function that, when called, will deregister an event listener subscription that was previously registered.\n * @remarks\n * It is returned by the {@link Listenable.on | event registration function} when event registration occurs.\n * @public\n */\nexport type Off = () => void;\n"]}
|
|
@@ -44,6 +44,17 @@ export type Listeners<T extends object> = {
|
|
|
44
44
|
* @sealed @public
|
|
45
45
|
*/
|
|
46
46
|
export interface Listenable<TListeners extends object> {
|
|
47
|
+
/**
|
|
48
|
+
* Register an event listener.
|
|
49
|
+
* @param eventName - The name of the event.
|
|
50
|
+
* @param listener - The listener function to run when the event is fired.
|
|
51
|
+
* @returns A {@link Off | function} which will deregister the listener when called.
|
|
52
|
+
* Calling the deregistration function more than once will have no effect.
|
|
53
|
+
*
|
|
54
|
+
* Listeners may also be deregistered by passing the listener to {@link Listenable.off | off()}.
|
|
55
|
+
* @remarks Registering the exact same `listener` object for the same event more than once will throw an error.
|
|
56
|
+
* If registering the same listener for the same event multiple times is desired, consider using a wrapper function for the second subscription.
|
|
57
|
+
*/
|
|
47
58
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
48
59
|
/**
|
|
49
60
|
* Deregister an event listener.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listeners.d.ts","sourceRoot":"","sources":["../../src/events/listeners.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,SAAS,IAAI,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAE9F;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI;KACxC,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;CACrF,CAAC;
|
|
1
|
+
{"version":3,"file":"listeners.d.ts","sourceRoot":"","sources":["../../src/events/listeners.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,SAAS,IAAI,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAE9F;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI;KACxC,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;CACrF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,UAAU,CAAC,UAAU,SAAS,MAAM;IACpD;;;;;;;;;;OAUG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,SAAS,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IAEtF;;;;;;;OAOG;IACH,GAAG,CAAC,CAAC,SAAS,MAAM,SAAS,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CACxF;AAED;;;;;GAKG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listeners.js","sourceRoot":"","sources":["../../src/events/listeners.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * `true` iff the given type is an acceptable shape for a {@link Listeners | event} listener\n * @public\n */\nexport type IsListener<TListener> = TListener extends (...args: any[]) => void ? true : false;\n\n/**\n * Used to specify the kinds of events emitted by a {@link Listenable}.\n *\n * @remarks\n * Any object type is a valid {@link Listeners}, but only the {@link IsListener | event-like} properties of that\n * type will be included.\n *\n * @example\n * ```typescript\n * interface MyEvents {\n * load: (user: string, data: IUserData) => void;\n * error: (errorCode: number) => void;\n * }\n * ```\n *\n * @public\n */\nexport type Listeners<T extends object> = {\n\t[P in (string | symbol) & keyof T as IsListener<T[P]> extends true ? P : never]: T[P];\n};\n\n
|
|
1
|
+
{"version":3,"file":"listeners.js","sourceRoot":"","sources":["../../src/events/listeners.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * `true` iff the given type is an acceptable shape for a {@link Listeners | event} listener\n * @public\n */\nexport type IsListener<TListener> = TListener extends (...args: any[]) => void ? true : false;\n\n/**\n * Used to specify the kinds of events emitted by a {@link Listenable}.\n *\n * @remarks\n * Any object type is a valid {@link Listeners}, but only the {@link IsListener | event-like} properties of that\n * type will be included.\n *\n * @example\n * ```typescript\n * interface MyEvents {\n * load: (user: string, data: IUserData) => void;\n * error: (errorCode: number) => void;\n * }\n * ```\n *\n * @public\n */\nexport type Listeners<T extends object> = {\n\t[P in (string | symbol) & keyof T as IsListener<T[P]> extends true ? P : never]: T[P];\n};\n\n/**\n * An object which allows the registration of listeners so that subscribers can be notified when an event happens.\n * @param TListeners - All the {@link Listeners | events} that this subscribable supports\n *\n * @privateRemarks\n * {@link @fluid-internal/client-utils#CustomEventEmitter} can be used as a base class to implement this via extension.\n * ```ts\n * type MyEventEmitter = IEmitter<{\n * load: (user: string, data: IUserData) => void;\n * error: (errorCode: number) => void;\n * }>\n * ```\n * {@link @fluid-internal/client-utils#createEmitter} can help implement this interface via delegation.\n *\n * @sealed @public\n */\nexport interface Listenable<TListeners extends object> {\n\t/**\n\t * Register an event listener.\n\t * @param eventName - The name of the event.\n\t * @param listener - The listener function to run when the event is fired.\n\t * @returns A {@link Off | function} which will deregister the listener when called.\n\t * Calling the deregistration function more than once will have no effect.\n\t *\n\t * Listeners may also be deregistered by passing the listener to {@link Listenable.off | off()}.\n\t * @remarks Registering the exact same `listener` object for the same event more than once will throw an error.\n\t * If registering the same listener for the same event multiple times is desired, consider using a wrapper function for the second subscription.\n\t */\n\ton<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;\n\n\t/**\n\t * Deregister an event listener.\n\t * @param eventName - The name of the event.\n\t * @param listener - The listener function to remove from the current set of event listeners.\n\t * @remarks If `listener` is not currently registered, this method will have no effect.\n\t *\n\t * Listeners may also be deregistered by calling the {@link Off | deregistration function} returned when they are {@link Listenable.on | registered}.\n\t */\n\toff<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;\n}\n\n/**\n * A function that, when called, will deregister an event listener subscription that was previously registered.\n * @remarks\n * It is returned by the {@link Listenable.on | event registration function} when event registration occurs.\n * @public\n */\nexport type Off = () => void;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/core-interfaces",
|
|
3
|
-
"version": "2.74.0-
|
|
3
|
+
"version": "2.74.0-368706",
|
|
4
4
|
"description": "Fluid object interfaces",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@fluidframework/build-common": "^2.0.3",
|
|
88
88
|
"@fluidframework/build-tools": "^0.60.0",
|
|
89
89
|
"@fluidframework/core-interfaces-previous": "npm:@fluidframework/core-interfaces@2.73.0",
|
|
90
|
-
"@fluidframework/eslint-config-fluid": "2.74.0-
|
|
90
|
+
"@fluidframework/eslint-config-fluid": "2.74.0-368706",
|
|
91
91
|
"@microsoft/api-extractor": "7.52.11",
|
|
92
92
|
"@types/mocha": "^10.0.10",
|
|
93
93
|
"@types/node": "^18.19.0",
|
package/src/events/listeners.ts
CHANGED
|
@@ -30,7 +30,6 @@ export type Listeners<T extends object> = {
|
|
|
30
30
|
[P in (string | symbol) & keyof T as IsListener<T[P]> extends true ? P : never]: T[P];
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
/* eslint-disable @fluid-internal/fluid/no-hyphen-after-jsdoc-tag -- false positive AB#50920 */
|
|
34
33
|
/**
|
|
35
34
|
* An object which allows the registration of listeners so that subscribers can be notified when an event happens.
|
|
36
35
|
* @param TListeners - All the {@link Listeners | events} that this subscribable supports
|
|
@@ -48,7 +47,6 @@ export type Listeners<T extends object> = {
|
|
|
48
47
|
* @sealed @public
|
|
49
48
|
*/
|
|
50
49
|
export interface Listenable<TListeners extends object> {
|
|
51
|
-
/* eslint-enable @fluid-internal/fluid/no-hyphen-after-jsdoc-tag -- false positive
|
|
52
50
|
/**
|
|
53
51
|
* Register an event listener.
|
|
54
52
|
* @param eventName - The name of the event.
|