@fluidframework/core-interfaces 2.92.0 → 2.100.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 (103) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/api-report/core-interfaces.beta.api.md +17 -5
  4. package/api-report/core-interfaces.legacy.alpha.api.md +47 -6
  5. package/api-report/core-interfaces.legacy.beta.api.md +47 -6
  6. package/api-report/core-interfaces.legacy.public.api.md +17 -5
  7. package/api-report/core-interfaces.public.api.md +17 -5
  8. package/dist/brandedType.d.ts +14 -1
  9. package/dist/brandedType.d.ts.map +1 -1
  10. package/dist/brandedType.js.map +1 -1
  11. package/dist/deepReadonly.d.ts +3 -3
  12. package/dist/deepReadonly.js.map +1 -1
  13. package/dist/erasedType.d.ts +28 -3
  14. package/dist/erasedType.d.ts.map +1 -1
  15. package/dist/erasedType.js +7 -70
  16. package/dist/erasedType.js.map +1 -1
  17. package/dist/exposedInternalUtilityTypes.d.ts +3 -3
  18. package/dist/exposedInternalUtilityTypes.js.map +1 -1
  19. package/dist/fluidLoadable.d.ts +0 -17
  20. package/dist/fluidLoadable.d.ts.map +1 -1
  21. package/dist/fluidLoadable.js +1 -5
  22. package/dist/fluidLoadable.js.map +1 -1
  23. package/dist/fluidMap.d.ts +133 -0
  24. package/dist/fluidMap.d.ts.map +1 -0
  25. package/dist/fluidMap.js +7 -0
  26. package/dist/fluidMap.js.map +1 -0
  27. package/dist/index.d.ts +4 -3
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +1 -2
  30. package/dist/index.js.map +1 -1
  31. package/dist/jsonDeserialized.d.ts +2 -2
  32. package/dist/jsonDeserialized.js.map +1 -1
  33. package/dist/jsonSerializable.d.ts +2 -2
  34. package/dist/jsonSerializable.js.map +1 -1
  35. package/dist/jsonSerializationErrors.d.ts +2 -2
  36. package/dist/jsonSerializationErrors.js.map +1 -1
  37. package/dist/jsonType.d.ts +3 -3
  38. package/dist/jsonType.js.map +1 -1
  39. package/dist/legacy.alpha.d.ts +7 -2
  40. package/dist/legacy.d.ts +7 -2
  41. package/dist/logger.d.ts +38 -4
  42. package/dist/logger.d.ts.map +1 -1
  43. package/dist/logger.js +7 -4
  44. package/dist/logger.js.map +1 -1
  45. package/dist/opaqueJson.d.ts +2 -2
  46. package/dist/opaqueJson.js.map +1 -1
  47. package/dist/public.d.ts +2 -0
  48. package/eslint.config.mts +1 -1
  49. package/lib/brandedType.d.ts +14 -1
  50. package/lib/brandedType.d.ts.map +1 -1
  51. package/lib/brandedType.js.map +1 -1
  52. package/lib/deepReadonly.d.ts +3 -3
  53. package/lib/deepReadonly.js.map +1 -1
  54. package/lib/erasedType.d.ts +28 -3
  55. package/lib/erasedType.d.ts.map +1 -1
  56. package/lib/erasedType.js +6 -68
  57. package/lib/erasedType.js.map +1 -1
  58. package/lib/exposedInternalUtilityTypes.d.ts +3 -3
  59. package/lib/exposedInternalUtilityTypes.js.map +1 -1
  60. package/lib/fluidLoadable.d.ts +0 -17
  61. package/lib/fluidLoadable.d.ts.map +1 -1
  62. package/lib/fluidLoadable.js +0 -4
  63. package/lib/fluidLoadable.js.map +1 -1
  64. package/lib/fluidMap.d.ts +133 -0
  65. package/lib/fluidMap.d.ts.map +1 -0
  66. package/lib/fluidMap.js +6 -0
  67. package/lib/fluidMap.js.map +1 -0
  68. package/lib/index.d.ts +4 -3
  69. package/lib/index.d.ts.map +1 -1
  70. package/lib/index.js +1 -1
  71. package/lib/index.js.map +1 -1
  72. package/lib/jsonDeserialized.d.ts +2 -2
  73. package/lib/jsonDeserialized.js.map +1 -1
  74. package/lib/jsonSerializable.d.ts +2 -2
  75. package/lib/jsonSerializable.js.map +1 -1
  76. package/lib/jsonSerializationErrors.d.ts +2 -2
  77. package/lib/jsonSerializationErrors.js.map +1 -1
  78. package/lib/jsonType.d.ts +3 -3
  79. package/lib/jsonType.js.map +1 -1
  80. package/lib/legacy.alpha.d.ts +7 -2
  81. package/lib/legacy.d.ts +7 -2
  82. package/lib/logger.d.ts +38 -4
  83. package/lib/logger.d.ts.map +1 -1
  84. package/lib/logger.js +7 -4
  85. package/lib/logger.js.map +1 -1
  86. package/lib/opaqueJson.d.ts +2 -2
  87. package/lib/opaqueJson.js.map +1 -1
  88. package/lib/public.d.ts +2 -0
  89. package/lib/tsdoc-metadata.json +1 -1
  90. package/package.json +7 -8
  91. package/src/brandedType.ts +14 -1
  92. package/src/deepReadonly.ts +3 -3
  93. package/src/erasedType.ts +31 -10
  94. package/src/exposedInternalUtilityTypes.ts +3 -3
  95. package/src/fluidLoadable.ts +0 -21
  96. package/src/fluidMap.ts +151 -0
  97. package/src/index.ts +10 -2
  98. package/src/jsonDeserialized.ts +2 -2
  99. package/src/jsonSerializable.ts +2 -2
  100. package/src/jsonSerializationErrors.ts +2 -2
  101. package/src/jsonType.ts +3 -3
  102. package/src/logger.ts +52 -7
  103. package/src/opaqueJson.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EACX,UAAU,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,0BAA0B,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,eAAe,EACf,oBAAoB,GACpB,MAAM,YAAY,CAAC;AAEpB,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,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,YAAY,EACX,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,kCAAkC,EAClC,0BAA0B,EAC1B,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEpF,YAAY,EACX,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,MAAM,EACN,8BAA8B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC3F,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACnE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,YAAY,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,GAAG,GACH,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EACX,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,gBAAgB,GAChB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,UAAU,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,0BAA0B,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,eAAe,EACf,oBAAoB,GACpB,MAAM,YAAY,CAAC;AAEpB,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,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpD,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,YAAY,EACX,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,kCAAkC,EAClC,0BAA0B,EAC1B,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEpF,YAAY,EACX,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,aAAa,EACb,MAAM,EACN,8BAA8B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC3F,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACnE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,YAAY,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,GAAG,GACH,MAAM,mBAAmB,CAAC"}
package/lib/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export { FluidErrorTypes, FluidErrorTypesAlpha, } from "./error.js";
6
- export { IFluidLoadable, IFluidRunnable } from "./fluidLoadable.js";
6
+ export { IFluidLoadable } from "./fluidLoadable.js";
7
7
  export { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from "./handles.js";
8
8
  export { LogLevel } from "./logger.js";
9
9
  export { ErasedTypeImplementation } from "./erasedType.js";
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,OAAO,EACN,eAAe,EACf,oBAAoB,GACpB,MAAM,YAAY,CAAC;AAcpB,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;AAKvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,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 {\n\tIErrorBase,\n\tIGenericError,\n\tIUsageError,\n\tIThrottlingWarning,\n\tILayerIncompatibilityError,\n} from \"./error.js\";\nexport {\n\tFluidErrorTypes,\n\tFluidErrorTypesAlpha,\n} 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, ErasedBaseType, InstanceTypeRelaxed } from \"./erasedType.js\";\nexport { ErasedTypeImplementation } 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;AAoBH,OAAO,EACN,eAAe,EACf,oBAAoB,GACpB,MAAM,YAAY,CAAC;AAcpB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAmBpD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAWpF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAKvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,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 {\n\tFluidIterable,\n\tFluidIterableIterator,\n\tFluidMap,\n\tFluidReadonlyMap,\n} from \"./fluidMap.js\";\n\nexport type {\n\tIErrorBase,\n\tIGenericError,\n\tIUsageError,\n\tIThrottlingWarning,\n\tILayerIncompatibilityError,\n} from \"./error.js\";\nexport {\n\tFluidErrorTypes,\n\tFluidErrorTypesAlpha,\n} 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 } from \"./fluidLoadable.js\";\nexport { IFluidLoadable } 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\tLogLevelConst,\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, ErasedBaseType, InstanceTypeRelaxed } from \"./erasedType.js\";\nexport { ErasedTypeImplementation } 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"]}
@@ -6,7 +6,7 @@ import type { InternalUtilityTypes } from "./exposedInternalUtilityTypes.js";
6
6
  /**
7
7
  * Options for {@link JsonDeserialized}.
8
8
  *
9
- * @beta
9
+ * @public
10
10
  */
11
11
  export interface JsonDeserializedOptions {
12
12
  /**
@@ -103,7 +103,7 @@ export interface JsonDeserializedOptions {
103
103
  * function foo<T>(): JsonDeserialized<T> { ... }
104
104
  * ```
105
105
  *
106
- * @beta
106
+ * @public
107
107
  */
108
108
  export type JsonDeserialized<T, Options extends JsonDeserializedOptions = {
109
109
  AllowExactly: [];
@@ -1 +1 @@
1
- {"version":3,"file":"jsonDeserialized.js","sourceRoot":"","sources":["../src/jsonDeserialized.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { InternalUtilityTypes } from \"./exposedInternalUtilityTypes.js\";\n\n/**\n * Options for {@link JsonDeserialized}.\n *\n * @beta\n */\nexport interface JsonDeserializedOptions {\n\t/**\n\t * Tuple of exact types that are managed by custom deserialization logic (beyond\n\t * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse|JSON.parse}\n\t * without a reviver). Only exact types matching specification will be\n\t * preserved unaltered.\n\t *\n\t * The default value is `[]`.\n\t */\n\tAllowExactly?: unknown[];\n\n\t/**\n\t * General types that are managed by custom deserialization logic (beyond\n\t * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse|JSON.parse}\n\t * without a reviver). Any type satisfying specification will be preserved\n\t * unaltered.\n\t *\n\t * The default value is `never`.\n\t */\n\tAllowExtensionOf?: unknown;\n}\n\n/**\n * Produces a type that results from a type `T` serialized and deserialized\n * through JSON using {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}\n * (without replacer) and {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse|JSON.parse}\n * (without reviver), respectively as base model.\n *\n * @typeParam T - The type that was serialized.\n * @typeParam Options - Options for the filter. See {@link JsonDeserializedOptions}.\n *\n * @remarks\n * Before adding use of this utility type, consider using a utility like\n * {@link https://github.com/sinclairzx81/typebox#readme | TypeBox} that allows\n * for runtime validation.\n *\n * This filter can be used to derive the expected type of a JSON deserialized\n * value whether or not the type of value serialized meets serialization\n * constraints (see {@link JsonSerializable} including serialization pitfalls).\n *\n * When used as a filter to inferred generic `T`, a compile-time error can be\n * produced trying to assign `JsonDeserialized<T>` to `T`.\n *\n * Simply deserialized JSON never contains `bigint`, `undefined`, `symbol`,\n * or function values. (Object properties which had those types before encoding\n * are omitted during serialization and thus won't be present after\n * deserialization.) Therefore, through this filter, such properties:\n *\n * - become optional with those types excluded (when there are other supported\n * types in union)\n *\n * - are removed (when nothing else in union is supported)\n *\n * - in an array are (1) replaced with `null` if `undefined`, `symbol`, and\n * function values or (2) simply removed (become `never`) if `bigint` value as\n * serialization attempts will throw.\n *\n * Examples results:\n *\n * | Before serialization | After deserialization | After in record | After in array |\n * | --------------------- | --------------------- | ------------------ | --------------------:|\n * | `undefined \\| number` | `number` | `prop?: number` | `(number \\| null)[]` |\n * | `symbol \\| number` | `number` | `prop?: number` | `(number \\| null)[]` |\n * | `bigint \\| number` | `number` | `prop: number` | `number[]` |\n * | `undefined` | N/A `never` | (prop not present) | `null[]` |\n * | `symbol` | N/A `never` | (prop not present) | `null[]` |\n * | `bigint` | N/A `never` | N/A (prop not present) | N/A `never[]` |\n * | `bigint \\| symbol` | N/A `never` | (prop not present) | `null[]` |\n * | `bigint \\| number \\| symbol` | `number` | `prop?: number` | `(number \\| null)[]` |\n *\n * Setter and getter properties become value properties after filtering\n * although no data will be persisted assuming those properties are backed\n * by functions. If an implementation of getter/setter interface uses a\n * simple data member (of supported type), that will persist.\n *\n * Recursive types without any required modification are preserved intact.\n * Recursive types that require modification are unrolled a limited number of\n * times (currently 4) and then further instances of recursion are replaced with\n * {@link JsonTypeWith|JsonTypeWith<Options.AllowExactly[number] \"or\" Options.AllowExtensionOf>}.\n *\n * Under basic serialization, class instances become simple data objects that\n * lose hidden properties and prototypes that are required for `instanceof`\n * runtime checks. An exception is made for classes that are intersected with\n * primitive types (specifically `boolean`, `string`, and `number`) under the\n * assumption that such classes are present only as type modifiers (as would\n * be the case for branding) and not as require runtime values.\n *\n * The optional 'Options.AllowExactly' and 'Options.AllowExtensionOf'\n * parameters may be used to permit additional leaf types handled by custom\n * serialization/deserialization logic.\n *\n * @example Example usage\n *\n * ```typescript\n * function foo<T>(): JsonDeserialized<T> { ... }\n * ```\n *\n * @beta\n */\nexport type JsonDeserialized<\n\tT,\n\tOptions extends JsonDeserializedOptions = {\n\t\tAllowExactly: [];\n\t\tAllowExtensionOf: never;\n\t},\n> = InternalUtilityTypes.JsonDeserializedImpl<T, Options>;\n"]}
1
+ {"version":3,"file":"jsonDeserialized.js","sourceRoot":"","sources":["../src/jsonDeserialized.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { InternalUtilityTypes } from \"./exposedInternalUtilityTypes.js\";\n\n/**\n * Options for {@link JsonDeserialized}.\n *\n * @public\n */\nexport interface JsonDeserializedOptions {\n\t/**\n\t * Tuple of exact types that are managed by custom deserialization logic (beyond\n\t * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse|JSON.parse}\n\t * without a reviver). Only exact types matching specification will be\n\t * preserved unaltered.\n\t *\n\t * The default value is `[]`.\n\t */\n\tAllowExactly?: unknown[];\n\n\t/**\n\t * General types that are managed by custom deserialization logic (beyond\n\t * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse|JSON.parse}\n\t * without a reviver). Any type satisfying specification will be preserved\n\t * unaltered.\n\t *\n\t * The default value is `never`.\n\t */\n\tAllowExtensionOf?: unknown;\n}\n\n/**\n * Produces a type that results from a type `T` serialized and deserialized\n * through JSON using {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}\n * (without replacer) and {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse|JSON.parse}\n * (without reviver), respectively as base model.\n *\n * @typeParam T - The type that was serialized.\n * @typeParam Options - Options for the filter. See {@link JsonDeserializedOptions}.\n *\n * @remarks\n * Before adding use of this utility type, consider using a utility like\n * {@link https://github.com/sinclairzx81/typebox#readme | TypeBox} that allows\n * for runtime validation.\n *\n * This filter can be used to derive the expected type of a JSON deserialized\n * value whether or not the type of value serialized meets serialization\n * constraints (see {@link JsonSerializable} including serialization pitfalls).\n *\n * When used as a filter to inferred generic `T`, a compile-time error can be\n * produced trying to assign `JsonDeserialized<T>` to `T`.\n *\n * Simply deserialized JSON never contains `bigint`, `undefined`, `symbol`,\n * or function values. (Object properties which had those types before encoding\n * are omitted during serialization and thus won't be present after\n * deserialization.) Therefore, through this filter, such properties:\n *\n * - become optional with those types excluded (when there are other supported\n * types in union)\n *\n * - are removed (when nothing else in union is supported)\n *\n * - in an array are (1) replaced with `null` if `undefined`, `symbol`, and\n * function values or (2) simply removed (become `never`) if `bigint` value as\n * serialization attempts will throw.\n *\n * Examples results:\n *\n * | Before serialization | After deserialization | After in record | After in array |\n * | --------------------- | --------------------- | ------------------ | --------------------:|\n * | `undefined \\| number` | `number` | `prop?: number` | `(number \\| null)[]` |\n * | `symbol \\| number` | `number` | `prop?: number` | `(number \\| null)[]` |\n * | `bigint \\| number` | `number` | `prop: number` | `number[]` |\n * | `undefined` | N/A `never` | (prop not present) | `null[]` |\n * | `symbol` | N/A `never` | (prop not present) | `null[]` |\n * | `bigint` | N/A `never` | N/A (prop not present) | N/A `never[]` |\n * | `bigint \\| symbol` | N/A `never` | (prop not present) | `null[]` |\n * | `bigint \\| number \\| symbol` | `number` | `prop?: number` | `(number \\| null)[]` |\n *\n * Setter and getter properties become value properties after filtering\n * although no data will be persisted assuming those properties are backed\n * by functions. If an implementation of getter/setter interface uses a\n * simple data member (of supported type), that will persist.\n *\n * Recursive types without any required modification are preserved intact.\n * Recursive types that require modification are unrolled a limited number of\n * times (currently 4) and then further instances of recursion are replaced with\n * {@link JsonTypeWith|JsonTypeWith<Options.AllowExactly[number] \"or\" Options.AllowExtensionOf>}.\n *\n * Under basic serialization, class instances become simple data objects that\n * lose hidden properties and prototypes that are required for `instanceof`\n * runtime checks. An exception is made for classes that are intersected with\n * primitive types (specifically `boolean`, `string`, and `number`) under the\n * assumption that such classes are present only as type modifiers (as would\n * be the case for branding) and not as require runtime values.\n *\n * The optional 'Options.AllowExactly' and 'Options.AllowExtensionOf'\n * parameters may be used to permit additional leaf types handled by custom\n * serialization/deserialization logic.\n *\n * @example Example usage\n *\n * ```typescript\n * function foo<T>(): JsonDeserialized<T> { ... }\n * ```\n *\n * @public\n */\nexport type JsonDeserialized<\n\tT,\n\tOptions extends JsonDeserializedOptions = {\n\t\tAllowExactly: [];\n\t\tAllowExtensionOf: never;\n\t},\n> = InternalUtilityTypes.JsonDeserializedImpl<T, Options>;\n"]}
@@ -6,7 +6,7 @@ import type { InternalUtilityTypes } from "./exposedInternalUtilityTypes.js";
6
6
  /**
7
7
  * Options for {@link JsonSerializable}.
8
8
  *
9
- * @beta
9
+ * @public
10
10
  */
11
11
  export interface JsonSerializableOptions {
12
12
  /**
@@ -125,7 +125,7 @@ export interface JsonSerializableOptions {
125
125
  * proper use, that will never be an issue as any filtering of types will happen
126
126
  * before T recursion.
127
127
  *
128
- * @beta
128
+ * @public
129
129
  */
130
130
  export type JsonSerializable<T, Options extends JsonSerializableOptions = {
131
131
  AllowExactly: [];
@@ -1 +1 @@
1
- {"version":3,"file":"jsonSerializable.js","sourceRoot":"","sources":["../src/jsonSerializable.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { InternalUtilityTypes } from \"./exposedInternalUtilityTypes.js\";\n\n/**\n * Options for {@link JsonSerializable}.\n *\n * @beta\n */\nexport interface JsonSerializableOptions {\n\t/**\n\t * Tuple of exact types that are managed by custom serialization logic (beyond\n\t * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}\n\t * without a replacer). Only exact types matching specification will be\n\t * preserved unaltered.\n\t *\n\t * The default value is `[]`.\n\t */\n\tAllowExactly?: unknown[];\n\n\t/**\n\t * General types that are managed by custom serialization logic (beyond\n\t * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}\n\t * without a replacer). Any type satisfying specification will be preserved\n\t * unaltered.\n\t *\n\t * The default value is `never`.\n\t */\n\tAllowExtensionOf?: unknown;\n\n\t/**\n\t * When set, inaccessible (protected and private) members throughout type T are\n\t * ignored as if not present. Otherwise, inaccessible members are considered\n\t * an error (type checking will mention `SerializationErrorPerNonPublicProperties`).\n\t *\n\t * @remarks\n\t * For this option to be set and accurately filter inaccessible members, all\n\t * inaccessible members (if any) must be either inherited, symbol keyed, or\n\t * non-enumerable.\n\t *\n\t * The default is that `IgnoreInaccessibleMembers` property is not specified,\n\t * which means that inaccessible members are considered an error, even if\n\t * they would not be serialized at runtime.\n\t */\n\tIgnoreInaccessibleMembers?: \"ignore-inaccessible-members\";\n}\n\n/**\n * Used to constrain a type `T` to types that are serializable as JSON\n * using {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}\n * (without a replacer) as base model.\n *\n * Under typical use a compile-time error is produced if `T` contains\n * non-JsonSerializable members.\n *\n * @typeParam T - The type to be constrained.\n * @typeParam Options - Options for the filter. See {@link JsonSerializableOptions}.\n *\n * @remarks\n * Before adding use of this utility type, consider using a utility like\n * {@link https://github.com/sinclairzx81/typebox#readme | TypeBox} that allows\n * for runtime validation.\n *\n * Note that this does NOT prevent use of values with non-JSON compatible data,\n * it only prevents using values with types that include non-JSON compatible data.\n * This means that one can, for example, pass in a value typed with JSON compatible\n * interface into this filter, that could actually be a class with lots on non-JSON\n * compatible fields and methods.\n *\n * Important: `T extends JsonSerializable<T>` is incorrect (does not even compile).\n *\n * The optional `Options.Allow*` parameters may be used to permit additional leaf types\n * to support situations where a `replacer` is used to handle special values (e.g.,\n * `JsonSerializable<{ x: IFluidHandle }, { AllowExtensionOf: IFluidHandle }>`).\n *\n * Note that `JsonSerializable<T>` does not protect against the following pitfalls\n * when serializing with JSON.stringify():\n *\n * - Non-finite numbers (`NaN`, `+/-Infinity`) are coerced to `null`.\n *\n * - Prototypes and non-enumerable properties are lost.\n *\n * - `ArrayLike` types that are not arrays and are serialized as `{ length: number }`.\n *\n * - Getter and setters properties are lost. (Though appear supported.)\n *\n * - Functions with properties may be absent or the properties may be preserved\n * depending on the runtime typo of the value. (If built via Object.assign the\n * target member's type is preserved.) typeof =\\> 'function' is lost whereas when\n * typeof =\\> 'object' the properties are preserved.\n *\n * - Sparse arrays are filled with `null`.\n *\n * Also, `JsonSerializable<T>` does not prevent the construction of circular references.\n *\n * Specifying `JsonSerializable<unknown>` or `JsonSerializable<any>` yields a type\n * alias for {@link JsonTypeWith}`<never>` | {@link OpaqueJsonSerializable}`<unknown>`\n * and should not be used if precise type safety is desired.\n *\n * Class instances are indistinguishable from general objects by type checking\n * unless they have non-public members.\n *\n * - Unless `Option.IgnoreInaccessibleMembers` is used, types with non-public\n * members will result in {@link SerializationErrorPerNonPublicProperties}.\n * When `Option.IgnoreInaccessibleMembers` is `ignore-inaccessible-members`,\n * non-public (non-function) members are preserved without error, but they are\n * filtered away by the type filters and thus produce an incorrectly narrowed\n * type compared to actual data. Though such a result may be customer desired.\n *\n * - An exception is made for classes that are intersected with primitives\n * (specifically `boolean`, `number`, * and `string`). In these cases, it is\n * assumed that the class only exists as a type modifier and not as a value\n * at runtime, and thus the class is permitted as no serialization is required.\n *\n * Perhaps a https://github.com/microsoft/TypeScript/issues/22677 fix will\n * enable better support.\n *\n * @example Typical usage\n *\n * ```typescript\n * function foo<T>(value: JsonSerializable<T>) { ... }\n * ```\n *\n * @privateRemarks\n * Upon recursion, the original type T is preserved intact. This is done to prevent\n * infinite recursion and produces a technically incorrect result type. However, with\n * proper use, that will never be an issue as any filtering of types will happen\n * before T recursion.\n *\n * @beta\n */\nexport type JsonSerializable<\n\tT,\n\tOptions extends JsonSerializableOptions = {\n\t\tAllowExactly: [];\n\t\tAllowExtensionOf: never;\n\t},\n> = InternalUtilityTypes.JsonSerializableImpl<T, Options>;\n"]}
1
+ {"version":3,"file":"jsonSerializable.js","sourceRoot":"","sources":["../src/jsonSerializable.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { InternalUtilityTypes } from \"./exposedInternalUtilityTypes.js\";\n\n/**\n * Options for {@link JsonSerializable}.\n *\n * @public\n */\nexport interface JsonSerializableOptions {\n\t/**\n\t * Tuple of exact types that are managed by custom serialization logic (beyond\n\t * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}\n\t * without a replacer). Only exact types matching specification will be\n\t * preserved unaltered.\n\t *\n\t * The default value is `[]`.\n\t */\n\tAllowExactly?: unknown[];\n\n\t/**\n\t * General types that are managed by custom serialization logic (beyond\n\t * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}\n\t * without a replacer). Any type satisfying specification will be preserved\n\t * unaltered.\n\t *\n\t * The default value is `never`.\n\t */\n\tAllowExtensionOf?: unknown;\n\n\t/**\n\t * When set, inaccessible (protected and private) members throughout type T are\n\t * ignored as if not present. Otherwise, inaccessible members are considered\n\t * an error (type checking will mention `SerializationErrorPerNonPublicProperties`).\n\t *\n\t * @remarks\n\t * For this option to be set and accurately filter inaccessible members, all\n\t * inaccessible members (if any) must be either inherited, symbol keyed, or\n\t * non-enumerable.\n\t *\n\t * The default is that `IgnoreInaccessibleMembers` property is not specified,\n\t * which means that inaccessible members are considered an error, even if\n\t * they would not be serialized at runtime.\n\t */\n\tIgnoreInaccessibleMembers?: \"ignore-inaccessible-members\";\n}\n\n/**\n * Used to constrain a type `T` to types that are serializable as JSON\n * using {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}\n * (without a replacer) as base model.\n *\n * Under typical use a compile-time error is produced if `T` contains\n * non-JsonSerializable members.\n *\n * @typeParam T - The type to be constrained.\n * @typeParam Options - Options for the filter. See {@link JsonSerializableOptions}.\n *\n * @remarks\n * Before adding use of this utility type, consider using a utility like\n * {@link https://github.com/sinclairzx81/typebox#readme | TypeBox} that allows\n * for runtime validation.\n *\n * Note that this does NOT prevent use of values with non-JSON compatible data,\n * it only prevents using values with types that include non-JSON compatible data.\n * This means that one can, for example, pass in a value typed with JSON compatible\n * interface into this filter, that could actually be a class with lots on non-JSON\n * compatible fields and methods.\n *\n * Important: `T extends JsonSerializable<T>` is incorrect (does not even compile).\n *\n * The optional `Options.Allow*` parameters may be used to permit additional leaf types\n * to support situations where a `replacer` is used to handle special values (e.g.,\n * `JsonSerializable<{ x: IFluidHandle }, { AllowExtensionOf: IFluidHandle }>`).\n *\n * Note that `JsonSerializable<T>` does not protect against the following pitfalls\n * when serializing with JSON.stringify():\n *\n * - Non-finite numbers (`NaN`, `+/-Infinity`) are coerced to `null`.\n *\n * - Prototypes and non-enumerable properties are lost.\n *\n * - `ArrayLike` types that are not arrays and are serialized as `{ length: number }`.\n *\n * - Getter and setters properties are lost. (Though appear supported.)\n *\n * - Functions with properties may be absent or the properties may be preserved\n * depending on the runtime typo of the value. (If built via Object.assign the\n * target member's type is preserved.) typeof =\\> 'function' is lost whereas when\n * typeof =\\> 'object' the properties are preserved.\n *\n * - Sparse arrays are filled with `null`.\n *\n * Also, `JsonSerializable<T>` does not prevent the construction of circular references.\n *\n * Specifying `JsonSerializable<unknown>` or `JsonSerializable<any>` yields a type\n * alias for {@link JsonTypeWith}`<never>` | {@link OpaqueJsonSerializable}`<unknown>`\n * and should not be used if precise type safety is desired.\n *\n * Class instances are indistinguishable from general objects by type checking\n * unless they have non-public members.\n *\n * - Unless `Option.IgnoreInaccessibleMembers` is used, types with non-public\n * members will result in {@link SerializationErrorPerNonPublicProperties}.\n * When `Option.IgnoreInaccessibleMembers` is `ignore-inaccessible-members`,\n * non-public (non-function) members are preserved without error, but they are\n * filtered away by the type filters and thus produce an incorrectly narrowed\n * type compared to actual data. Though such a result may be customer desired.\n *\n * - An exception is made for classes that are intersected with primitives\n * (specifically `boolean`, `number`, * and `string`). In these cases, it is\n * assumed that the class only exists as a type modifier and not as a value\n * at runtime, and thus the class is permitted as no serialization is required.\n *\n * Perhaps a https://github.com/microsoft/TypeScript/issues/22677 fix will\n * enable better support.\n *\n * @example Typical usage\n *\n * ```typescript\n * function foo<T>(value: JsonSerializable<T>) { ... }\n * ```\n *\n * @privateRemarks\n * Upon recursion, the original type T is preserved intact. This is done to prevent\n * infinite recursion and produces a technically incorrect result type. However, with\n * proper use, that will never be an issue as any filtering of types will happen\n * before T recursion.\n *\n * @public\n */\nexport type JsonSerializable<\n\tT,\n\tOptions extends JsonSerializableOptions = {\n\t\tAllowExactly: [];\n\t\tAllowExtensionOf: never;\n\t},\n> = InternalUtilityTypes.JsonSerializableImpl<T, Options>;\n"]}
@@ -9,7 +9,7 @@
9
9
  * @privateRemarks type is used over interface; so inspection of type
10
10
  * result can be more informative than just the type name.
11
11
  *
12
- * @beta
12
+ * @public
13
13
  * @system
14
14
  */
15
15
  export type SerializationErrorPerUndefinedArrayElement = {
@@ -22,7 +22,7 @@ export type SerializationErrorPerUndefinedArrayElement = {
22
22
  * @privateRemarks type is used over interface; so inspection of type
23
23
  * result can be more informative than just the type name.
24
24
  *
25
- * @beta
25
+ * @public
26
26
  * @system
27
27
  */
28
28
  export type SerializationErrorPerNonPublicProperties = {
@@ -1 +1 @@
1
- {"version":3,"file":"jsonSerializationErrors.js","sourceRoot":"","sources":["../src/jsonSerializationErrors.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 * Type resulting from {@link JsonSerializable} use given an array with\n * `undefined` elements.\n *\n * @privateRemarks type is used over interface; so inspection of type\n * result can be more informative than just the type name.\n *\n * @beta\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type SerializationErrorPerUndefinedArrayElement = {\n\t\"array serialization error\": \"undefined elements are not supported\";\n};\n\n/**\n * Type resulting from {@link JsonSerializable} use given a class with\n * non-public properties.\n *\n * @privateRemarks type is used over interface; so inspection of type\n * result can be more informative than just the type name.\n *\n * @beta\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type SerializationErrorPerNonPublicProperties = {\n\t\"object serialization error\": \"non-public properties are not supported\";\n};\n"]}
1
+ {"version":3,"file":"jsonSerializationErrors.js","sourceRoot":"","sources":["../src/jsonSerializationErrors.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 * Type resulting from {@link JsonSerializable} use given an array with\n * `undefined` elements.\n *\n * @privateRemarks type is used over interface; so inspection of type\n * result can be more informative than just the type name.\n *\n * @public\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type SerializationErrorPerUndefinedArrayElement = {\n\t\"array serialization error\": \"undefined elements are not supported\";\n};\n\n/**\n * Type resulting from {@link JsonSerializable} use given a class with\n * non-public properties.\n *\n * @privateRemarks type is used over interface; so inspection of type\n * result can be more informative than just the type name.\n *\n * @public\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type SerializationErrorPerNonPublicProperties = {\n\t\"object serialization error\": \"non-public properties are not supported\";\n};\n"]}
package/lib/jsonType.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * Prefer using `JsonSerializable<unknown>` or `JsonDeserialized<unknown>` over this type that
15
15
  * is an implementation detail.
16
16
  *
17
- * @beta
17
+ * @public
18
18
  */
19
19
  export type JsonTypeWith<T> = null | boolean | number | string | T | {
20
20
  [key: string | number]: JsonTypeWith<T>;
@@ -22,7 +22,7 @@ export type JsonTypeWith<T> = null | boolean | number | string | T | {
22
22
  /**
23
23
  * Portion of {@link JsonTypeWith} that is an object (including array) and not null.
24
24
  *
25
- * @beta
25
+ * @public
26
26
  */
27
27
  export type NonNullJsonObjectWith<T> = {
28
28
  [key: string | number]: JsonTypeWith<T>;
@@ -42,7 +42,7 @@ export type NonNullJsonObjectWith<T> = {
42
42
  * ```
43
43
  * does not prevent later `x = 5`. (Does prevent `x.a = 2`.)
44
44
  *
45
- * @beta
45
+ * @public
46
46
  */
47
47
  export type ReadonlyJsonTypeWith<TReadonlyAlternates> = null | boolean | number | string | TReadonlyAlternates | {
48
48
  readonly [key: string | number]: ReadonlyJsonTypeWith<TReadonlyAlternates>;
@@ -1 +1 @@
1
- {"version":3,"file":"jsonType.js","sourceRoot":"","sources":["../src/jsonType.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 * Type constraint for types that are likely encodable as JSON, deserializable from JSON,\n * or have a custom alternate type.\n *\n * @remarks\n * Use `JsonTypeWith<never>` for just JSON encodable/deserializable types.\n * See {@link JsonSerializable} for encoding pitfalls.\n *\n * @privateRemarks\n * Prefer using `JsonSerializable<unknown>` or `JsonDeserialized<unknown>` over this type that\n * is an implementation detail.\n *\n * @beta\n */\nexport type JsonTypeWith<T> =\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| boolean\n\t| number\n\t| string\n\t| T\n\t| { [key: string | number]: JsonTypeWith<T> }\n\t| JsonTypeWith<T>[];\n\n/**\n * Portion of {@link JsonTypeWith} that is an object (including array) and not null.\n *\n * @beta\n */\nexport type NonNullJsonObjectWith<T> =\n\t| { [key: string | number]: JsonTypeWith<T> }\n\t| JsonTypeWith<T>[];\n\n/**\n * Deeply immutable type that is encodable as JSON and deserializable from JSON.\n *\n * @typeParam TReadonlyAlternates - Additional [immutable] types that are supported.\n *\n * @remarks\n * If `TReadonlyAlternates` is allowed as-is. So if it is not immutable, then result type\n * is not wholly immutable.\n *\n * A `const` variable is still required to avoid top-level mutability. I.e.\n * ```typescript\n * let x: ReadonlyJsonTypeWith<never> = { a: 1 };\n * ```\n * does not prevent later `x = 5`. (Does prevent `x.a = 2`.)\n *\n * @beta\n */\nexport type ReadonlyJsonTypeWith<TReadonlyAlternates> =\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| boolean\n\t| number\n\t| string\n\t| TReadonlyAlternates\n\t| { readonly [key: string | number]: ReadonlyJsonTypeWith<TReadonlyAlternates> }\n\t| readonly ReadonlyJsonTypeWith<TReadonlyAlternates>[];\n\n/**\n * Portion of {@link ReadonlyJsonTypeWith} that is an object (including array) and not null.\n *\n * @internal\n */\nexport type ReadonlyNonNullJsonObjectWith<TReadonlyAlternates> =\n\t| { readonly [key: string | number]: ReadonlyJsonTypeWith<TReadonlyAlternates> }\n\t| readonly ReadonlyJsonTypeWith<TReadonlyAlternates>[];\n"]}
1
+ {"version":3,"file":"jsonType.js","sourceRoot":"","sources":["../src/jsonType.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 * Type constraint for types that are likely encodable as JSON, deserializable from JSON,\n * or have a custom alternate type.\n *\n * @remarks\n * Use `JsonTypeWith<never>` for just JSON encodable/deserializable types.\n * See {@link JsonSerializable} for encoding pitfalls.\n *\n * @privateRemarks\n * Prefer using `JsonSerializable<unknown>` or `JsonDeserialized<unknown>` over this type that\n * is an implementation detail.\n *\n * @public\n */\nexport type JsonTypeWith<T> =\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| boolean\n\t| number\n\t| string\n\t| T\n\t| { [key: string | number]: JsonTypeWith<T> }\n\t| JsonTypeWith<T>[];\n\n/**\n * Portion of {@link JsonTypeWith} that is an object (including array) and not null.\n *\n * @public\n */\nexport type NonNullJsonObjectWith<T> =\n\t| { [key: string | number]: JsonTypeWith<T> }\n\t| JsonTypeWith<T>[];\n\n/**\n * Deeply immutable type that is encodable as JSON and deserializable from JSON.\n *\n * @typeParam TReadonlyAlternates - Additional [immutable] types that are supported.\n *\n * @remarks\n * If `TReadonlyAlternates` is allowed as-is. So if it is not immutable, then result type\n * is not wholly immutable.\n *\n * A `const` variable is still required to avoid top-level mutability. I.e.\n * ```typescript\n * let x: ReadonlyJsonTypeWith<never> = { a: 1 };\n * ```\n * does not prevent later `x = 5`. (Does prevent `x.a = 2`.)\n *\n * @public\n */\nexport type ReadonlyJsonTypeWith<TReadonlyAlternates> =\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| boolean\n\t| number\n\t| string\n\t| TReadonlyAlternates\n\t| { readonly [key: string | number]: ReadonlyJsonTypeWith<TReadonlyAlternates> }\n\t| readonly ReadonlyJsonTypeWith<TReadonlyAlternates>[];\n\n/**\n * Portion of {@link ReadonlyJsonTypeWith} that is an object (including array) and not null.\n *\n * @internal\n */\nexport type ReadonlyNonNullJsonObjectWith<TReadonlyAlternates> =\n\t| { readonly [key: string | number]: ReadonlyJsonTypeWith<TReadonlyAlternates> }\n\t| readonly ReadonlyJsonTypeWith<TReadonlyAlternates>[];\n"]}
@@ -10,6 +10,7 @@
10
10
 
11
11
  export {
12
12
  // #region @public APIs
13
+ BrandedType,
13
14
  ConfigTypes,
14
15
  ErasedType,
15
16
  ExtendEventProvider,
@@ -38,6 +39,7 @@ export {
38
39
  Listenable,
39
40
  Listeners,
40
41
  LogLevel,
42
+ LogLevelConst,
41
43
  Off,
42
44
  ReplaceIEventThisPlaceHolder,
43
45
  Tagged,
@@ -47,8 +49,11 @@ export {
47
49
  // #endregion
48
50
 
49
51
  // #region @beta APIs
50
- BrandedType,
51
- ErasedBaseType,
52
+ ErasedBaseType,
53
+ FluidIterable,
54
+ FluidIterableIterator,
55
+ FluidMap,
56
+ FluidReadonlyMap,
52
57
  // #endregion
53
58
 
54
59
  // #region @legacyBeta APIs
package/lib/legacy.d.ts CHANGED
@@ -10,6 +10,7 @@
10
10
 
11
11
  export {
12
12
  // #region @public APIs
13
+ BrandedType,
13
14
  ConfigTypes,
14
15
  ErasedType,
15
16
  ExtendEventProvider,
@@ -38,6 +39,7 @@ export {
38
39
  Listenable,
39
40
  Listeners,
40
41
  LogLevel,
42
+ LogLevelConst,
41
43
  Off,
42
44
  ReplaceIEventThisPlaceHolder,
43
45
  Tagged,
@@ -47,8 +49,11 @@ export {
47
49
  // #endregion
48
50
 
49
51
  // #region @beta APIs
50
- BrandedType,
51
- ErasedBaseType,
52
+ ErasedBaseType,
53
+ FluidIterable,
54
+ FluidIterableIterator,
55
+ FluidMap,
56
+ FluidReadonlyMap,
52
57
  // #endregion
53
58
 
54
59
  // #region @legacyBeta APIs
package/lib/logger.d.ts CHANGED
@@ -47,13 +47,47 @@ export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
47
47
  }
48
48
  /**
49
49
  * Specify levels of the logs.
50
+ *
51
+ * @privateRemarks This interface exists solely for documentation. API Extractor does not
52
+ * propagate TSDoc comments from a const's inline type to API reports, so we define the shape
53
+ * here and use LogLevelConst on the LogLevel const to surface member docs.
54
+ *
50
55
  * @public
51
56
  */
52
- export declare const LogLevel: {
57
+ export interface LogLevelConst {
58
+ /**
59
+ * Chatty logs useful for debugging.
60
+ * @remarks They need not be collected in production.
61
+ */
53
62
  readonly verbose: 10;
63
+ /**
64
+ * Information about the session.
65
+ * @remarks These logs could be omitted in some sessions if needed (e.g. to reduce overall telemetry volume).
66
+ * If any are collected from a particular session, all should be.
67
+ */
68
+ readonly info: 20;
69
+ /**
70
+ * Essential information about the operation of Fluid.
71
+ * @remarks It is recommended that these should always be collected, even in production, for diagnostic purposes.
72
+ */
73
+ readonly essential: 30;
74
+ /**
75
+ * Default LogLevel
76
+ * @remarks Prefer {@link LogLevelConst.info | LogLevel.info} when selecting a level explicitly since this will be deprecated and removed in a future release.
77
+ */
54
78
  readonly default: 20;
79
+ /**
80
+ * To log errors.
81
+ * @remarks Prefer {@link LogLevelConst.essential | LogLevel.essential} when selecting a level since this will be deprecated and removed in a future release.
82
+ */
55
83
  readonly error: 30;
56
- };
84
+ }
85
+ /**
86
+ * Provides runtime {@link (LogLevel:type)} values via symbolic names
87
+ * @see {@link LogLevelConst} type.
88
+ * @public
89
+ */
90
+ export declare const LogLevel: LogLevelConst;
57
91
  /**
58
92
  * Specify a level to the log to filter out logs based on the level.
59
93
  * @public
@@ -68,12 +102,12 @@ export interface ITelemetryBaseLogger {
68
102
  /**
69
103
  * Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).
70
104
  * @param event - The event to log.
71
- * @param logLevel - The log level of the event. Default: {@link (LogLevel:variable).default}.
105
+ * @param logLevel - The log level of the event. Default: {@link LogLevelConst.default | LogLevel.default}.
72
106
  */
73
107
  send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
74
108
  /**
75
109
  * Minimum log level to be logged.
76
- * @defaultValue {@link (LogLevel:variable).default}
110
+ * @defaultValue {@link LogLevelConst.default | LogLevel.default}.
77
111
  */
78
112
  minLogLevel?: LogLevel;
79
113
  }
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,8BAA8B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IACnD,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,EAAE,CAAC,CAAC;CACP;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,CAAC,KAAK,EAAE,MAAM,GAAG,8BAA8B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;CACzF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;OAIG;IACH,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5D;;;OAGG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB;IACrE,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC3C;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;CACnD"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,8BAA8B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IACnD,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,EAAE,CAAC,CAAC;CACP;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,CAAC,KAAK,EAAE,MAAM,GAAG,8BAA8B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;CACzF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;IAErB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,aAMtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;OAIG;IACH,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5D;;;OAGG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB;IACrE,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC3C;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;CACnD"}
package/lib/logger.js CHANGED
@@ -3,12 +3,15 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * Specify levels of the logs.
6
+ * Provides runtime {@link (LogLevel:type)} values via symbolic names
7
+ * @see {@link LogLevelConst} type.
7
8
  * @public
8
9
  */
9
10
  export const LogLevel = {
10
- verbose: 10, // To log any verbose event for example when you are debugging something.
11
- default: 20, // Default log level
12
- error: 30, // To log errors.
11
+ verbose: 10,
12
+ info: 20,
13
+ essential: 30,
14
+ default: 20,
15
+ error: 30,
13
16
  };
14
17
  //# sourceMappingURL=logger.js.map
package/lib/logger.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiDH;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE,EAAE,yEAAyE;IACtF,OAAO,EAAE,EAAE,EAAE,oBAAoB;IACjC,KAAK,EAAE,EAAE,EAAE,iBAAiB;CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Property types that can be logged.\n *\n * @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can\n * easily add fields to objects that shouldn't be logged and not realize it's going to be logged.\n * General best practice is to explicitly log the fields you care about from objects.\n * @public\n */\nexport type TelemetryBaseEventPropertyType = string | number | boolean | undefined;\n\n/**\n * A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.\n * This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).\n *\n * This indicates that the value should be organized or handled differently by loggers in various first or third\n * party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.\n * @public\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n * @public\n */\nexport interface ITelemetryBaseProperties {\n\t/**\n\t * Properties of a telemetry event. They are string-indexed, and their values restricted to a known set of\n\t * types (optionally \"wrapped\" with {@link Tagged}).\n\t */\n\t[index: string]: TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType>;\n}\n\n/**\n * Base interface for logging telemetry statements.\n * Can contain any number of properties that get serialized as json payload.\n * @param category - category of the event, like \"error\", \"performance\", \"generic\", etc.\n * @param eventName - name of the event.\n * @public\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n * @public\n */\nexport const LogLevel = {\n\tverbose: 10, // To log any verbose event for example when you are debugging something.\n\tdefault: 20, // Default log level\n\terror: 30, // To log errors.\n} as const;\n\n/**\n * Specify a level to the log to filter out logs based on the level.\n * @public\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n * @public\n */\nexport interface ITelemetryBaseLogger {\n\t/**\n\t * Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).\n\t * @param event - The event to log.\n\t * @param logLevel - The log level of the event. Default: {@link (LogLevel:variable).default}.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Minimum log level to be logged.\n\t * @defaultValue {@link (LogLevel:variable).default}\n\t */\n\tminLogLevel?: LogLevel;\n}\n\n/**\n * Error telemetry event.\n * Maps to category = \"error\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n * @public\n */\nexport interface ITelemetryErrorEvent extends ITelemetryBaseProperties {\n\teventName: string;\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n * @legacy @beta\n */\nexport interface ILoggingError extends Error {\n\t/**\n\t * Return all properties from this object that should be logged to telemetry\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n}\n"]}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2FH;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACtC,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;IACR,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;CACT,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Property types that can be logged.\n *\n * @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can\n * easily add fields to objects that shouldn't be logged and not realize it's going to be logged.\n * General best practice is to explicitly log the fields you care about from objects.\n * @public\n */\nexport type TelemetryBaseEventPropertyType = string | number | boolean | undefined;\n\n/**\n * A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.\n * This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).\n *\n * This indicates that the value should be organized or handled differently by loggers in various first or third\n * party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.\n * @public\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n * @public\n */\nexport interface ITelemetryBaseProperties {\n\t/**\n\t * Properties of a telemetry event. They are string-indexed, and their values restricted to a known set of\n\t * types (optionally \"wrapped\" with {@link Tagged}).\n\t */\n\t[index: string]: TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType>;\n}\n\n/**\n * Base interface for logging telemetry statements.\n * Can contain any number of properties that get serialized as json payload.\n * @param category - category of the event, like \"error\", \"performance\", \"generic\", etc.\n * @param eventName - name of the event.\n * @public\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n *\n * @privateRemarks This interface exists solely for documentation. API Extractor does not\n * propagate TSDoc comments from a const's inline type to API reports, so we define the shape\n * here and use LogLevelConst on the LogLevel const to surface member docs.\n *\n * @public\n */\nexport interface LogLevelConst {\n\t/**\n\t * Chatty logs useful for debugging.\n\t * @remarks They need not be collected in production.\n\t */\n\treadonly verbose: 10;\n\n\t/**\n\t * Information about the session.\n\t * @remarks These logs could be omitted in some sessions if needed (e.g. to reduce overall telemetry volume).\n\t * If any are collected from a particular session, all should be.\n\t */\n\treadonly info: 20;\n\n\t/**\n\t * Essential information about the operation of Fluid.\n\t * @remarks It is recommended that these should always be collected, even in production, for diagnostic purposes.\n\t */\n\treadonly essential: 30;\n\n\t/**\n\t * Default LogLevel\n\t * @remarks Prefer {@link LogLevelConst.info | LogLevel.info} when selecting a level explicitly since this will be deprecated and removed in a future release.\n\t */\n\treadonly default: 20;\n\n\t/**\n\t * To log errors.\n\t * @remarks Prefer {@link LogLevelConst.essential | LogLevel.essential} when selecting a level since this will be deprecated and removed in a future release.\n\t */\n\treadonly error: 30;\n}\n\n/**\n * Provides runtime {@link (LogLevel:type)} values via symbolic names\n * @see {@link LogLevelConst} type.\n * @public\n */\nexport const LogLevel: LogLevelConst = {\n\tverbose: 10,\n\tinfo: 20,\n\tessential: 30,\n\tdefault: 20,\n\terror: 30,\n};\n\n/**\n * Specify a level to the log to filter out logs based on the level.\n * @public\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n * @public\n */\nexport interface ITelemetryBaseLogger {\n\t/**\n\t * Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).\n\t * @param event - The event to log.\n\t * @param logLevel - The log level of the event. Default: {@link LogLevelConst.default | LogLevel.default}.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Minimum log level to be logged.\n\t * @defaultValue {@link LogLevelConst.default | LogLevel.default}.\n\t */\n\tminLogLevel?: LogLevel;\n}\n\n/**\n * Error telemetry event.\n * Maps to category = \"error\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n * @public\n */\nexport interface ITelemetryErrorEvent extends ITelemetryBaseProperties {\n\teventName: string;\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n * @legacy @beta\n */\nexport interface ILoggingError extends Error {\n\t/**\n\t * Return all properties from this object that should be logged to telemetry\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n}\n"]}
@@ -17,7 +17,7 @@ import { BrandedType } from "./brandedType.js";
17
17
  * be read.
18
18
  *
19
19
  * @sealed
20
- * @beta
20
+ * @public
21
21
  */
22
22
  export declare class OpaqueJsonDeserialized<T, in out Option_AllowExactly extends unknown[] = [], out Option_AllowExtensionOf = never> extends BrandedType<"JsonDeserialized"> {
23
23
  protected readonly JsonDeserialized: {
@@ -44,7 +44,7 @@ export declare class OpaqueJsonDeserialized<T, in out Option_AllowExactly extend
44
44
  * when "instance" will be forwarded along.
45
45
  *
46
46
  * @sealed
47
- * @beta
47
+ * @public
48
48
  */
49
49
  export declare class OpaqueJsonSerializable<T, in out Option_AllowExactly extends unknown[] = [], out Option_AllowExtensionOf = never> extends BrandedType<"JsonSerializable"> {
50
50
  protected readonly JsonSerializable: {
@@ -1 +1 @@
1
- {"version":3,"file":"opaqueJson.js","sourceRoot":"","sources":["../src/opaqueJson.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BrandedType } from \"./brandedType.js\";\n\n/**\n * Placeholder for value that is known to be JSON because it has been\n * deserialized (`T` filtered through {@link JsonDeserialized} as out value).\n *\n * @remarks\n * Usage:\n *\n * - Cast to with `as unknown as OpaqueJsonDeserialized<T>` when value `T`\n * has been filtered through {@link JsonDeserialized}.\n *\n * - Cast from with `as unknown as JsonDeserialized<T>` when \"instance\" will\n * be read.\n *\n * @sealed\n * @beta\n */\nexport declare class OpaqueJsonDeserialized<\n\tT,\n\t// These options are split from typical `JsonDeserializedOptions` as this type\n\t// requires correct variance per the two options and AllowExactly has special\n\t// variance and must be treated as invariant. In actuality, each member of the\n\t// AllowExactly tuple is invariant, but tuple as a set is covariant. This is not\n\t// expressible in TypeScript.\n\tin out Option_AllowExactly extends unknown[] = [],\n\tout Option_AllowExtensionOf = never,\n> extends BrandedType<\"JsonDeserialized\"> {\n\tprotected readonly JsonDeserialized: {\n\t\tType: T;\n\t\tOptions: {\n\t\t\tAllowExactly: Option_AllowExactly;\n\t\t\tAllowExtensionOf: Option_AllowExtensionOf;\n\t\t};\n\t};\n\t// Option_AllowExactly is covariant from above. This removes covariance, leaving only invariance.\n\tprotected readonly Option_AllowExactly_Invariance: (\n\t\tOption_AllowExactly: Option_AllowExactly,\n\t) => void;\n\tprivate constructor();\n}\n\n/**\n * Placeholder for value that is known to be JSON because it will have been\n * serialized checked (`T` filtered through {@link JsonSerializable} before \"created\").\n *\n * @remarks\n * Usage:\n *\n * - Cast to with `as unknown as OpaqueJsonSerializable<T>` when value `T`\n * has been filtered through {@link JsonSerializable}.\n *\n * - Cast from with `as unknown as JsonSerializable<T>` or `as unknown as T`\n * when \"instance\" will be forwarded along.\n *\n * @sealed\n * @beta\n */\nexport declare class OpaqueJsonSerializable<\n\tT,\n\t// These options are split from typical `JsonSerializableOptions` as this type\n\t// requires correct variance per the two options and AllowExactly has special\n\t// variance and must be treated as invariant. In actuality, each member of the\n\t// AllowExactly tuple is invariant, but tuple as a set is covariant. This is not\n\t// expressible in TypeScript.\n\tin out Option_AllowExactly extends unknown[] = [],\n\tout Option_AllowExtensionOf = never,\n\t// JsonSerializableOptions.IgnoreInaccessibleMembers is ignored\n> extends BrandedType<\"JsonSerializable\"> {\n\tprotected readonly JsonSerializable: {\n\t\tType: T;\n\t\tOptions: {\n\t\t\tAllowExactly: Option_AllowExactly;\n\t\t\tAllowExtensionOf: Option_AllowExtensionOf;\n\t\t};\n\t};\n\t// Option_AllowExactly is covariant from above. This removes covariance, leaving only invariance.\n\tprotected readonly Option_AllowExactly_Invariance: (\n\t\tOption_AllowExactly: Option_AllowExactly,\n\t) => void;\n\tprivate constructor();\n}\n"]}
1
+ {"version":3,"file":"opaqueJson.js","sourceRoot":"","sources":["../src/opaqueJson.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BrandedType } from \"./brandedType.js\";\n\n/**\n * Placeholder for value that is known to be JSON because it has been\n * deserialized (`T` filtered through {@link JsonDeserialized} as out value).\n *\n * @remarks\n * Usage:\n *\n * - Cast to with `as unknown as OpaqueJsonDeserialized<T>` when value `T`\n * has been filtered through {@link JsonDeserialized}.\n *\n * - Cast from with `as unknown as JsonDeserialized<T>` when \"instance\" will\n * be read.\n *\n * @sealed\n * @public\n */\nexport declare class OpaqueJsonDeserialized<\n\tT,\n\t// These options are split from typical `JsonDeserializedOptions` as this type\n\t// requires correct variance per the two options and AllowExactly has special\n\t// variance and must be treated as invariant. In actuality, each member of the\n\t// AllowExactly tuple is invariant, but tuple as a set is covariant. This is not\n\t// expressible in TypeScript.\n\tin out Option_AllowExactly extends unknown[] = [],\n\tout Option_AllowExtensionOf = never,\n> extends BrandedType<\"JsonDeserialized\"> {\n\tprotected readonly JsonDeserialized: {\n\t\tType: T;\n\t\tOptions: {\n\t\t\tAllowExactly: Option_AllowExactly;\n\t\t\tAllowExtensionOf: Option_AllowExtensionOf;\n\t\t};\n\t};\n\t// Option_AllowExactly is covariant from above. This removes covariance, leaving only invariance.\n\tprotected readonly Option_AllowExactly_Invariance: (\n\t\tOption_AllowExactly: Option_AllowExactly,\n\t) => void;\n\tprivate constructor();\n}\n\n/**\n * Placeholder for value that is known to be JSON because it will have been\n * serialized checked (`T` filtered through {@link JsonSerializable} before \"created\").\n *\n * @remarks\n * Usage:\n *\n * - Cast to with `as unknown as OpaqueJsonSerializable<T>` when value `T`\n * has been filtered through {@link JsonSerializable}.\n *\n * - Cast from with `as unknown as JsonSerializable<T>` or `as unknown as T`\n * when \"instance\" will be forwarded along.\n *\n * @sealed\n * @public\n */\nexport declare class OpaqueJsonSerializable<\n\tT,\n\t// These options are split from typical `JsonSerializableOptions` as this type\n\t// requires correct variance per the two options and AllowExactly has special\n\t// variance and must be treated as invariant. In actuality, each member of the\n\t// AllowExactly tuple is invariant, but tuple as a set is covariant. This is not\n\t// expressible in TypeScript.\n\tin out Option_AllowExactly extends unknown[] = [],\n\tout Option_AllowExtensionOf = never,\n\t// JsonSerializableOptions.IgnoreInaccessibleMembers is ignored\n> extends BrandedType<\"JsonSerializable\"> {\n\tprotected readonly JsonSerializable: {\n\t\tType: T;\n\t\tOptions: {\n\t\t\tAllowExactly: Option_AllowExactly;\n\t\t\tAllowExtensionOf: Option_AllowExtensionOf;\n\t\t};\n\t};\n\t// Option_AllowExactly is covariant from above. This removes covariance, leaving only invariance.\n\tprotected readonly Option_AllowExactly_Invariance: (\n\t\tOption_AllowExactly: Option_AllowExactly,\n\t) => void;\n\tprivate constructor();\n}\n"]}
package/lib/public.d.ts CHANGED
@@ -10,6 +10,7 @@
10
10
 
11
11
  export {
12
12
  // #region @public APIs
13
+ BrandedType,
13
14
  ConfigTypes,
14
15
  ErasedType,
15
16
  ExtendEventProvider,
@@ -38,6 +39,7 @@ export {
38
39
  Listenable,
39
40
  Listeners,
40
41
  LogLevel,
42
+ LogLevelConst,
41
43
  Off,
42
44
  ReplaceIEventThisPlaceHolder,
43
45
  Tagged,
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.52.11"
8
+ "packageVersion": "7.58.1"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/core-interfaces",
3
- "version": "2.92.0",
3
+ "version": "2.100.0",
4
4
  "description": "Fluid object interfaces",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -83,14 +83,14 @@
83
83
  "devDependencies": {
84
84
  "@arethetypeswrong/cli": "^0.18.2",
85
85
  "@biomejs/biome": "~2.4.5",
86
- "@fluid-tools/build-cli": "^0.64.0",
86
+ "@fluid-tools/build-cli": "^0.65.0",
87
87
  "@fluidframework/build-common": "^2.0.3",
88
- "@fluidframework/build-tools": "^0.64.0",
89
- "@fluidframework/core-interfaces-previous": "npm:@fluidframework/core-interfaces@2.91.0",
88
+ "@fluidframework/build-tools": "^0.65.0",
89
+ "@fluidframework/core-interfaces-previous": "npm:@fluidframework/core-interfaces@2.92.0",
90
90
  "@fluidframework/eslint-config-fluid": "^9.0.0",
91
- "@microsoft/api-extractor": "7.52.11",
91
+ "@microsoft/api-extractor": "7.58.1",
92
92
  "@types/mocha": "^10.0.10",
93
- "@types/node": "~20.19.30",
93
+ "@types/node": "~22.19.17",
94
94
  "c8": "^10.1.3",
95
95
  "concurrently": "^9.2.1",
96
96
  "copyfiles": "^2.4.1",
@@ -161,7 +161,6 @@
161
161
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
162
162
  "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && npm run place:cjs:package-stub",
163
163
  "tsc:watch": "npm run place:cjs:package-stub && fluid-tsc commonjs --project ./tsconfig.cjs.json --watch",
164
- "typetests:gen": "flub generate typetests --dir . -v",
165
- "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
164
+ "typetests:gen": "flub generate typetests --dir . -v"
166
165
  }
167
166
  }
@@ -36,6 +36,19 @@
36
36
  *
37
37
  * This class should never exist at runtime, so it is only declared.
38
38
  *
39
+ * As this is a class and not just an interface, to match derived types, the
40
+ * declarations for any two derivatives must come from the same source - the
41
+ * same package version. If a type must cross package boundaries, as may be the
42
+ * case for cross layer types, the derived type should pick a specific version
43
+ * of core-interfaces to import BrandedType from. Exact versions are best, but
44
+ * as security best practice, use ~ specification. Consumers are expected to
45
+ * use a package manager that will produce consistency over minor patches.
46
+ * A change in version should be considered a breaking change.
47
+ *
48
+ * In the preferred derived class pattern, the derived class is subject to the
49
+ * same identity rules and might benefit from being in a type-only `-definitions`
50
+ * package. See {@link ErasedType} example comments for version stable patterns.
51
+ *
39
52
  * @example
40
53
  * Definition of two branded types with different variance:
41
54
  * ```typescript
@@ -69,7 +82,7 @@
69
82
  * }
70
83
  * ```
71
84
  *
72
- * @beta
85
+ * @public
73
86
  */
74
87
  export declare class BrandedType<out Brand> {
75
88
  /**
@@ -16,7 +16,7 @@ import type {
16
16
  * @privateRemarks
17
17
  * WeakRef should be added when lib is updated to ES2021 or later.
18
18
  *
19
- * @beta
19
+ * @public
20
20
  * @system
21
21
  */
22
22
  export type DeepReadonlySupportedGenericsDefault =
@@ -29,7 +29,7 @@ export type DeepReadonlySupportedGenericsDefault =
29
29
  /**
30
30
  * Options for {@link DeepReadonly}.
31
31
  *
32
- * @beta
32
+ * @public
33
33
  */
34
34
  export interface DeepReadonlyOptions {
35
35
  /**
@@ -58,7 +58,7 @@ export interface DeepReadonlyOptions {
58
58
  * {@link DeepReadonlySupportedGenericsDefault} for generics that have
59
59
  * immutability applied to generic type by default.
60
60
  *
61
- * @beta
61
+ * @public
62
62
  */
63
63
  export type DeepReadonly<
64
64
  T,