@fluidframework/core-interfaces 2.41.0-338401 → 2.41.0

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-report/core-interfaces.legacy.alpha.api.md +6 -0
  3. package/dist/brandedType.d.ts +41 -0
  4. package/dist/brandedType.d.ts.map +1 -0
  5. package/dist/brandedType.js +7 -0
  6. package/dist/brandedType.js.map +1 -0
  7. package/dist/exposedInternalUtilityTypes.d.ts +8 -2
  8. package/dist/exposedInternalUtilityTypes.d.ts.map +1 -1
  9. package/dist/exposedInternalUtilityTypes.js.map +1 -1
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/internal.d.ts +1 -0
  14. package/dist/internal.d.ts.map +1 -1
  15. package/dist/internal.js.map +1 -1
  16. package/dist/legacy.d.ts +2 -1
  17. package/dist/messages.d.ts +22 -5
  18. package/dist/messages.d.ts.map +1 -1
  19. package/dist/messages.js.map +1 -1
  20. package/lib/brandedType.d.ts +41 -0
  21. package/lib/brandedType.d.ts.map +1 -0
  22. package/lib/brandedType.js +6 -0
  23. package/lib/brandedType.js.map +1 -0
  24. package/lib/exposedInternalUtilityTypes.d.ts +8 -2
  25. package/lib/exposedInternalUtilityTypes.d.ts.map +1 -1
  26. package/lib/exposedInternalUtilityTypes.js.map +1 -1
  27. package/lib/index.d.ts +2 -1
  28. package/lib/index.d.ts.map +1 -1
  29. package/lib/index.js.map +1 -1
  30. package/lib/internal.d.ts +1 -0
  31. package/lib/internal.d.ts.map +1 -1
  32. package/lib/internal.js.map +1 -1
  33. package/lib/legacy.d.ts +2 -1
  34. package/lib/messages.d.ts +22 -5
  35. package/lib/messages.d.ts.map +1 -1
  36. package/lib/messages.js.map +1 -1
  37. package/package.json +2 -2
  38. package/src/brandedType.ts +43 -0
  39. package/src/exposedInternalUtilityTypes.ts +14 -7
  40. package/src/index.ts +3 -1
  41. package/src/internal.ts +2 -0
  42. package/src/messages.ts +24 -6
package/lib/index.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ export type { BrandedType } from "./brandedType.js";
5
6
  export type { IDisposable } from "./disposable.js";
6
7
  export type { IErrorBase, IGenericError, IUsageError, IThrottlingWarning } from "./error.js";
7
8
  export { FluidErrorTypes } from "./error.js";
@@ -15,7 +16,7 @@ export type { ILoggingError, ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemet
15
16
  export { LogLevel } from "./logger.js";
16
17
  export type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider.js";
17
18
  export type { ConfigTypes, IConfigProviderBase } from "./config.js";
18
- export type { ISignalEnvelope } from "./messages.js";
19
+ export type { ISignalEnvelope, TypedMessage } from "./messages.js";
19
20
  export type { ErasedType } from "./erasedType.js";
20
21
  export type { HasListeners, IEmitter, IsListener, Listeners, Listenable, MapGetSet, NoListenersCallback, Off, } from "./events/index.js";
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,cAAc,E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[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAc7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAmBpE,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAUpF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type { IErrorBase, IGenericError, IUsageError, IThrottlingWarning } from \"./error.js\";\nexport { FluidErrorTypes } from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable, IProvideFluidRunnable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable, IFluidRunnable } from \"./fluidLoadable.js\";\n\n// TypeScript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type {\n\tIFluidHandleErased,\n\tIFluidHandleEvents,\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n\tILocalFluidHandleEvents,\n\tIProvideFluidHandle,\n\tIProvideFluidHandleContext,\n\tPayloadState,\n} from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope } from \"./messages.js\";\nexport type { ErasedType } from \"./erasedType.js\";\n\nexport type {\n\tHasListeners,\n\tIEmitter,\n\tIsListener,\n\tListeners,\n\tListenable,\n\tMapGetSet,\n\tNoListenersCallback,\n\tOff,\n} from \"./events/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAc7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAmBpE,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAUpF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { BrandedType } from \"./brandedType.js\";\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type { IErrorBase, IGenericError, IUsageError, IThrottlingWarning } from \"./error.js\";\nexport { FluidErrorTypes } from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable, IProvideFluidRunnable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable, IFluidRunnable } from \"./fluidLoadable.js\";\n\n// TypeScript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type {\n\tIFluidHandleErased,\n\tIFluidHandleEvents,\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n\tILocalFluidHandleEvents,\n\tIProvideFluidHandle,\n\tIProvideFluidHandleContext,\n\tPayloadState,\n} from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope, TypedMessage } from \"./messages.js\";\nexport type { ErasedType } from \"./erasedType.js\";\n\nexport type {\n\tHasListeners,\n\tIEmitter,\n\tIsListener,\n\tListeners,\n\tListenable,\n\tMapGetSet,\n\tNoListenersCallback,\n\tOff,\n} from \"./events/index.js\";\n"]}
package/lib/internal.d.ts CHANGED
@@ -38,6 +38,7 @@ export type ReadonlyNonNullJsonObjectWith<T> = ExposedReadonlyNonNullJsonObjectW
38
38
  * @internal
39
39
  */
40
40
  export declare namespace InternalUtilityTypes {
41
+ type FlattenIntersection<T extends ExposedInternalUtilityTypes.AnyRecord> = ExposedInternalUtilityTypes.FlattenIntersection<T>;
41
42
  type IfSameType<X, Y, IfSame = unknown, IfDifferent = never> = ExposedInternalUtilityTypes.IfSameType<X, Y, IfSame, IfDifferent>;
42
43
  }
43
44
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,YAAY,CAAC;AAU3B,OAAO,KAAK,E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CAAC,CAAC,CAAC,CAAC;AAEvF;;GAEG;AAEH,yBAAiB,oBAAoB,CAAC;IAErC,KAAY,mBAAmB,CAAC,CAAC,SAAS,2BAA2B,CAAC,SAAS,IAC9E,2BAA2B,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACpD,KAAY,UAAU,CACrB,CAAC,EACD,CAAC,EACD,MAAM,GAAG,OAAO,EAChB,WAAW,GAAG,KAAK,IAChB,2BAA2B,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;CAEtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,gDAAgD;AAChD,cAAc,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// eslint-disable-next-line no-restricted-syntax\nexport * from \"./index.js\";\n\n// Important: all other exports must be type only exports. In package.json exports,\n// index.js is listed as the runtime file. This is done so that all imports are\n// using the same outer runtime file. (Could be changed if needed.)\n\n// Export set of utility types re-tagged as internal for FF client convenience.\n// These types are not intended for direct use by customers and api-extractor will\n// flag misuse. If an externally visible version of these types is needed, import\n// from via /internal/exposedUtilityTypes rather than /internal.\nimport type { DeepReadonly as ExposedDeepReadonly } from \"./deepReadonly.js\";\nimport type { InternalUtilityTypes as ExposedInternalUtilityTypes } from \"./exposedInternalUtilityTypes.js\";\nimport type {\n\tJsonDeserialized as ExposedJsonDeserialized,\n\tJsonDeserializedOptions,\n} from \"./jsonDeserialized.js\";\nimport type {\n\tJsonSerializable as ExposedJsonSerializable,\n\tJsonSerializableOptions,\n} from \"./jsonSerializable.js\";\nimport type {\n\tJsonTypeWith as ExposedJsonTypeWith,\n\tReadonlyNonNullJsonObjectWith as ExposedReadonlyNonNullJsonObjectWith,\n} from \"./jsonType.js\";\n\n// Note: There are no docs for these re-exports. `@inheritdoc` cannot be used as:\n// 1. api-extractor does not support renames.\n// 2. api-extractor does not support package paths. (\"Import paths are not supported\")\n// Also not useful, at least in VS Code, as substitution is not made in place.\n\n/**\n * @internal\n */\nexport type DeepReadonly<T> = ExposedDeepReadonly<T>;\n\n/**\n * @internal\n */\nexport type JsonDeserialized<\n\tT,\n\tOptions extends JsonDeserializedOptions = {\n\t\tAllowExactly: [];\n\t\tAllowExtensionOf: never;\n\t},\n> = ExposedJsonDeserialized<T, Options>;\n\n/**\n * @internal\n */\nexport type JsonSerializable<\n\tT,\n\tOptions extends JsonSerializableOptions = {\n\t\tAllowExactly: [];\n\t\tAllowExtensionOf: never;\n\t},\n> = ExposedJsonSerializable<T, Options>;\n\n/**\n * @internal\n */\nexport type JsonTypeWith<T> = ExposedJsonTypeWith<T>;\n\n/**\n * @internal\n */\nexport type ReadonlyNonNullJsonObjectWith<T> = ExposedReadonlyNonNullJsonObjectWith<T>;\n\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InternalUtilityTypes {\n\t/* eslint-disable jsdoc/require-jsdoc */\n\texport type IfSameType<\n\t\tX,\n\t\tY,\n\t\tIfSame = unknown,\n\t\tIfDifferent = never,\n\t> = ExposedInternalUtilityTypes.IfSameType<X, Y, IfSame, IfDifferent>;\n\t/* eslint-enable jsdoc/require-jsdoc */\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,gDAAgD;AAChD,cAAc,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// eslint-disable-next-line no-restricted-syntax\nexport * from \"./index.js\";\n\n// Important: all other exports must be type only exports. In package.json exports,\n// index.js is listed as the runtime file. This is done so that all imports are\n// using the same outer runtime file. (Could be changed if needed.)\n\n// Export set of utility types re-tagged as internal for FF client convenience.\n// These types are not intended for direct use by customers and api-extractor will\n// flag misuse. If an externally visible version of these types is needed, import\n// from via /internal/exposedUtilityTypes rather than /internal.\nimport type { DeepReadonly as ExposedDeepReadonly } from \"./deepReadonly.js\";\nimport type { InternalUtilityTypes as ExposedInternalUtilityTypes } from \"./exposedInternalUtilityTypes.js\";\nimport type {\n\tJsonDeserialized as ExposedJsonDeserialized,\n\tJsonDeserializedOptions,\n} from \"./jsonDeserialized.js\";\nimport type {\n\tJsonSerializable as ExposedJsonSerializable,\n\tJsonSerializableOptions,\n} from \"./jsonSerializable.js\";\nimport type {\n\tJsonTypeWith as ExposedJsonTypeWith,\n\tReadonlyNonNullJsonObjectWith as ExposedReadonlyNonNullJsonObjectWith,\n} from \"./jsonType.js\";\n\n// Note: There are no docs for these re-exports. `@inheritdoc` cannot be used as:\n// 1. api-extractor does not support renames.\n// 2. api-extractor does not support package paths. (\"Import paths are not supported\")\n// Also not useful, at least in VS Code, as substitution is not made in place.\n\n/**\n * @internal\n */\nexport type DeepReadonly<T> = ExposedDeepReadonly<T>;\n\n/**\n * @internal\n */\nexport type JsonDeserialized<\n\tT,\n\tOptions extends JsonDeserializedOptions = {\n\t\tAllowExactly: [];\n\t\tAllowExtensionOf: never;\n\t},\n> = ExposedJsonDeserialized<T, Options>;\n\n/**\n * @internal\n */\nexport type JsonSerializable<\n\tT,\n\tOptions extends JsonSerializableOptions = {\n\t\tAllowExactly: [];\n\t\tAllowExtensionOf: never;\n\t},\n> = ExposedJsonSerializable<T, Options>;\n\n/**\n * @internal\n */\nexport type JsonTypeWith<T> = ExposedJsonTypeWith<T>;\n\n/**\n * @internal\n */\nexport type ReadonlyNonNullJsonObjectWith<T> = ExposedReadonlyNonNullJsonObjectWith<T>;\n\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InternalUtilityTypes {\n\t/* eslint-disable jsdoc/require-jsdoc */\n\texport type FlattenIntersection<T extends ExposedInternalUtilityTypes.AnyRecord> =\n\t\tExposedInternalUtilityTypes.FlattenIntersection<T>;\n\texport type IfSameType<\n\t\tX,\n\t\tY,\n\t\tIfSame = unknown,\n\t\tIfDifferent = never,\n\t> = ExposedInternalUtilityTypes.IfSameType<X, Y, IfSame, IfDifferent>;\n\t/* eslint-enable jsdoc/require-jsdoc */\n}\n"]}
package/lib/legacy.d.ts CHANGED
@@ -57,5 +57,6 @@ export {
57
57
  IProvideFluidHandle,
58
58
  IProvideFluidHandleContext,
59
59
  IThrottlingWarning,
60
- PayloadState
60
+ PayloadState,
61
+ TypedMessage
61
62
  } from "./index.js";
package/lib/messages.d.ts CHANGED
@@ -2,6 +2,26 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ /**
6
+ * A message that has a string `type` associated with `content`.
7
+ *
8
+ * @remarks
9
+ * This type is meant to be used indirectly. Most commonly as a constraint
10
+ * for generics of message structures.
11
+ *
12
+ * @legacy
13
+ * @alpha
14
+ */
15
+ export interface TypedMessage {
16
+ /**
17
+ * The type of the message.
18
+ */
19
+ type: string;
20
+ /**
21
+ * The contents of the message.
22
+ */
23
+ content: unknown;
24
+ }
5
25
  /**
6
26
  * @internal
7
27
  *
@@ -12,7 +32,7 @@
12
32
  *
13
33
  * See at `server/routerlicious/packages/lambdas/src/utils/messageGenerator.ts`.
14
34
  */
15
- export interface ISignalEnvelope {
35
+ export interface ISignalEnvelope<TMessage extends TypedMessage = TypedMessage> {
16
36
  /**
17
37
  * The target for the envelope, undefined for the container
18
38
  */
@@ -24,9 +44,6 @@ export interface ISignalEnvelope {
24
44
  /**
25
45
  * The contents of the envelope
26
46
  */
27
- contents: {
28
- type: string;
29
- content: any;
30
- };
47
+ contents: TMessage;
31
48
  }
32
49
  //# sourceMappingURL=messages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,mCAAmC,CAAC,EAAE,MAAM,CAAC;IAE7C;;OAEG;IACH,QAAQ,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QAEb,OAAO,EAAE,GAAG,CAAC;KACb,CAAC;CACF"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe,CAAC,QAAQ,SAAS,YAAY,GAAG,YAAY;IAC5E;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,mCAAmC,CAAC,EAAE,MAAM,CAAC;IAE7C;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/messages.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 * @internal\n *\n * @privateRemarks\n * `IRuntimeSignalEnvelope` is an interface that mirrors `ISignalEnvelope` for signals that come from an external\n * caller (not sent by a client—so no `clientBroadcastSignalSequenceNumber`) and are always addressed\n * to the Container (so no `address`).\n *\n * See at `server/routerlicious/packages/lambdas/src/utils/messageGenerator.ts`.\n */\nexport interface ISignalEnvelope {\n\t/**\n\t * The target for the envelope, undefined for the container\n\t */\n\taddress?: string;\n\n\t/**\n\t * Signal tracking identifier for self submitted broadcast signals.\n\t */\n\tclientBroadcastSignalSequenceNumber?: number;\n\n\t/**\n\t * The contents of the envelope\n\t */\n\tcontents: {\n\t\ttype: string;\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tcontent: any;\n\t};\n}\n"]}
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/messages.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 * A message that has a string `type` associated with `content`.\n *\n * @remarks\n * This type is meant to be used indirectly. Most commonly as a constraint\n * for generics of message structures.\n *\n * @legacy\n * @alpha\n */\nexport interface TypedMessage {\n\t/**\n\t * The type of the message.\n\t */\n\ttype: string;\n\n\t/**\n\t * The contents of the message.\n\t */\n\tcontent: unknown;\n}\n\n/**\n * @internal\n *\n * @privateRemarks\n * `IRuntimeSignalEnvelope` is an interface that mirrors `ISignalEnvelope` for signals that come from an external\n * caller (not sent by a client—so no `clientBroadcastSignalSequenceNumber`) and are always addressed\n * to the Container (so no `address`).\n *\n * See at `server/routerlicious/packages/lambdas/src/utils/messageGenerator.ts`.\n */\nexport interface ISignalEnvelope<TMessage extends TypedMessage = TypedMessage> {\n\t/**\n\t * The target for the envelope, undefined for the container\n\t */\n\taddress?: string;\n\n\t/**\n\t * Signal tracking identifier for self submitted broadcast signals.\n\t */\n\tclientBroadcastSignalSequenceNumber?: number;\n\n\t/**\n\t * The contents of the envelope\n\t */\n\tcontents: TMessage;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/core-interfaces",
3
- "version": "2.41.0-338401",
3
+ "version": "2.41.0",
4
4
  "description": "Fluid object interfaces",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -77,7 +77,7 @@
77
77
  "@fluidframework/build-common": "^2.0.3",
78
78
  "@fluidframework/build-tools": "^0.55.0",
79
79
  "@fluidframework/core-interfaces-previous": "npm:@fluidframework/core-interfaces@2.40.0",
80
- "@fluidframework/eslint-config-fluid": "^5.7.3",
80
+ "@fluidframework/eslint-config-fluid": "^5.7.4",
81
81
  "@microsoft/api-extractor": "7.52.8",
82
82
  "@types/mocha": "^10.0.10",
83
83
  "@types/node": "^18.19.0",
@@ -0,0 +1,43 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /**
7
+ * Base branded type which can be used to annotate other type.
8
+ *
9
+ * @remarks
10
+ * To use derive another class declaration and ideally add additional private
11
+ * properties to further distinguish the type.
12
+ *
13
+ * Since branded types are not real value types, they will always need to be
14
+ * created using `as` syntax and very often `as unknown` first.
15
+ *
16
+ * This class should never exist at runtime, so it is only declared.
17
+ *
18
+ * @sealed
19
+ * @internal
20
+ */
21
+ export declare class BrandedType<out Brand> {
22
+ /**
23
+ * Compile time only marker to make type checking more strict.
24
+ * This method will not exist at runtime and accessing it is invalid.
25
+ *
26
+ * @privateRemarks
27
+ * `Brand` is used as the return type of a method rather than a simple
28
+ * readonly property as this allows types with two brands to be
29
+ * intersected without getting `never`.
30
+ * The method takes in `never` to help emphasize that it's not callable.
31
+ */
32
+ protected readonly brand: (dummy: never) => Brand;
33
+
34
+ protected constructor();
35
+
36
+ /**
37
+ * Since this class is a compile time only type brand, `instanceof` will
38
+ * never work with it. * This `Symbol.hasInstance` implementation ensures
39
+ * that `instanceof` will error if used, and in TypeScript 5.3 and newer
40
+ * will produce a compile time error if used.
41
+ */
42
+ public static [Symbol.hasInstance](value: never): value is never;
43
+ }
@@ -535,20 +535,27 @@ export namespace InternalUtilityTypes {
535
535
  */
536
536
  export type IsExactlyObject<T extends object> = IsSameType<T, object>;
537
537
 
538
+ /**
539
+ * Any Record type.
540
+ *
541
+ * @system
542
+ */
543
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- `any` for property types is required to avoid "Index signature for type 'string' is missing in type" in some outside `FlattenIntersection` uses.
544
+ export type AnyRecord = Record<keyof any, any>;
545
+
538
546
  /**
539
547
  * Creates a simple object type from an intersection of multiple.
540
548
  * @privateRemarks
541
- * `T extends Record` within the implementation encourages tsc to process
549
+ * `T extends AnyRecord` within the implementation encourages tsc to process
542
550
  * intersections within unions.
543
551
  *
544
552
  * @system
545
553
  */
546
- export type FlattenIntersection<T extends Record<string | number | symbol, unknown>> =
547
- T extends Record<string | number | symbol, unknown>
548
- ? {
549
- [K in keyof T]: T[K];
550
- }
551
- : T;
554
+ export type FlattenIntersection<T extends AnyRecord> = T extends AnyRecord
555
+ ? {
556
+ [K in keyof T]: T[K];
557
+ }
558
+ : T;
552
559
 
553
560
  /**
554
561
  * Extracts Function portion from an intersection (&) type returning
package/src/index.ts CHANGED
@@ -3,6 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ export type { BrandedType } from "./brandedType.js";
7
+
6
8
  export type { IDisposable } from "./disposable.js";
7
9
 
8
10
  export type { IErrorBase, IGenericError, IUsageError, IThrottlingWarning } from "./error.js";
@@ -52,7 +54,7 @@ export type {
52
54
  export { LogLevel } from "./logger.js";
53
55
  export type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider.js";
54
56
  export type { ConfigTypes, IConfigProviderBase } from "./config.js";
55
- export type { ISignalEnvelope } from "./messages.js";
57
+ export type { ISignalEnvelope, TypedMessage } from "./messages.js";
56
58
  export type { ErasedType } from "./erasedType.js";
57
59
 
58
60
  export type {
package/src/internal.ts CHANGED
@@ -77,6 +77,8 @@ export type ReadonlyNonNullJsonObjectWith<T> = ExposedReadonlyNonNullJsonObjectW
77
77
  // eslint-disable-next-line @typescript-eslint/no-namespace
78
78
  export namespace InternalUtilityTypes {
79
79
  /* eslint-disable jsdoc/require-jsdoc */
80
+ export type FlattenIntersection<T extends ExposedInternalUtilityTypes.AnyRecord> =
81
+ ExposedInternalUtilityTypes.FlattenIntersection<T>;
80
82
  export type IfSameType<
81
83
  X,
82
84
  Y,
package/src/messages.ts CHANGED
@@ -3,6 +3,28 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ /**
7
+ * A message that has a string `type` associated with `content`.
8
+ *
9
+ * @remarks
10
+ * This type is meant to be used indirectly. Most commonly as a constraint
11
+ * for generics of message structures.
12
+ *
13
+ * @legacy
14
+ * @alpha
15
+ */
16
+ export interface TypedMessage {
17
+ /**
18
+ * The type of the message.
19
+ */
20
+ type: string;
21
+
22
+ /**
23
+ * The contents of the message.
24
+ */
25
+ content: unknown;
26
+ }
27
+
6
28
  /**
7
29
  * @internal
8
30
  *
@@ -13,7 +35,7 @@
13
35
  *
14
36
  * See at `server/routerlicious/packages/lambdas/src/utils/messageGenerator.ts`.
15
37
  */
16
- export interface ISignalEnvelope {
38
+ export interface ISignalEnvelope<TMessage extends TypedMessage = TypedMessage> {
17
39
  /**
18
40
  * The target for the envelope, undefined for the container
19
41
  */
@@ -27,9 +49,5 @@ export interface ISignalEnvelope {
27
49
  /**
28
50
  * The contents of the envelope
29
51
  */
30
- contents: {
31
- type: string;
32
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- content: any;
34
- };
52
+ contents: TMessage;
35
53
  }