@fluidframework/core-interfaces 2.90.0-378676 → 2.90.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.
- package/CHANGELOG.md +4 -0
- package/api-extractor/api-extractor-lint-internal-exposedUtilityTypes.esm.json +14 -0
- package/api-report/core-interfaces.legacy.alpha.api.md +7 -0
- package/api-report/core-interfaces.legacy.beta.api.md +7 -0
- package/dist/api-extractor/exposedUtilityTypes.d.ts +7 -0
- package/dist/api-extractor/exposedUtilityTypes.d.ts.map +1 -0
- package/dist/api-extractor/exposedUtilityTypes.js +7 -0
- package/dist/api-extractor/exposedUtilityTypes.js.map +1 -0
- package/dist/brandedType.d.ts +1 -1
- package/dist/brandedType.js.map +1 -1
- package/dist/deepReadonly.d.ts +1 -0
- package/dist/deepReadonly.d.ts.map +1 -1
- package/dist/deepReadonly.js.map +1 -1
- package/dist/exposedInternalUtilityTypes.d.ts +5 -5
- package/dist/exposedInternalUtilityTypes.js.map +1 -1
- package/dist/exposedUtilityTypes.d.ts +3 -3
- package/dist/exposedUtilityTypes.d.ts.map +1 -1
- package/dist/exposedUtilityTypes.js.map +1 -1
- package/dist/handles.js.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/jsonString.d.ts.map +1 -1
- package/dist/jsonString.js.map +1 -1
- package/dist/legacy.alpha.d.ts +1 -0
- package/dist/legacy.d.ts +1 -0
- package/dist/shallowReadonly.d.ts +1 -0
- package/dist/shallowReadonly.d.ts.map +1 -1
- package/dist/shallowReadonly.js.map +1 -1
- package/lib/api-extractor/exposedUtilityTypes.d.ts +7 -0
- package/lib/api-extractor/exposedUtilityTypes.d.ts.map +1 -0
- package/lib/api-extractor/exposedUtilityTypes.js +6 -0
- package/lib/api-extractor/exposedUtilityTypes.js.map +1 -0
- package/lib/brandedType.d.ts +1 -1
- package/lib/brandedType.js.map +1 -1
- package/lib/deepReadonly.d.ts +1 -0
- package/lib/deepReadonly.d.ts.map +1 -1
- package/lib/deepReadonly.js.map +1 -1
- package/lib/exposedInternalUtilityTypes.d.ts +5 -5
- package/lib/exposedInternalUtilityTypes.js.map +1 -1
- package/lib/exposedUtilityTypes.d.ts +3 -3
- package/lib/exposedUtilityTypes.d.ts.map +1 -1
- package/lib/exposedUtilityTypes.js.map +1 -1
- package/lib/handles.js.map +1 -1
- package/lib/internal.d.ts +1 -1
- package/lib/internal.d.ts.map +1 -1
- package/lib/internal.js.map +1 -1
- package/lib/jsonString.d.ts.map +1 -1
- package/lib/jsonString.js.map +1 -1
- package/lib/legacy.alpha.d.ts +1 -0
- package/lib/legacy.d.ts +1 -0
- package/lib/shallowReadonly.d.ts +1 -0
- package/lib/shallowReadonly.d.ts.map +1 -1
- package/lib/shallowReadonly.js.map +1 -1
- package/package.json +6 -6
- package/src/api-extractor/exposedUtilityTypes.ts +18 -0
- package/src/brandedType.ts +1 -1
- package/src/deepReadonly.ts +1 -0
- package/src/exposedInternalUtilityTypes.ts +5 -5
- package/src/exposedUtilityTypes.ts +14 -4
- package/src/handles.ts +1 -1
- package/src/internal.ts +1 -1
- package/src/jsonString.ts +0 -1
- package/src/shallowReadonly.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exposedUtilityTypes.js","sourceRoot":"","sources":["../src/exposedUtilityTypes.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// Usage: Access these types via /internal/exposedUtilityTypes import spec when\n// system level but externally exposed version of utilities are needed.\n// Import via /internal when use is not exposed externally.\n// Should a customer need access to these types, export should be relocated to\n// index.ts and
|
|
1
|
+
{"version":3,"file":"exposedUtilityTypes.js","sourceRoot":"","sources":["../src/exposedUtilityTypes.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// Usage: Access these types via /internal/exposedUtilityTypes import spec when\n// system level but externally exposed version of utilities are needed.\n// Import via /internal when use is not exposed externally.\n// Should a customer need access to these types, export should be relocated to\n// index.ts and the re-tagged export from internal.ts may be removed.\n\nexport type {\n\tDeepReadonly,\n\tDeepReadonlyOptions,\n\tDeepReadonlySupportedGenericsDefault,\n} from \"./deepReadonly.js\";\nexport type { JsonDeserialized, JsonDeserializedOptions } from \"./jsonDeserialized.js\";\nexport type { JsonSerializable, JsonSerializableOptions } from \"./jsonSerializable.js\";\nexport type {\n\tSerializationErrorPerNonPublicProperties,\n\tSerializationErrorPerUndefinedArrayElement,\n} from \"./jsonSerializationErrors.js\";\nexport type {\n\tJsonTypeWith,\n\tNonNullJsonObjectWith,\n\tReadonlyJsonTypeWith,\n} from \"./jsonType.js\";\nexport type { OpaqueJsonDeserialized, OpaqueJsonSerializable } from \"./opaqueJson.js\";\nexport type {\n\tShallowReadonly,\n\tShallowReadonlyOptions,\n\tShallowReadonlySupportedGenericsDefault,\n} from \"./shallowReadonly.js\";\n\nexport type {\n\tDeepReadonlyRecursionLimit,\n\t// External name is qualified to avoid confusion with similarly named types in other packages.\n\tInternalUtilityTypes as InternalCoreInterfacesUtilityTypes,\n\tReadonlySupportedGenerics,\n} from \"./exposedInternalUtilityTypes.js\";\n"]}
|
package/dist/handles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH;;GAEG;AACU,QAAA,mBAAmB,GAAqC,qBAAqB,CAAC;AAsC3F;;;;;GAKG;AACU,QAAA,YAAY,GAAG,cAAc,CAAC;AAuH3C;;;;;;;;;;;;;GAaG;AACU,QAAA,iBAAiB,GAAkB,MAAM,CAAC,GAAG,CACzD,kDAAkD,CAClD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"./erasedType.js\";\nimport type { IRequest, IResponse } from \"./fluidRouter.js\";\nimport type { Listenable } from \"./internal.js\";\n\n/**\n * @legacy @beta\n */\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\n/**\n * @legacy @beta\n */\nexport interface IProvideFluidHandleContext {\n\treadonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * Describes a routing context from which other `IFluidHandleContext`s are defined.\n * @legacy @beta\n */\nexport interface IFluidHandleContext extends IProvideFluidHandleContext {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * The parent IFluidHandleContext that has provided a route path to this IFluidHandleContext or undefined\n\t * at the root.\n\t */\n\treadonly routeContext?: IFluidHandleContext;\n\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\tresolveHandle(request: IRequest): Promise<IResponse>;\n}\n\n/**\n * @public\n * @privateRemarks\n * This really should be deprecated and alpha, but since its a merged export with the public interface,\n * it can't have its own docs or different tags.\n */\nexport const IFluidHandle = \"IFluidHandle\";\n\n/**\n * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n * @legacy @beta\n */\nexport interface IProvideFluidHandle {\n\t/**\n\t * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n\t * @privateRemarks\n\t * This field must be kept so that code from before 2.0.0-rc.4.0.0 (When fluidHandleSymbol was added) still detects handles.\n\t * This is required due to some use-cases mixing package versions.\n\t * More details in packages/runtime/runtime-utils/src/handles.ts and on {@link fluidHandleSymbol}.\n\t */\n\treadonly [IFluidHandle]: IFluidHandleInternal;\n}\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @legacy @beta\n */\nexport interface IFluidHandleInternal<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandle<T>,\n\t\tIProvideFluidHandle {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n}\n\n/**\n * @privateRemarks\n * To be merged onto IFluidHandleInternal in accordance with breaking change policy\n * @internal\n */\nexport interface IFluidHandleInternalPayloadPending<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandleInternal<T> {\n\t/**\n\t * Whether the handle has a pending payload, meaning that it may exist before its payload is retrievable.\n\t * For instance, the BlobManager can generate handles before completing the blob upload/attach.\n\t */\n\treadonly payloadPending: boolean;\n}\n\n/**\n * The state of the handle's payload.\n * - \"pending\" - The payload is not shared to all collaborators\n * - \"shared\" - The payload is available to both the local client and remote collaborators\n *\n * @remarks\n * Clients will see a transition of \"pending\" to \"shared\" when the payload has been shared to all collaborators.\n * @legacy @beta\n */\nexport type PayloadState = \"pending\" | \"shared\";\n\n/**\n * Events which fire from an IFluidHandle.\n * @legacy @beta\n */\nexport interface IFluidHandleEvents {\n\t/**\n\t * Emitted when the payload becomes available to remote collaborators.\n\t */\n\tpayloadShared: () => void;\n}\n\n/**\n * Observable state on the handle regarding its payload sharing state.\n *\n * @privateRemarks\n * Contents to be merged to IFluidHandle, and then this separate interface should be removed.\n * @legacy @beta\n */\nexport interface IFluidHandlePayloadPending<T> extends IFluidHandle<T> {\n\t/**\n\t * The current state of the handle's payload.\n\t */\n\treadonly payloadState: PayloadState;\n\t/**\n\t * Event emitter, with events that emit as the payload state transitions.\n\t */\n\treadonly events: Listenable<IFluidHandleEvents>;\n}\n\n/**\n * Additional events which fire as a local handle's payload state transitions.\n * @legacy @beta\n */\nexport interface ILocalFluidHandleEvents extends IFluidHandleEvents {\n\t/**\n\t * Emitted for locally created handles when the payload fails sharing to remote collaborators.\n\t */\n\tpayloadShareFailed: (error: unknown) => void;\n}\n\n/**\n * Additional observable state on a local handle regarding its payload sharing state.\n * @legacy @beta\n */\nexport interface ILocalFluidHandle<T> extends IFluidHandlePayloadPending<T> {\n\t/**\n\t * The error encountered by the handle while sharing the payload, if one has occurred. Undefined if no error has occurred.\n\t */\n\treadonly payloadShareError: unknown;\n\t/**\n\t * Event emitter, with events that emit as the payload state transitions.\n\t */\n\treadonly events: Listenable<IFluidHandleEvents & ILocalFluidHandleEvents>;\n}\n\n/**\n * Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.\n *\n * @remarks\n * To narrow arbitrary objects to handles do not simply check for this symbol:\n * instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility\n * with older implementations of handles that may exist due to dynamic code loading of older packages.\n *\n * @privateRemarks\n * Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.\n * In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.\n * Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:\n * @public\n */\nexport const fluidHandleSymbol: unique symbol = Symbol.for(\n\t\"FluidHandle-3978c7cf-4675-49ba-a20c-bf35efbf43da\",\n);\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @sealed @public\n */\nexport interface IFluidHandle<out T = unknown> {\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Returns a promise to the Fluid Object referenced by the handle.\n\t */\n\tget(): Promise<T>;\n\n\t/**\n\t * Symbol used to mark an object as a {@link (IFluidHandle:interface)}\n\t * and to recover the underlying handle implementation.\n\t *\n\t * @privateRemarks\n\t * Used to recover {@link IFluidHandleInternal}, see {@link toFluidHandleInternal}.\n\t */\n\treadonly [fluidHandleSymbol]: IFluidHandleErased<T>;\n}\n\n/**\n * A type erased Fluid Handle.\n * These can only be produced by the Fluid Framework and provide the implementation details needed to power {@link (IFluidHandle:interface)}.\n * @privateRemarks\n * Created from {@link IFluidHandleInternal} using {@link toFluidHandleErased}.\n * @sealed @public\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1
|
+
{"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH;;GAEG;AACU,QAAA,mBAAmB,GAAqC,qBAAqB,CAAC;AAsC3F;;;;;GAKG;AACU,QAAA,YAAY,GAAG,cAAc,CAAC;AAuH3C;;;;;;;;;;;;;GAaG;AACU,QAAA,iBAAiB,GAAkB,MAAM,CAAC,GAAG,CACzD,kDAAkD,CAClD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"./erasedType.js\";\nimport type { IRequest, IResponse } from \"./fluidRouter.js\";\nimport type { Listenable } from \"./internal.js\";\n\n/**\n * @legacy @beta\n */\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\n/**\n * @legacy @beta\n */\nexport interface IProvideFluidHandleContext {\n\treadonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * Describes a routing context from which other `IFluidHandleContext`s are defined.\n * @legacy @beta\n */\nexport interface IFluidHandleContext extends IProvideFluidHandleContext {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * The parent IFluidHandleContext that has provided a route path to this IFluidHandleContext or undefined\n\t * at the root.\n\t */\n\treadonly routeContext?: IFluidHandleContext;\n\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\tresolveHandle(request: IRequest): Promise<IResponse>;\n}\n\n/**\n * @public\n * @privateRemarks\n * This really should be deprecated and alpha, but since its a merged export with the public interface,\n * it can't have its own docs or different tags.\n */\nexport const IFluidHandle = \"IFluidHandle\";\n\n/**\n * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n * @legacy @beta\n */\nexport interface IProvideFluidHandle {\n\t/**\n\t * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n\t * @privateRemarks\n\t * This field must be kept so that code from before 2.0.0-rc.4.0.0 (When fluidHandleSymbol was added) still detects handles.\n\t * This is required due to some use-cases mixing package versions.\n\t * More details in packages/runtime/runtime-utils/src/handles.ts and on {@link fluidHandleSymbol}.\n\t */\n\treadonly [IFluidHandle]: IFluidHandleInternal;\n}\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @legacy @beta\n */\nexport interface IFluidHandleInternal<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandle<T>,\n\t\tIProvideFluidHandle {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n}\n\n/**\n * @privateRemarks\n * To be merged onto IFluidHandleInternal in accordance with breaking change policy\n * @internal\n */\nexport interface IFluidHandleInternalPayloadPending<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandleInternal<T> {\n\t/**\n\t * Whether the handle has a pending payload, meaning that it may exist before its payload is retrievable.\n\t * For instance, the BlobManager can generate handles before completing the blob upload/attach.\n\t */\n\treadonly payloadPending: boolean;\n}\n\n/**\n * The state of the handle's payload.\n * - \"pending\" - The payload is not shared to all collaborators\n * - \"shared\" - The payload is available to both the local client and remote collaborators\n *\n * @remarks\n * Clients will see a transition of \"pending\" to \"shared\" when the payload has been shared to all collaborators.\n * @legacy @beta\n */\nexport type PayloadState = \"pending\" | \"shared\";\n\n/**\n * Events which fire from an IFluidHandle.\n * @legacy @beta\n */\nexport interface IFluidHandleEvents {\n\t/**\n\t * Emitted when the payload becomes available to remote collaborators.\n\t */\n\tpayloadShared: () => void;\n}\n\n/**\n * Observable state on the handle regarding its payload sharing state.\n *\n * @privateRemarks\n * Contents to be merged to IFluidHandle, and then this separate interface should be removed.\n * @legacy @beta\n */\nexport interface IFluidHandlePayloadPending<T> extends IFluidHandle<T> {\n\t/**\n\t * The current state of the handle's payload.\n\t */\n\treadonly payloadState: PayloadState;\n\t/**\n\t * Event emitter, with events that emit as the payload state transitions.\n\t */\n\treadonly events: Listenable<IFluidHandleEvents>;\n}\n\n/**\n * Additional events which fire as a local handle's payload state transitions.\n * @legacy @beta\n */\nexport interface ILocalFluidHandleEvents extends IFluidHandleEvents {\n\t/**\n\t * Emitted for locally created handles when the payload fails sharing to remote collaborators.\n\t */\n\tpayloadShareFailed: (error: unknown) => void;\n}\n\n/**\n * Additional observable state on a local handle regarding its payload sharing state.\n * @legacy @beta\n */\nexport interface ILocalFluidHandle<T> extends IFluidHandlePayloadPending<T> {\n\t/**\n\t * The error encountered by the handle while sharing the payload, if one has occurred. Undefined if no error has occurred.\n\t */\n\treadonly payloadShareError: unknown;\n\t/**\n\t * Event emitter, with events that emit as the payload state transitions.\n\t */\n\treadonly events: Listenable<IFluidHandleEvents & ILocalFluidHandleEvents>;\n}\n\n/**\n * Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.\n *\n * @remarks\n * To narrow arbitrary objects to handles do not simply check for this symbol:\n * instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility\n * with older implementations of handles that may exist due to dynamic code loading of older packages.\n *\n * @privateRemarks\n * Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.\n * In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.\n * Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:\n * @public\n */\nexport const fluidHandleSymbol: unique symbol = Symbol.for(\n\t\"FluidHandle-3978c7cf-4675-49ba-a20c-bf35efbf43da\",\n);\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @sealed @public\n */\nexport interface IFluidHandle<out T = unknown> {\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Returns a promise to the Fluid Object referenced by the handle.\n\t */\n\tget(): Promise<T>;\n\n\t/**\n\t * Symbol used to mark an object as a {@link (IFluidHandle:interface)}\n\t * and to recover the underlying handle implementation.\n\t *\n\t * @privateRemarks\n\t * Used to recover {@link IFluidHandleInternal}, see {@link toFluidHandleInternal}.\n\t */\n\treadonly [fluidHandleSymbol]: IFluidHandleErased<T>;\n}\n\n/**\n * A type erased Fluid Handle.\n * These can only be produced by the Fluid Framework and provide the implementation details needed to power {@link (IFluidHandle:interface)}.\n * @privateRemarks\n * Created from {@link IFluidHandleInternal} using {@link toFluidHandleErased}.\n * @sealed @public\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface IFluidHandleErased<T> extends ErasedType<readonly [\"IFluidHandle\", T]> {}\n"]}
|
package/dist/internal.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export type OpaqueJsonSerializable<T, Option_AllowExactly extends unknown[] = []
|
|
|
49
49
|
/**
|
|
50
50
|
* @internal
|
|
51
51
|
*/
|
|
52
|
-
export declare namespace
|
|
52
|
+
export declare namespace InternalCoreInterfacesUtilityTypes {
|
|
53
53
|
type FlattenIntersection<T extends ExposedInternalUtilityTypes.AnyRecord> = ExposedInternalUtilityTypes.FlattenIntersection<T>;
|
|
54
54
|
type IfSameType<X, Y, IfSame = unknown, IfDifferent = never> = ExposedInternalUtilityTypes.IfSameType<X, Y, IfSame, IfDifferent>;
|
|
55
55
|
}
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,cAAc,YAAY,CAAC;AAE3B,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE3D,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAMjF,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,oBAAoB,IAAI,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC5G,OAAO,KAAK,EACX,gBAAgB,IAAI,uBAAuB,EAC3C,uBAAuB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACX,gBAAgB,IAAI,uBAAuB,EAC3C,uBAAuB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACX,YAAY,IAAI,mBAAmB,EACnC,6BAA6B,IAAI,oCAAoC,EACrE,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACX,sBAAsB,IAAI,6BAA6B,EACvD,sBAAsB,IAAI,6BAA6B,EACvD,MAAM,iBAAiB,CAAC;AAOzB;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAC3B,CAAC,EACD,OAAO,SAAS,uBAAuB,GAAG;IACzC,YAAY,EAAE,EAAE,CAAC;IACjB,gBAAgB,EAAE,KAAK,CAAC;CACxB,IACE,uBAAuB,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAC3B,CAAC,EACD,OAAO,SAAS,uBAAuB,GAAG;IACzC,YAAY,EAAE,EAAE,CAAC;IACjB,gBAAgB,EAAE,KAAK,CAAC;CACxB,IACE,uBAAuB,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,6BAA6B,CAAC,CAAC,IAAI,oCAAoC,CAAC,CAAC,CAAC,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,sBAAsB,CACjC,CAAC,EACD,mBAAmB,SAAS,OAAO,EAAE,GAAG,EAAE,EAC1C,uBAAuB,GAAG,KAAK,IAC5B,6BAA6B,CAAC,CAAC,EAAE,mBAAmB,EAAE,uBAAuB,CAAC,CAAC;AAEnF;;GAEG;AACH,MAAM,MAAM,sBAAsB,CACjC,CAAC,EACD,mBAAmB,SAAS,OAAO,EAAE,GAAG,EAAE,EAC1C,uBAAuB,GAAG,KAAK,IAC5B,6BAA6B,CAAC,CAAC,EAAE,mBAAmB,EAAE,uBAAuB,CAAC,CAAC;AAEnF;;GAEG;AAEH,yBAAiB,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,cAAc,YAAY,CAAC;AAE3B,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE3D,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAMjF,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,oBAAoB,IAAI,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC5G,OAAO,KAAK,EACX,gBAAgB,IAAI,uBAAuB,EAC3C,uBAAuB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACX,gBAAgB,IAAI,uBAAuB,EAC3C,uBAAuB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACX,YAAY,IAAI,mBAAmB,EACnC,6BAA6B,IAAI,oCAAoC,EACrE,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACX,sBAAsB,IAAI,6BAA6B,EACvD,sBAAsB,IAAI,6BAA6B,EACvD,MAAM,iBAAiB,CAAC;AAOzB;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAC3B,CAAC,EACD,OAAO,SAAS,uBAAuB,GAAG;IACzC,YAAY,EAAE,EAAE,CAAC;IACjB,gBAAgB,EAAE,KAAK,CAAC;CACxB,IACE,uBAAuB,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAC3B,CAAC,EACD,OAAO,SAAS,uBAAuB,GAAG;IACzC,YAAY,EAAE,EAAE,CAAC;IACjB,gBAAgB,EAAE,KAAK,CAAC;CACxB,IACE,uBAAuB,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,6BAA6B,CAAC,CAAC,IAAI,oCAAoC,CAAC,CAAC,CAAC,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,sBAAsB,CACjC,CAAC,EACD,mBAAmB,SAAS,OAAO,EAAE,GAAG,EAAE,EAC1C,uBAAuB,GAAG,KAAK,IAC5B,6BAA6B,CAAC,CAAC,EAAE,mBAAmB,EAAE,uBAAuB,CAAC,CAAC;AAEnF;;GAEG;AACH,MAAM,MAAM,sBAAsB,CACjC,CAAC,EACD,mBAAmB,SAAS,OAAO,EAAE,GAAG,EAAE,EAC1C,uBAAuB,GAAG,KAAK,IAC5B,6BAA6B,CAAC,CAAC,EAAE,mBAAmB,EAAE,uBAAuB,CAAC,CAAC;AAEnF;;GAEG;AAEH,yBAAiB,kCAAkC,CAAC;IAEnD,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"}
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAEH,8HAA8H;AAC9H,0FAA0F;AAC1F,6CAA2B;AAG3B,iDAA2D;AAAlD,8GAAA,aAAa,OAAA;AAAE,0GAAA,SAAS,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// The \"internal\" exports are a superset of the standard ones. So, we want to export everything from the standard barrel file.\n// eslint-disable-next-line no-restricted-syntax, @typescript-eslint/no-restricted-imports\nexport * from \"./index.js\";\n\nexport type { JsonString, JsonStringifyOptions } from \"./jsonString.js\";\nexport { JsonStringify, JsonParse } from \"./jsonString.js\";\n\nexport type { JsonTypeToOpaqueJson, OpaqueJsonToJsonType } from \"./jsonUtils.js\";\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\";\nimport type {\n\tOpaqueJsonDeserialized as ExposedOpaqueJsonDeserialized,\n\tOpaqueJsonSerializable as ExposedOpaqueJsonSerializable,\n} from \"./opaqueJson.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 */\nexport type OpaqueJsonDeserialized<\n\tT,\n\tOption_AllowExactly extends unknown[] = [],\n\tOption_AllowExtensionOf = never,\n> = ExposedOpaqueJsonDeserialized<T, Option_AllowExactly, Option_AllowExtensionOf>;\n\n/**\n * @internal\n */\nexport type OpaqueJsonSerializable<\n\tT,\n\tOption_AllowExactly extends unknown[] = [],\n\tOption_AllowExtensionOf = never,\n> = ExposedOpaqueJsonSerializable<T, Option_AllowExactly, Option_AllowExtensionOf>;\n\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAEH,8HAA8H;AAC9H,0FAA0F;AAC1F,6CAA2B;AAG3B,iDAA2D;AAAlD,8GAAA,aAAa,OAAA;AAAE,0GAAA,SAAS,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// The \"internal\" exports are a superset of the standard ones. So, we want to export everything from the standard barrel file.\n// eslint-disable-next-line no-restricted-syntax, @typescript-eslint/no-restricted-imports\nexport * from \"./index.js\";\n\nexport type { JsonString, JsonStringifyOptions } from \"./jsonString.js\";\nexport { JsonStringify, JsonParse } from \"./jsonString.js\";\n\nexport type { JsonTypeToOpaqueJson, OpaqueJsonToJsonType } from \"./jsonUtils.js\";\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\";\nimport type {\n\tOpaqueJsonDeserialized as ExposedOpaqueJsonDeserialized,\n\tOpaqueJsonSerializable as ExposedOpaqueJsonSerializable,\n} from \"./opaqueJson.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 */\nexport type OpaqueJsonDeserialized<\n\tT,\n\tOption_AllowExactly extends unknown[] = [],\n\tOption_AllowExtensionOf = never,\n> = ExposedOpaqueJsonDeserialized<T, Option_AllowExactly, Option_AllowExtensionOf>;\n\n/**\n * @internal\n */\nexport type OpaqueJsonSerializable<\n\tT,\n\tOption_AllowExactly extends unknown[] = [],\n\tOption_AllowExtensionOf = never,\n> = ExposedOpaqueJsonSerializable<T, Option_AllowExactly, Option_AllowExtensionOf>;\n\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InternalCoreInterfacesUtilityTypes {\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/dist/jsonString.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonString.d.ts","sourceRoot":"","sources":["../src/jsonString.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"jsonString.d.ts","sourceRoot":"","sources":["../src/jsonString.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEvF;;;;;;GAMG;AACH,OAAO,OAAO,eAAe,CAAC,CAAC,CAAE,SAAQ,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACjE,QAAQ,IAAI,MAAM;IACzB,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;IACnC,OAAO;CACP;AAED;;;;;;;;;GASG;AACH,KAAK,yBAAyB,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAEnF;;;;;;;;GAQG;AACH,KAAK,kBAAkB,CAAC,CAAC,IAAI,oBAAoB,CAAC,UAAU,CAC3D,yBAAyB,CAAC,CAAC,CAAC,SAAS,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,EACzE,CAAC,EACD,yBAAyB,CAAC,CAAC,CAAC,EAC5B,eAAe,CAAC,CAAC,CAAC,CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,MAAM,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAE3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,uBAAuB,EAAE,2BAA2B,CAAC,CAAC;AAE9F;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,0EAIlB,iBACN,CAAC,EAED,KAAK,OAAO,EAAE,QAAQ,MAAM,oBAAoB,EAAE,MAAM,OAAO,CAAC,CAAC,CACjE,KACG,WAAW,CAAC,CAAC,CAAC;AAEnB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,wCACf,CAAC,kEAC0D,CAAC"}
|
package/dist/jsonString.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonString.js","sourceRoot":"","sources":["../src/jsonString.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"jsonString.js","sourceRoot":"","sources":["../src/jsonString.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwFH;;;;;;;GAOG;AACU,QAAA,aAAa,GAAG,IAAI,CAAC,SAShB,CAAC;AAEnB;;;;;;;;;;;GAWG;AACU,QAAA,SAAS,GAAG,IAAI,CAAC,KAEoC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { BrandedType } from \"./brandedType.js\";\nimport type { InternalUtilityTypes } from \"./exposedInternalUtilityTypes.js\";\nimport type { JsonDeserialized } from \"./jsonDeserialized.js\";\nimport type { JsonSerializable, JsonSerializableOptions } from \"./jsonSerializable.js\";\n\n/**\n * Brand for JSON that has been stringified.\n *\n * Usage: Intersect with another type to apply branding.\n *\n * @sealed\n */\ndeclare class JsonStringBrand<T> extends BrandedType<JsonString<unknown>> {\n\tpublic toString(): string;\n\tprotected readonly EncodedValue: T;\n\tprivate constructor();\n}\n\n/**\n * Distributes `JsonStringBrand` over union elements of T.\n *\n * @remarks\n * This is useful to allow `JsonString<A | B>` to be assigned to `JsonString<A> | JsonString<B>`.\n *\n * The downside is that enums are expanded to union of members and thus cannot be\n * reconstituted exactly (even if IntelliSense shows the original enum type). This\n * can be removed if exact enum preservation is found to be more important.\n */\ntype DistributeJsonStringBrand<T> = T extends unknown ? JsonStringBrand<T> : never;\n\n/**\n * Distributes branding over union elements of T unless result could prevent T\n * from being reconstituted (as in the case of an enum type), in which case it\n * falls back to a single JsonStringBrand for the entire T.\n *\n * @remarks\n * Note that an enum unioned with anything else will be distributed. It seems\n * however that TypeScript can/will reconstitute the enum type in that case.\n */\ntype BrandForJsonString<T> = InternalUtilityTypes.IfSameType<\n\tDistributeJsonStringBrand<T> extends JsonStringBrand<infer U> ? U : never,\n\tT,\n\tDistributeJsonStringBrand<T>,\n\tJsonStringBrand<T>\n>;\n\n/**\n * Branded `string` for JSON that has been stringified.\n *\n * @remarks\n *\n * Use {@link JsonStringify} to encode JSON producing values of this type and\n * {@link JsonParse} to decode them.\n *\n * For custom encoding/decoding:\n *\n * - cast to with `as unknown as JsonString<T>` when value of type `T` has been stringified.\n *\n * - use a form of {@link JsonDeserialized} for safety when parsing.\n *\n * @sealed\n * @internal\n */\nexport type JsonString<T> = string & BrandForJsonString<T>;\n\n/**\n * Compile options for {@link JsonStringify}.\n *\n * @remarks\n * This only impacts type checking -- it has no impact on runtime.\n *\n * The options are currently a subset of {@link JsonSerializableOptions}, specifically\n * only `IgnoreInaccessibleMembers` is supported.\n *\n * No instance of this should ever exist at runtime.\n *\n * @privateRemarks\n * Consider adding `AllowUnknown` option to allow precisely `unknown` types to\n * be passed through. With `unknown` expected successful serialization could not\n * be checked at compile time. At deserialization time, `unknown` does not\n * guarantee any type and thus allowing does not erode type safety.\n *\n * @internal\n */\nexport type JsonStringifyOptions = Pick<JsonSerializableOptions, \"IgnoreInaccessibleMembers\">;\n\n/**\n * Performs basic JSON serialization using `JSON.stringify` and brands the result as {@link JsonString}`<T>`.\n *\n * @remarks\n * Parameter `value` must be JSON-serializable and thus type T is put through filter {@link JsonSerializable}.\n *\n * @internal\n */\nexport const JsonStringify = JSON.stringify as <\n\tT,\n\tOptions extends JsonStringifyOptions = Record<never, never>,\n>(\n\tvalue: JsonSerializable<\n\t\tT,\n\t\t// Make sure only options that are known are passed through.\n\t\tPick<Options, Extract<keyof JsonStringifyOptions, keyof Options>>\n\t>,\n) => JsonString<T>;\n\n/**\n * Performs basic JSON parsing using `JSON.parse` given a {@link JsonString}`<T>` (`string`).\n *\n * @remarks\n * Return type is filtered through {@link JsonDeserialized}`<T>` for best accuracy.\n *\n * Note that `JsonParse` cannot verify at runtime that the input is valid JSON\n * or that it matches type T. It is the caller's responsibility to ensure that\n * the input is valid JSON and the output conforms to the expected type.\n *\n * @internal\n */\nexport const JsonParse = JSON.parse as <T extends JsonString<unknown>>(\n\ttext: T,\n) => T extends JsonString<infer U> ? JsonDeserialized<U> : unknown;\n"]}
|
package/dist/legacy.alpha.d.ts
CHANGED
package/dist/legacy.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { IFluidHandle } from "./handles.js";
|
|
|
11
11
|
* @privateRemarks
|
|
12
12
|
* WeakRef should be added when lib is updated to ES2021 or later.
|
|
13
13
|
*
|
|
14
|
+
* @beta
|
|
14
15
|
* @system
|
|
15
16
|
*/
|
|
16
17
|
export type ShallowReadonlySupportedGenericsDefault = Promise<unknown> | IFluidHandle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shallowReadonly.d.ts","sourceRoot":"","sources":["../src/shallowReadonly.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,oBAAoB,EACpB,yBAAyB,EACzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD
|
|
1
|
+
{"version":3,"file":"shallowReadonly.d.ts","sourceRoot":"","sources":["../src/shallowReadonly.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,oBAAoB,EACpB,yBAAyB,EACzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,MAAM,uCAAuC,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC;AAEtF;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACtC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;CAC7C;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,CAC1B,CAAC,EACD,OAAO,SAAS,sBAAsB,GAAG;IACxC,gBAAgB,EAAE,uCAAuC,CAAC;CAC1D,IACE,oBAAoB,CAAC,mBAAmB,CAC3C,CAAC,EACD,OAAO,SAAS;IAAE,gBAAgB,EAAE,OAAO,CAAA;CAAE,GAC1C,OAAO,CAAC,kBAAkB,CAAC,GAC3B,uCAAuC,CAC1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shallowReadonly.js","sourceRoot":"","sources":["../src/shallowReadonly.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 {\n\tInternalUtilityTypes,\n\tReadonlySupportedGenerics,\n} from \"./exposedInternalUtilityTypes.js\";\nimport type { IFluidHandle } from \"./handles.js\";\n\n/**\n * Default set of generic that {@link ShallowReadonly} will apply shallow immutability\n * to generic types.\n *\n * @privateRemarks\n * WeakRef should be added when lib is updated to ES2021 or later.\n *\n * @system\n */\nexport type ShallowReadonlySupportedGenericsDefault = Promise<unknown> | IFluidHandle;\n\n/**\n * Options for {@link ShallowReadonly}.\n *\n * @beta\n */\nexport interface ShallowReadonlyOptions {\n\t/**\n\t * Union of Built-in and IFluidHandle whose generics will also be made shallowly immutable.\n\t *\n\t * The default value is `IFluidHandle` | `Promise`.\n\t */\n\tDeepenedGenerics?: ReadonlySupportedGenerics;\n}\n\n/**\n * Transforms type to a shallowly immutable type.\n *\n * @remarks\n * This utility type is similar to `Readonly<T>`, but also applies immutability to\n * common generic types like `Map` and `Set`.\n *\n * Optionally, immutability can be applied to supported generics types. See\n * {@link ShallowReadonlySupportedGenericsDefault} for generics that have\n * immutability applied to generic type by default.\n *\n * @beta\n */\nexport type ShallowReadonly<\n\tT,\n\tOptions extends ShallowReadonlyOptions = {\n\t\tDeepenedGenerics: ShallowReadonlySupportedGenericsDefault;\n\t},\n> = InternalUtilityTypes.ShallowReadonlyImpl<\n\tT,\n\tOptions extends { DeepenedGenerics: unknown }\n\t\t? Options[\"DeepenedGenerics\"]\n\t\t: ShallowReadonlySupportedGenericsDefault\n>;\n"]}
|
|
1
|
+
{"version":3,"file":"shallowReadonly.js","sourceRoot":"","sources":["../src/shallowReadonly.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 {\n\tInternalUtilityTypes,\n\tReadonlySupportedGenerics,\n} from \"./exposedInternalUtilityTypes.js\";\nimport type { IFluidHandle } from \"./handles.js\";\n\n/**\n * Default set of generic that {@link ShallowReadonly} will apply shallow immutability\n * to generic types.\n *\n * @privateRemarks\n * WeakRef should be added when lib is updated to ES2021 or later.\n *\n * @beta\n * @system\n */\nexport type ShallowReadonlySupportedGenericsDefault = Promise<unknown> | IFluidHandle;\n\n/**\n * Options for {@link ShallowReadonly}.\n *\n * @beta\n */\nexport interface ShallowReadonlyOptions {\n\t/**\n\t * Union of Built-in and IFluidHandle whose generics will also be made shallowly immutable.\n\t *\n\t * The default value is `IFluidHandle` | `Promise`.\n\t */\n\tDeepenedGenerics?: ReadonlySupportedGenerics;\n}\n\n/**\n * Transforms type to a shallowly immutable type.\n *\n * @remarks\n * This utility type is similar to `Readonly<T>`, but also applies immutability to\n * common generic types like `Map` and `Set`.\n *\n * Optionally, immutability can be applied to supported generics types. See\n * {@link ShallowReadonlySupportedGenericsDefault} for generics that have\n * immutability applied to generic type by default.\n *\n * @beta\n */\nexport type ShallowReadonly<\n\tT,\n\tOptions extends ShallowReadonlyOptions = {\n\t\tDeepenedGenerics: ShallowReadonlySupportedGenericsDefault;\n\t},\n> = InternalUtilityTypes.ShallowReadonlyImpl<\n\tT,\n\tOptions extends { DeepenedGenerics: unknown }\n\t\t? Options[\"DeepenedGenerics\"]\n\t\t: ShallowReadonlySupportedGenericsDefault\n>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exposedUtilityTypes.d.ts","sourceRoot":"","sources":["../../src/api-extractor/exposedUtilityTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,mBAAmB,aAAa,CAAC;AAEjC,mBAAmB,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exposedUtilityTypes.js","sourceRoot":"","sources":["../../src/api-extractor/exposedUtilityTypes.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// This is a workaround for api-extractor to see that \"./index.js\" exports are\n// covered for the \"internal/exposedUtilityTypes\" entry point. This file\n// re-exports everything from index.js and the exposedUtilityTypes.js files,\n// which allows api-extractor to verify that all exports from both files are\n// exported somewhere by the package.\n\n/* eslint-disable no-restricted-syntax */\n\n// The \"internal\" exports are a superset of the standard ones. So, we want to export everything from the standard barrel file.\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nexport type * from \"../index.js\";\n\nexport type * from \"../exposedUtilityTypes.js\";\n"]}
|
package/lib/brandedType.d.ts
CHANGED
package/lib/brandedType.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brandedType.js","sourceRoot":"","sources":["../src/brandedType.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 * Base branded type which can be used to annotate other type.\n *\n * @remarks\n * `BrandedType` is covariant over its type parameter, which could be leveraged\n * for any generic type, but the preferred pattern is to specify variance\n * explicitly in a derived class making that clear and guaranteeing branding is\n * unique. It is convenient to have the derived class be the generic given to\n * `BrandedType`.\n *\n * ### Direct use [simple]\n *\n * Use `T & BrandedType<\"BrandName\">` to create a type conforming to `T` and\n * also branded with name \"BrandName\".\n *\n * ### Derived class use [preferred]\n *\n * Derive another class declaration and ideally add additional\n * protected properties to distinguish the type. (Private properties would\n * {@link https://github.com/microsoft/TypeScript/issues/20979#issuecomment-361432516|lose their type when exported}\n * and public properties would allow structural typing and show up on the branded\n * values.)\n *\n * Then use `T & MyBrandedType<U>` to create a type conforming to `T` and\n * also branded with the derived brand.\n *\n * ### Runtime\n *\n * Since branded types are not real value types, they will always need to be\n * created using `as` syntax and often `as unknown` first.\n *\n * This class should never exist at runtime, so it is only declared.\n *\n * @example\n * Definition of two branded types with different variance:\n * ```typescript\n * // A brand that is covariant over given T\n * declare class CovariantBrand<T> extends BrandedType<CovariantBrand<unknown>> {\n * // Does not allow unrelated or less derived CovariantBrand-ed types to be\n * // assigned. CovariantBrand<string> is not assignable to CovariantBrand<\"literal\">.\n * protected readonly CovariantBrand: T;\n * private constructor();\n * }\n * // A brand that is contravariant over given T\n * declare class ContravariantBrand<T> extends BrandedType<ContravariantBrand<unknown>> {\n * // Does not allow unrelated or more derived ContravariantBrand-ed types to be\n * // assigned. ContravariantBrand<\"literal\"> is not assignable to ContravariantBrand<string>.\n * protected readonly ContravariantBrand: (_: T) => void;\n * private constructor();\n * }\n * ```\n *\n * Applying a brand to a type through type-guard:\n * ```typescript\n * function numberIs5(n: number): n is number & CovariantBrand<5> {\n * return n === 5;\n * }\n * function onlyAccept4_5_or_6(_n: number & CovariantBrand<4 | 5 | 6>): void {}\n *\n * function example(n: number) {\n * if (numberIs5(n)) {\n * onlyAccept4_5_or_6(n); // OK: CovariantBrand<5> is assignable to CovariantBrand<4 | 5 | 6>;\n * }\n * }\n * ```\n *\n * @
|
|
1
|
+
{"version":3,"file":"brandedType.js","sourceRoot":"","sources":["../src/brandedType.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 * Base branded type which can be used to annotate other type.\n *\n * @remarks\n * `BrandedType` is covariant over its type parameter, which could be leveraged\n * for any generic type, but the preferred pattern is to specify variance\n * explicitly in a derived class making that clear and guaranteeing branding is\n * unique. It is convenient to have the derived class be the generic given to\n * `BrandedType`.\n *\n * ### Direct use [simple]\n *\n * Use `T & BrandedType<\"BrandName\">` to create a type conforming to `T` and\n * also branded with name \"BrandName\".\n *\n * ### Derived class use [preferred]\n *\n * Derive another class declaration and ideally add additional\n * protected properties to distinguish the type. (Private properties would\n * {@link https://github.com/microsoft/TypeScript/issues/20979#issuecomment-361432516|lose their type when exported}\n * and public properties would allow structural typing and show up on the branded\n * values.)\n *\n * Then use `T & MyBrandedType<U>` to create a type conforming to `T` and\n * also branded with the derived brand.\n *\n * ### Runtime\n *\n * Since branded types are not real value types, they will always need to be\n * created using `as` syntax and often `as unknown` first.\n *\n * This class should never exist at runtime, so it is only declared.\n *\n * @example\n * Definition of two branded types with different variance:\n * ```typescript\n * // A brand that is covariant over given T\n * declare class CovariantBrand<T> extends BrandedType<CovariantBrand<unknown>> {\n * // Does not allow unrelated or less derived CovariantBrand-ed types to be\n * // assigned. CovariantBrand<string> is not assignable to CovariantBrand<\"literal\">.\n * protected readonly CovariantBrand: T;\n * private constructor();\n * }\n * // A brand that is contravariant over given T\n * declare class ContravariantBrand<T> extends BrandedType<ContravariantBrand<unknown>> {\n * // Does not allow unrelated or more derived ContravariantBrand-ed types to be\n * // assigned. ContravariantBrand<\"literal\"> is not assignable to ContravariantBrand<string>.\n * protected readonly ContravariantBrand: (_: T) => void;\n * private constructor();\n * }\n * ```\n *\n * Applying a brand to a type through type-guard:\n * ```typescript\n * function numberIs5(n: number): n is number & CovariantBrand<5> {\n * return n === 5;\n * }\n * function onlyAccept4_5_or_6(_n: number & CovariantBrand<4 | 5 | 6>): void {}\n *\n * function example(n: number) {\n * if (numberIs5(n)) {\n * onlyAccept4_5_or_6(n); // OK: CovariantBrand<5> is assignable to CovariantBrand<4 | 5 | 6>;\n * }\n * }\n * ```\n *\n * @beta\n */\nexport declare class BrandedType<out Brand> {\n\t/**\n\t * Compile time only marker to make type checking more strict.\n\t * This method will not exist at runtime and accessing it is invalid.\n\t *\n\t * @privateRemarks\n\t * `Brand` is used as the return type of a method rather than a simple\n\t * readonly property as this allows types with two brands to be\n\t * intersected without getting `never`.\n\t * The method takes in `never` to help emphasize that it's not callable.\n\t */\n\tprotected readonly brand: (dummy: never) => Brand;\n\n\tprotected constructor();\n\n\t/**\n\t * Since this class is a compile time only type brand, `instanceof` will\n\t * never work with it. * This `Symbol.hasInstance` implementation ensures\n\t * that `instanceof` will error if used, and in TypeScript 5.3 and newer\n\t * will produce a compile time error if used.\n\t */\n\tpublic static [Symbol.hasInstance](value: never): value is never;\n}\n"]}
|
package/lib/deepReadonly.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { DeepReadonlyRecursionLimit, InternalUtilityTypes, ReadonlySupporte
|
|
|
10
10
|
* @privateRemarks
|
|
11
11
|
* WeakRef should be added when lib is updated to ES2021 or later.
|
|
12
12
|
*
|
|
13
|
+
* @beta
|
|
13
14
|
* @system
|
|
14
15
|
*/
|
|
15
16
|
export type DeepReadonlySupportedGenericsDefault = Map<unknown, unknown> | Promise<unknown> | Set<unknown> | WeakMap<object, unknown> | WeakSet<object>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepReadonly.d.ts","sourceRoot":"","sources":["../src/deepReadonly.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,MAAM,kCAAkC,CAAC;AAE1C
|
|
1
|
+
{"version":3,"file":"deepReadonly.d.ts","sourceRoot":"","sources":["../src/deepReadonly.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,MAAM,oCAAoC,GAC7C,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,GACrB,OAAO,CAAC,OAAO,CAAC,GAChB,GAAG,CAAC,OAAO,CAAC,GACZ,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAAC;AAEnB;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAE7C;;;;OAIG;IACH,YAAY,CAAC,EAAE,0BAA0B,CAAC;CAC1C;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,CACvB,CAAC,EACD,OAAO,SAAS,mBAAmB,GAAG;IACrC,gBAAgB,EAAE,oCAAoC,CAAC;IACvD,YAAY,EAAE,SAAS,CAAC;CACxB,IACE,oBAAoB,CAAC,gBAAgB,CACxC,CAAC,EACD,OAAO,SAAS;IAAE,gBAAgB,EAAE,OAAO,CAAA;CAAE,GAC1C,OAAO,CAAC,kBAAkB,CAAC,GAC3B,oCAAoC,EACvC,OAAO,SAAS;IAAE,YAAY,EAAE,0BAA0B,CAAA;CAAE,GACzD,OAAO,CAAC,cAAc,CAAC,GACvB,SAAS,CACZ,CAAC"}
|
package/lib/deepReadonly.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepReadonly.js","sourceRoot":"","sources":["../src/deepReadonly.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 {\n\tDeepReadonlyRecursionLimit,\n\tInternalUtilityTypes,\n\tReadonlySupportedGenerics,\n} from \"./exposedInternalUtilityTypes.js\";\n\n/**\n * Default set of generic that {@link DeepReadonly} will apply deep immutability\n * to generic types.\n *\n * @privateRemarks\n * WeakRef should be added when lib is updated to ES2021 or later.\n *\n * @system\n */\nexport type DeepReadonlySupportedGenericsDefault =\n\t| Map<unknown, unknown>\n\t| Promise<unknown>\n\t| Set<unknown>\n\t| WeakMap<object, unknown>\n\t| WeakSet<object>;\n\n/**\n * Options for {@link DeepReadonly}.\n *\n * @beta\n */\nexport interface DeepReadonlyOptions {\n\t/**\n\t * Union of Built-in and IFluidHandle whose generics will also be made deeply immutable.\n\t *\n\t * The default value is `Map` | `Promise` | `Set` | `WeakMap` | `WeakSet`.\n\t */\n\tDeepenedGenerics?: ReadonlySupportedGenerics;\n\n\t/**\n\t * Limit on processing recursive types.\n\t *\n\t * The default value is `\"NoLimit\"`.\n\t */\n\tRecurseLimit?: DeepReadonlyRecursionLimit;\n}\n\n/**\n * Transforms type to a fully and deeply immutable type, with limitations.\n *\n * @remarks\n * This utility type is similar to a recursive `Readonly<T>`, but also\n * applies immutability to common generic types like `Map` and `Set`.\n *\n * Optionally, immutability can be applied to supported generics types. See\n * {@link DeepReadonlySupportedGenericsDefault} for generics that have\n * immutability applied to generic type by default.\n *\n * @beta\n */\nexport type DeepReadonly<\n\tT,\n\tOptions extends DeepReadonlyOptions = {\n\t\tDeepenedGenerics: DeepReadonlySupportedGenericsDefault;\n\t\tRecurseLimit: \"NoLimit\";\n\t},\n> = InternalUtilityTypes.DeepReadonlyImpl<\n\tT,\n\tOptions extends { DeepenedGenerics: unknown }\n\t\t? Options[\"DeepenedGenerics\"]\n\t\t: DeepReadonlySupportedGenericsDefault,\n\tOptions extends { RecurseLimit: DeepReadonlyRecursionLimit }\n\t\t? Options[\"RecurseLimit\"]\n\t\t: \"NoLimit\"\n>;\n"]}
|
|
1
|
+
{"version":3,"file":"deepReadonly.js","sourceRoot":"","sources":["../src/deepReadonly.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 {\n\tDeepReadonlyRecursionLimit,\n\tInternalUtilityTypes,\n\tReadonlySupportedGenerics,\n} from \"./exposedInternalUtilityTypes.js\";\n\n/**\n * Default set of generic that {@link DeepReadonly} will apply deep immutability\n * to generic types.\n *\n * @privateRemarks\n * WeakRef should be added when lib is updated to ES2021 or later.\n *\n * @beta\n * @system\n */\nexport type DeepReadonlySupportedGenericsDefault =\n\t| Map<unknown, unknown>\n\t| Promise<unknown>\n\t| Set<unknown>\n\t| WeakMap<object, unknown>\n\t| WeakSet<object>;\n\n/**\n * Options for {@link DeepReadonly}.\n *\n * @beta\n */\nexport interface DeepReadonlyOptions {\n\t/**\n\t * Union of Built-in and IFluidHandle whose generics will also be made deeply immutable.\n\t *\n\t * The default value is `Map` | `Promise` | `Set` | `WeakMap` | `WeakSet`.\n\t */\n\tDeepenedGenerics?: ReadonlySupportedGenerics;\n\n\t/**\n\t * Limit on processing recursive types.\n\t *\n\t * The default value is `\"NoLimit\"`.\n\t */\n\tRecurseLimit?: DeepReadonlyRecursionLimit;\n}\n\n/**\n * Transforms type to a fully and deeply immutable type, with limitations.\n *\n * @remarks\n * This utility type is similar to a recursive `Readonly<T>`, but also\n * applies immutability to common generic types like `Map` and `Set`.\n *\n * Optionally, immutability can be applied to supported generics types. See\n * {@link DeepReadonlySupportedGenericsDefault} for generics that have\n * immutability applied to generic type by default.\n *\n * @beta\n */\nexport type DeepReadonly<\n\tT,\n\tOptions extends DeepReadonlyOptions = {\n\t\tDeepenedGenerics: DeepReadonlySupportedGenericsDefault;\n\t\tRecurseLimit: \"NoLimit\";\n\t},\n> = InternalUtilityTypes.DeepReadonlyImpl<\n\tT,\n\tOptions extends { DeepenedGenerics: unknown }\n\t\t? Options[\"DeepenedGenerics\"]\n\t\t: DeepReadonlySupportedGenericsDefault,\n\tOptions extends { RecurseLimit: DeepReadonlyRecursionLimit }\n\t\t? Options[\"RecurseLimit\"]\n\t\t: \"NoLimit\"\n>;\n"]}
|
|
@@ -286,7 +286,7 @@ export declare namespace InternalUtilityTypes {
|
|
|
286
286
|
* @typeParam IfNoMatch - Type to return if no match is found.
|
|
287
287
|
*
|
|
288
288
|
* @remarks
|
|
289
|
-
* In a recursive context, use {@link
|
|
289
|
+
* In a recursive context, use {@link InternalCoreInterfacesUtilityTypes.IfExactTypeInTuple} to manage ancestry.
|
|
290
290
|
*
|
|
291
291
|
* @privateRemarks
|
|
292
292
|
* Perhaps it is a Typescript defect but a simple check that `T` is `never`
|
|
@@ -518,7 +518,7 @@ export declare namespace InternalUtilityTypes {
|
|
|
518
518
|
*/
|
|
519
519
|
export type JsonSerializableOpaqueAllowances<T extends AnyOpaqueJsonType, Controls extends FilterControlsWithSubstitution> = T extends OpaqueJsonSerializable<infer TData, any, unknown> | OpaqueJsonDeserialized<infer TData, any, unknown> ? T extends OpaqueJsonSerializable<TData, any, unknown> & OpaqueJsonDeserialized<TData, any, unknown> ? OpaqueJsonSerializable<TData, Controls["AllowExactly"], Controls["AllowExtensionOf"]> & OpaqueJsonDeserialized<TData, Controls["AllowExactly"], Controls["AllowExtensionOf"]> : T extends OpaqueJsonSerializable<TData, any, unknown> ? OpaqueJsonSerializable<TData, Controls["AllowExactly"], Controls["AllowExtensionOf"]> : T extends OpaqueJsonDeserialized<TData, any, unknown> ? OpaqueJsonDeserialized<TData, Controls["AllowExactly"], Controls["AllowExtensionOf"]> : "internal error: failed to determine OpaqueJson* type" : never;
|
|
520
520
|
/**
|
|
521
|
-
* Helper for {@link JsonSerializableFilter} to determine if a property may
|
|
521
|
+
* Helper for {@link InternalCoreInterfacesUtilityTypes.JsonSerializableFilter} to determine if a property may
|
|
522
522
|
* be `undefined` and selects from options for result.
|
|
523
523
|
* Since `unknown` is a superset of `undefined`, it is given a special case.
|
|
524
524
|
* Additionally since index signatures are inherently optional, `unknown` typed
|
|
@@ -621,7 +621,7 @@ export declare namespace InternalUtilityTypes {
|
|
|
621
621
|
AllowExtensionOf: Controls["AllowExtensionOf"] | AnyOpaqueJsonType;
|
|
622
622
|
}, "found non-publics", "only publics"> extends "found non-publics" ? TypeUnderRecursion extends false ? JsonDeserializedFilter<T, Controls> : OpaqueJsonDeserialized<T, Controls["AllowExactly"], Controls["AllowExtensionOf"]> : T : TypeUnderRecursion extends false ? JsonDeserializedFilter<T, Controls> : OpaqueJsonDeserialized<T, Controls["AllowExactly"], Controls["AllowExtensionOf"]> : never : never : never;
|
|
623
623
|
/**
|
|
624
|
-
* Recurses `T` applying {@link
|
|
624
|
+
* Recurses `T` applying {@link InternalCoreInterfacesUtilityTypes.JsonDeserializedFilter} up until
|
|
625
625
|
* `T` is found to be a match of an ancestor type. At that point `T` is wrapped in
|
|
626
626
|
* {@link OpaqueJsonDeserialized} to avoid further immediate processing, if
|
|
627
627
|
* modification is needed. Caller will need to unwrap the type to continue processing.
|
|
@@ -812,13 +812,13 @@ export declare namespace InternalUtilityTypes {
|
|
|
812
812
|
AllowExtensionOf: never;
|
|
813
813
|
}, "found non-publics", "only publics"> extends "found non-publics" ? DeepReadonlyWorker<T, DeepenedGenerics, Extract<NoDepthOrRecurseLimit, RecursionLimit>> : T : DeepReadonlyWorker<T, DeepenedGenerics, Extract<NoDepthOrRecurseLimit, RecursionLimit>> : never;
|
|
814
814
|
/**
|
|
815
|
-
* Recurses `T` applying {@link
|
|
815
|
+
* Recurses `T` applying {@link InternalCoreInterfacesUtilityTypes.DeepReadonlyWorker} up to `RecurseLimit` times.
|
|
816
816
|
*
|
|
817
817
|
* @system
|
|
818
818
|
*/
|
|
819
819
|
export type DeepReadonlyRecursion<T, DeepenedGenerics extends ReadonlySupportedGenerics, RecurseLimit extends RecursionLimit, TAncestorTypes = T> = T extends TAncestorTypes ? RecurseLimit extends `+${infer RecursionRemainder}` ? DeepReadonlyLimitingRecursion<T, DeepenedGenerics, RecursionRemainder extends RecursionLimit ? RecursionRemainder : 0> : T : DeepReadonlyWorker<T, DeepenedGenerics, RecurseLimit, TAncestorTypes | T>;
|
|
820
820
|
/**
|
|
821
|
-
* Core implementation of {@link
|
|
821
|
+
* Core implementation of {@link InternalCoreInterfacesUtilityTypes.DeepReadonlyLimitingRecursion}.
|
|
822
822
|
*
|
|
823
823
|
* @system
|
|
824
824
|
*/
|