@fluidframework/core-interfaces 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.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 (57) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/api-report/core-interfaces.api.md +6 -50
  3. package/dist/erasedType.d.ts +79 -0
  4. package/dist/erasedType.d.ts.map +1 -0
  5. package/dist/erasedType.js +77 -0
  6. package/dist/erasedType.js.map +1 -0
  7. package/dist/handles.d.ts +1 -1
  8. package/dist/handles.d.ts.map +1 -1
  9. package/dist/handles.js.map +1 -1
  10. package/dist/index.d.ts +1 -2
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +1 -5
  13. package/dist/index.js.map +1 -1
  14. package/dist/legacy.d.ts +48 -0
  15. package/dist/public.d.ts +44 -0
  16. package/internal.d.ts +11 -0
  17. package/legacy.d.ts +11 -0
  18. package/lib/erasedType.d.ts +79 -0
  19. package/lib/erasedType.d.ts.map +1 -0
  20. package/lib/erasedType.js +73 -0
  21. package/lib/erasedType.js.map +1 -0
  22. package/lib/handles.d.ts +1 -1
  23. package/lib/handles.d.ts.map +1 -1
  24. package/lib/handles.js.map +1 -1
  25. package/lib/index.d.ts +1 -2
  26. package/lib/index.d.ts.map +1 -1
  27. package/lib/index.js +0 -1
  28. package/lib/index.js.map +1 -1
  29. package/lib/legacy.d.ts +48 -0
  30. package/lib/public.d.ts +44 -0
  31. package/package.json +59 -44
  32. package/src/erasedType.ts +85 -0
  33. package/src/handles.ts +1 -1
  34. package/src/index.ts +1 -9
  35. package/api-extractor-cjs.json +0 -8
  36. package/dist/core-interfaces-alpha.d.ts +0 -793
  37. package/dist/core-interfaces-beta.d.ts +0 -670
  38. package/dist/core-interfaces-public.d.ts +0 -670
  39. package/dist/core-interfaces-untrimmed.d.ts +0 -914
  40. package/dist/fluidPackage.d.ts +0 -153
  41. package/dist/fluidPackage.d.ts.map +0 -1
  42. package/dist/fluidPackage.js +0 -41
  43. package/dist/fluidPackage.js.map +0 -1
  44. package/lib/core-interfaces-alpha.d.ts +0 -793
  45. package/lib/core-interfaces-beta.d.ts +0 -670
  46. package/lib/core-interfaces-public.d.ts +0 -670
  47. package/lib/core-interfaces-untrimmed.d.ts +0 -914
  48. package/lib/fluidPackage.d.ts +0 -153
  49. package/lib/fluidPackage.d.ts.map +0 -1
  50. package/lib/fluidPackage.js +0 -36
  51. package/lib/fluidPackage.js.map +0 -1
  52. package/lib/test/types/fluidObjectTypes.js +0 -95
  53. package/lib/test/types/fluidObjectTypes.js.map +0 -1
  54. package/lib/test/types/validateCoreInterfacesPrevious.generated.js +0 -106
  55. package/lib/test/types/validateCoreInterfacesPrevious.generated.js.map +0 -1
  56. package/src/fluidPackage.ts +0 -179
  57. /package/{dist → lib}/tsdoc-metadata.json +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @fluidframework/core-interfaces
2
2
 
3
+ ## 2.0.0-rc.3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - core-interfaces: Code details and package API surface removed [97d68aa06b](https://github.com/microsoft/FluidFramework/commit/97d68aa06bd5c022ecb026655814aea222a062ae)
8
+
9
+ The code details and package API surface was deprecated in @fluidframework/core-interfaces in 0.53 and has now been removed. Please import them from @fluidframework/container-definitions instead. These include:
10
+
11
+ - IFluidCodeDetails
12
+ - IFluidCodeDetailsComparer
13
+ - IFluidCodeDetailsConfig
14
+ - IFluidPackage
15
+ - IFluidPackageEnvironment
16
+ - IProvideFluidCodeDetailsComparer
17
+ - isFluidCodeDetails
18
+ - isFluidPackage
19
+
20
+ - Packages now use package.json "exports" and require modern module resolution [97d68aa06b](https://github.com/microsoft/FluidFramework/commit/97d68aa06bd5c022ecb026655814aea222a062ae)
21
+
22
+ Fluid Framework packages have been updated to use the [package.json "exports"
23
+ field](https://nodejs.org/docs/latest-v18.x/api/packages.html#exports) to define explicit entry points for both
24
+ TypeScript types and implementation code.
25
+
26
+ This means that using Fluid Framework packages require the following TypeScript settings in tsconfig.json:
27
+
28
+ - `"moduleResolution": "Node16"` with `"module": "Node16"`
29
+ - `"moduleResolution": "Bundler"` with `"module": "ESNext"`
30
+
31
+ We recommend using Node16/Node16 unless absolutely necessary. That will produce transpiled JavaScript that is suitable
32
+ for use with modern versions of Node.js _and_ Bundlers.
33
+ [See the TypeScript documentation](https://www.typescriptlang.org/tsconfig#moduleResolution) for more information
34
+ regarding the module and moduleResolution options.
35
+
36
+ **Node10 moduleResolution is not supported; it does not support Fluid Framework's API structuring pattern that is used
37
+ to distinguish stable APIs from those that are in development.**
38
+
3
39
  ## 2.0.0-rc.2.0.0
4
40
 
5
41
  ### Minor Changes
@@ -7,6 +7,12 @@
7
7
  // @public
8
8
  export type ConfigTypes = string | number | boolean | number[] | string[] | boolean[] | undefined;
9
9
 
10
+ // @public @sealed
11
+ export abstract class ErasedType<out Name = unknown> {
12
+ static [Symbol.hasInstance](value: never): value is never;
13
+ protected abstract brand(dummy: never): Name;
14
+ }
15
+
10
16
  // @public
11
17
  export type ExtendEventProvider<TBaseEvent extends IEvent, TBase extends IEventProvider<TBaseEvent>, TEvent extends TBaseEvent> = Omit<Omit<Omit<TBase, "on">, "once">, "off"> & IEventProvider<TBaseEvent> & IEventProvider<TEvent>;
12
18
 
@@ -230,27 +236,6 @@ export type IEventTransformer<TThis, TEvent extends IEvent> = TEvent extends {
230
236
  (event: string, listener: (...args: any[]) => void): any;
231
237
  } ? TransformedEvent<TThis, E0, A0> : TransformedEvent<TThis, string, any[]>;
232
238
 
233
- // @alpha @deprecated
234
- export interface IFluidCodeDetails {
235
- readonly config?: IFluidCodeDetailsConfig;
236
- readonly package: string | Readonly<IFluidPackage>;
237
- }
238
-
239
- // @internal @deprecated (undocumented)
240
- export const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer;
241
-
242
- // @internal @deprecated
243
- export interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {
244
- compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;
245
- satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;
246
- }
247
-
248
- // @alpha @deprecated
249
- export interface IFluidCodeDetailsConfig {
250
- // (undocumented)
251
- readonly [key: string]: string;
252
- }
253
-
254
239
  // @public (undocumented)
255
240
  export const IFluidHandle: keyof IProvideFluidHandle;
256
241
 
@@ -288,23 +273,6 @@ export interface IFluidLoadable extends IProvideFluidLoadable {
288
273
  handle: IFluidHandle;
289
274
  }
290
275
 
291
- // @alpha @deprecated
292
- export interface IFluidPackage {
293
- [key: string]: unknown;
294
- fluid: {
295
- [environment: string]: undefined | IFluidPackageEnvironment;
296
- };
297
- name: string;
298
- }
299
-
300
- // @alpha @deprecated
301
- export interface IFluidPackageEnvironment {
302
- [target: string]: undefined | {
303
- files: string[];
304
- [key: string]: unknown;
305
- };
306
- }
307
-
308
276
  // @internal (undocumented)
309
277
  export const IFluidRunnable: keyof IProvideFluidRunnable;
310
278
 
@@ -328,12 +296,6 @@ export interface ILoggingError extends Error {
328
296
  getTelemetryProperties(): ITelemetryBaseProperties;
329
297
  }
330
298
 
331
- // @internal @deprecated (undocumented)
332
- export interface IProvideFluidCodeDetailsComparer {
333
- // (undocumented)
334
- readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;
335
- }
336
-
337
299
  // @public (undocumented)
338
300
  export interface IProvideFluidHandle {
339
301
  // (undocumented)
@@ -388,12 +350,6 @@ export interface IResponse {
388
350
  value: any;
389
351
  }
390
352
 
391
- // @internal @deprecated (undocumented)
392
- export const isFluidCodeDetails: (details: unknown) => details is Readonly<IFluidCodeDetails>;
393
-
394
- // @internal @deprecated
395
- export const isFluidPackage: (pkg: unknown) => pkg is Readonly<IFluidPackage>;
396
-
397
353
  // @internal (undocumented)
398
354
  export interface ISignalEnvelope {
399
355
  address?: string;
@@ -0,0 +1,79 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Erased type which can be used to expose a opaque/erased version of a type without referencing the actual type.
7
+ * @remarks
8
+ * This similar to the [type erasure](https://en.wikipedia.org/wiki/Type_erasure) pattern,
9
+ * but for erasing types at the package boundary.
10
+ *
11
+ * This can be used to implement the TypeScript typing for the [handle](https://en.wikipedia.org/wiki/Handle_(computing)) pattern,
12
+ * allowing code outside of a package to have a reference/handle to something in the package in a type safe way without the package having to publicly export the types of the object.
13
+ * This should not be confused with the more specific IFluidHandle which is also named after this design pattern.
14
+ *
15
+ * Recommended usage is to use `interface` instead of `type` so tooling (such as tsc and refactoring tools)
16
+ * uses the type name instead of expanding it.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * // public
21
+ * export interface ErasedMyType extends ErasedType<"myPackage.MyType"> {}
22
+ * // internal
23
+ * export interface MyType {
24
+ * example: number;
25
+ * }
26
+ * // Usage
27
+ * function extract(input: ErasedMyType): MyType {
28
+ * return input as unknown as MyType;
29
+ * }
30
+ * function erase(input: MyType): ErasedMyType {
31
+ * return input as unknown as ErasedMyType;
32
+ * }
33
+ * ```
34
+ *
35
+ * Do not use this class with `instanceof`: this will always be false at runtime,
36
+ * but the compiler may think it's true in some cases.
37
+ * @privateRemarks
38
+ * For this pattern to work well it needs to be difficult for a user of the erased type to
39
+ * implicitly use something other than a instance received from the package as an instance of the erased type in type safe code.
40
+ *
41
+ * This means that this type must not be able to be implicitly converted to from any strong type (not `any` or `never`),
42
+ * and no amount of auto complete or auto-implement refactoring will produce something that can be used as an erased type.
43
+ * This is accomplished by:
44
+ *
45
+ * 1. requiring that values of this type be an instance of this class.
46
+ * Typescript does not enforce this requirement for class: only for classes with protected or private members, so such member is included.
47
+ *
48
+ * 2. making this class impossible to get an instance of.
49
+ * This is done by having a private constructor.
50
+ *
51
+ * 3. ensuring different erased types also using this library can not be implicitly converted between each-other.
52
+ * This is done by using the "Name" type parameter.
53
+ * Note that just having the type parameter is not enough since the presence of type parameters has no impact on implicit conversion in TypeScript:
54
+ * only the usages of the type parameter matter.
55
+ *
56
+ * @sealed
57
+ * @public
58
+ */
59
+ export declare abstract class ErasedType<out Name = unknown> {
60
+ /**
61
+ * Compile time only marker to make type checking more strict.
62
+ * This method will not exist at runtime and accessing it is invalid.
63
+ * @privateRemarks
64
+ * `Name` is used as the return type of a method rather than a a simple readonly member as this allows types with two brands to be intersected without getting `never`.
65
+ * The method takes in never to help emphasize that its not callable.
66
+ */
67
+ protected abstract brand(dummy: never): Name;
68
+ /**
69
+ * This class should never exist at runtime, so make it un-constructable.
70
+ */
71
+ private constructor();
72
+ /**
73
+ * Since this class is a compile time only type brand, `instanceof` will never work with it.
74
+ * This `Symbol.hasInstance` implementation ensures that `instanceof` will error if used,
75
+ * and in TypeScript 5.3 and newer will produce a compile time error if used.
76
+ */
77
+ static [Symbol.hasInstance](value: never): value is never;
78
+ }
79
+ //# sourceMappingURL=erasedType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erasedType.d.ts","sourceRoot":"","sources":["../src/erasedType.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,8BAAsB,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,OAAO;IAClD;;;;;;OAMG;IACH,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAE5C;;OAEG;IACH,OAAO;IAEP;;;;OAIG;WACW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,KAAK;CAKhE"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ErasedType = void 0;
8
+ /**
9
+ * Erased type which can be used to expose a opaque/erased version of a type without referencing the actual type.
10
+ * @remarks
11
+ * This similar to the [type erasure](https://en.wikipedia.org/wiki/Type_erasure) pattern,
12
+ * but for erasing types at the package boundary.
13
+ *
14
+ * This can be used to implement the TypeScript typing for the [handle](https://en.wikipedia.org/wiki/Handle_(computing)) pattern,
15
+ * allowing code outside of a package to have a reference/handle to something in the package in a type safe way without the package having to publicly export the types of the object.
16
+ * This should not be confused with the more specific IFluidHandle which is also named after this design pattern.
17
+ *
18
+ * Recommended usage is to use `interface` instead of `type` so tooling (such as tsc and refactoring tools)
19
+ * uses the type name instead of expanding it.
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * // public
24
+ * export interface ErasedMyType extends ErasedType<"myPackage.MyType"> {}
25
+ * // internal
26
+ * export interface MyType {
27
+ * example: number;
28
+ * }
29
+ * // Usage
30
+ * function extract(input: ErasedMyType): MyType {
31
+ * return input as unknown as MyType;
32
+ * }
33
+ * function erase(input: MyType): ErasedMyType {
34
+ * return input as unknown as ErasedMyType;
35
+ * }
36
+ * ```
37
+ *
38
+ * Do not use this class with `instanceof`: this will always be false at runtime,
39
+ * but the compiler may think it's true in some cases.
40
+ * @privateRemarks
41
+ * For this pattern to work well it needs to be difficult for a user of the erased type to
42
+ * implicitly use something other than a instance received from the package as an instance of the erased type in type safe code.
43
+ *
44
+ * This means that this type must not be able to be implicitly converted to from any strong type (not `any` or `never`),
45
+ * and no amount of auto complete or auto-implement refactoring will produce something that can be used as an erased type.
46
+ * This is accomplished by:
47
+ *
48
+ * 1. requiring that values of this type be an instance of this class.
49
+ * Typescript does not enforce this requirement for class: only for classes with protected or private members, so such member is included.
50
+ *
51
+ * 2. making this class impossible to get an instance of.
52
+ * This is done by having a private constructor.
53
+ *
54
+ * 3. ensuring different erased types also using this library can not be implicitly converted between each-other.
55
+ * This is done by using the "Name" type parameter.
56
+ * Note that just having the type parameter is not enough since the presence of type parameters has no impact on implicit conversion in TypeScript:
57
+ * only the usages of the type parameter matter.
58
+ *
59
+ * @sealed
60
+ * @public
61
+ */
62
+ class ErasedType {
63
+ /**
64
+ * This class should never exist at runtime, so make it un-constructable.
65
+ */
66
+ constructor() { }
67
+ /**
68
+ * Since this class is a compile time only type brand, `instanceof` will never work with it.
69
+ * This `Symbol.hasInstance` implementation ensures that `instanceof` will error if used,
70
+ * and in TypeScript 5.3 and newer will produce a compile time error if used.
71
+ */
72
+ static [Symbol.hasInstance](value) {
73
+ throw new Error("ErasedType is a compile time type brand not a real class that can be used with `instancof` at runtime.");
74
+ }
75
+ }
76
+ exports.ErasedType = ErasedType;
77
+ //# sourceMappingURL=erasedType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erasedType.js","sourceRoot":"","sources":["../src/erasedType.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAsB,UAAU;IAU/B;;OAEG;IACH,gBAAuB,CAAC;IAExB;;;;OAIG;IACI,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAY;QAC9C,MAAM,IAAI,KAAK,CACd,wGAAwG,CACxG,CAAC;IACH,CAAC;CACD;AAzBD,gCAyBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Erased type which can be used to expose a opaque/erased version of a type without referencing the actual type.\n * @remarks\n * This similar to the [type erasure](https://en.wikipedia.org/wiki/Type_erasure) pattern,\n * but for erasing types at the package boundary.\n *\n * This can be used to implement the TypeScript typing for the [handle](https://en.wikipedia.org/wiki/Handle_(computing)) pattern,\n * allowing code outside of a package to have a reference/handle to something in the package in a type safe way without the package having to publicly export the types of the object.\n * This should not be confused with the more specific IFluidHandle which is also named after this design pattern.\n *\n * Recommended usage is to use `interface` instead of `type` so tooling (such as tsc and refactoring tools)\n * uses the type name instead of expanding it.\n *\n * @example\n * ```typescript\n * // public\n * export interface ErasedMyType extends ErasedType<\"myPackage.MyType\"> {}\n * // internal\n * export interface MyType {\n * \texample: number;\n * }\n * // Usage\n * function extract(input: ErasedMyType): MyType {\n * \treturn input as unknown as MyType;\n * }\n * function erase(input: MyType): ErasedMyType {\n * \treturn input as unknown as ErasedMyType;\n * }\n * ```\n *\n * Do not use this class with `instanceof`: this will always be false at runtime,\n * but the compiler may think it's true in some cases.\n * @privateRemarks\n * For this pattern to work well it needs to be difficult for a user of the erased type to\n * implicitly use something other than a instance received from the package as an instance of the erased type in type safe code.\n *\n * This means that this type must not be able to be implicitly converted to from any strong type (not `any` or `never`),\n * and no amount of auto complete or auto-implement refactoring will produce something that can be used as an erased type.\n * This is accomplished by:\n *\n * 1. requiring that values of this type be an instance of this class.\n * Typescript does not enforce this requirement for class: only for classes with protected or private members, so such member is included.\n *\n * 2. making this class impossible to get an instance of.\n * This is done by having a private constructor.\n *\n * 3. ensuring different erased types also using this library can not be implicitly converted between each-other.\n * This is done by using the \"Name\" type parameter.\n * Note that just having the type parameter is not enough since the presence of type parameters has no impact on implicit conversion in TypeScript:\n * only the usages of the type parameter matter.\n *\n * @sealed\n * @public\n */\nexport abstract class ErasedType<out Name = unknown> {\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 * @privateRemarks\n\t * `Name` is used as the return type of a method rather than a a simple readonly member as this allows types with two brands to be intersected without getting `never`.\n\t * The method takes in never to help emphasize that its not callable.\n\t */\n\tprotected abstract brand(dummy: never): Name;\n\n\t/**\n\t * This class should never exist at runtime, so make it un-constructable.\n\t */\n\tprivate constructor() {}\n\n\t/**\n\t * Since this class is a compile time only type brand, `instanceof` will never work with it.\n\t * This `Symbol.hasInstance` implementation ensures that `instanceof` will error if used,\n\t * and in TypeScript 5.3 and newer will produce a compile time error if used.\n\t */\n\tpublic static [Symbol.hasInstance](value: never): value is never {\n\t\tthrow new Error(\n\t\t\t\"ErasedType is a compile time type brand not a real class that can be used with `instancof` at runtime.\",\n\t\t);\n\t}\n}\n"]}
package/dist/handles.d.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { IRequest, IResponse } from "./fluidRouter.js";
6
5
  import type { IFluidLoadable } from "./fluidLoadable.js";
6
+ import type { IRequest, IResponse } from "./fluidRouter.js";
7
7
  import type { FluidObject } from "./provider.js";
8
8
  /**
9
9
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,0BAAkD,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IACtE;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,WAAW,IAAI,IAAI,CAAC;IAEpB,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,mBAAoC,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY,CAE5B,CAAC,GAAG,WAAW,GAAG,cAAc,CAC/B,SAAQ,mBAAmB;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,WAAW,IAAI,IAAI,CAAC;IAEpB;;OAEG;IACH,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAElB;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CACjC"}
1
+ {"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,0BAAkD,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IACtE;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,WAAW,IAAI,IAAI,CAAC;IAEpB,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,mBAAoC,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY,CAE5B,CAAC,GAAG,WAAW,GAAG,cAAc,CAC/B,SAAQ,mBAAmB;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,WAAW,IAAI,IAAI,CAAC;IAEpB;;OAEG;IACH,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAElB;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CACjC"}
@@ -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;;GAEG;AACU,QAAA,YAAY,GAA8B,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IRequest, IResponse } from \"./fluidRouter.js\";\nimport type { IFluidLoadable } from \"./fluidLoadable.js\";\nimport type { FluidObject } from \"./provider.js\";\n\n/**\n * @public\n */\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\n/**\n * @public\n */\nexport interface IProvideFluidHandleContext {\n\treadonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * Describes a routing context from which other `IFluidHandleContext`s are defined.\n * @public\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 */\nexport const IFluidHandle: keyof IProvideFluidHandle = \"IFluidHandle\";\n\n/**\n * @public\n */\nexport interface IProvideFluidHandle {\n\treadonly IFluidHandle: IFluidHandle;\n}\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @public\n */\nexport interface IFluidHandle<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tT = FluidObject & IFluidLoadable,\n> extends IProvideFluidHandle {\n\t/**\n\t * @deprecated Do not use handle's path for routing. Use `get` to get the underlying object.\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 * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * @deprecated To be removed. This is part of an internal API surface and should not be called.\n\t *\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\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 * @deprecated To be removed. This is part of an internal API surface and should not be called.\n\t *\n\t * Binds the given handle to this one or attach the given handle if this handle is attached.\n\t * A bound handle will also be attached once this handle is attached.\n\t */\n\tbind(handle: IFluidHandle): void;\n}\n"]}
1
+ {"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH;;GAEG;AACU,QAAA,mBAAmB,GAAqC,qBAAqB,CAAC;AAsC3F;;GAEG;AACU,QAAA,YAAY,GAA8B,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidLoadable } from \"./fluidLoadable.js\";\nimport type { IRequest, IResponse } from \"./fluidRouter.js\";\nimport type { FluidObject } from \"./provider.js\";\n\n/**\n * @public\n */\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\n/**\n * @public\n */\nexport interface IProvideFluidHandleContext {\n\treadonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * Describes a routing context from which other `IFluidHandleContext`s are defined.\n * @public\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 */\nexport const IFluidHandle: keyof IProvideFluidHandle = \"IFluidHandle\";\n\n/**\n * @public\n */\nexport interface IProvideFluidHandle {\n\treadonly IFluidHandle: IFluidHandle;\n}\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @public\n */\nexport interface IFluidHandle<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tT = FluidObject & IFluidLoadable,\n> extends IProvideFluidHandle {\n\t/**\n\t * @deprecated Do not use handle's path for routing. Use `get` to get the underlying object.\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 * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * @deprecated To be removed. This is part of an internal API surface and should not be called.\n\t *\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\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 * @deprecated To be removed. This is part of an internal API surface and should not be called.\n\t *\n\t * Binds the given handle to this one or attach the given handle if this handle is attached.\n\t * A bound handle will also be attached once this handle is attached.\n\t */\n\tbind(handle: IFluidHandle): void;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -8,8 +8,6 @@ export { FluidErrorTypes } from "./error.js";
8
8
  export type { ExtendEventProvider, IErrorEvent, IEvent, IEventProvider, IEventThisPlaceHolder, IEventTransformer, ReplaceIEventThisPlaceHolder, TransformedEvent, } from "./events.js";
9
9
  export type { IProvideFluidLoadable, IProvideFluidRunnable } from "./fluidLoadable.js";
10
10
  export { IFluidLoadable, IFluidRunnable } from "./fluidLoadable.js";
11
- export type { IFluidPackageEnvironment, IFluidPackage, IFluidCodeDetailsConfig, IFluidCodeDetails, IProvideFluidCodeDetailsComparer, } from "./fluidPackage.js";
12
- export { isFluidPackage, isFluidCodeDetails, IFluidCodeDetailsComparer } from "./fluidPackage.js";
13
11
  export type { IRequest, IRequestHeader, IResponse } from "./fluidRouter.js";
14
12
  export type { IProvideFluidHandleContext, IProvideFluidHandle } from "./handles.js";
15
13
  export { IFluidHandleContext, IFluidHandle } from "./handles.js";
@@ -18,4 +16,5 @@ export { LogLevel } from "./logger.js";
18
16
  export type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider.js";
19
17
  export type { ConfigTypes, IConfigProviderBase } from "./config.js";
20
18
  export type { ISignalEnvelope } from "./messages.js";
19
+ export type { ErasedType } from "./erasedType.js";
21
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpE,YAAY,EACX,wBAAwB,EACxB,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,gCAAgC,GAChC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAKlG,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,YAAY,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjE,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,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,YAAY,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjE,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,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -4,16 +4,12 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.LogLevel = exports.IFluidHandle = exports.IFluidHandleContext = exports.IFluidCodeDetailsComparer = exports.isFluidCodeDetails = exports.isFluidPackage = exports.IFluidRunnable = exports.IFluidLoadable = exports.FluidErrorTypes = void 0;
7
+ exports.LogLevel = exports.IFluidHandle = exports.IFluidHandleContext = exports.IFluidRunnable = exports.IFluidLoadable = exports.FluidErrorTypes = void 0;
8
8
  var error_js_1 = require("./error.js");
9
9
  Object.defineProperty(exports, "FluidErrorTypes", { enumerable: true, get: function () { return error_js_1.FluidErrorTypes; } });
10
10
  var fluidLoadable_js_1 = require("./fluidLoadable.js");
11
11
  Object.defineProperty(exports, "IFluidLoadable", { enumerable: true, get: function () { return fluidLoadable_js_1.IFluidLoadable; } });
12
12
  Object.defineProperty(exports, "IFluidRunnable", { enumerable: true, get: function () { return fluidLoadable_js_1.IFluidRunnable; } });
13
- var fluidPackage_js_1 = require("./fluidPackage.js");
14
- Object.defineProperty(exports, "isFluidPackage", { enumerable: true, get: function () { return fluidPackage_js_1.isFluidPackage; } });
15
- Object.defineProperty(exports, "isFluidCodeDetails", { enumerable: true, get: function () { return fluidPackage_js_1.isFluidCodeDetails; } });
16
- Object.defineProperty(exports, "IFluidCodeDetailsComparer", { enumerable: true, get: function () { return fluidPackage_js_1.IFluidCodeDetailsComparer; } });
17
13
  var handles_js_1 = require("./handles.js");
18
14
  Object.defineProperty(exports, "IFluidHandleContext", { enumerable: true, get: function () { return handles_js_1.IFluidHandleContext; } });
19
15
  Object.defineProperty(exports, "IFluidHandle", { enumerable: true, get: function () { return handles_js_1.IFluidHandle; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,uCAA6C;AAApC,2GAAA,eAAe,OAAA;AAcxB,uDAAoE;AAA3D,kHAAA,cAAc,OAAA;AAAE,kHAAA,cAAc,OAAA;AASvC,qDAAkG;AAAzF,iHAAA,cAAc,OAAA;AAAE,qHAAA,kBAAkB,OAAA;AAAE,4HAAA,yBAAyB,OAAA;AAQtE,2CAAiE;AAAxD,iHAAA,mBAAmB,OAAA;AAAE,0GAAA,YAAY,OAAA;AAU1C,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type { IErrorBase, IGenericError, IUsageError, IThrottlingWarning } from \"./error.js\";\nexport { FluidErrorTypes } from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable, IProvideFluidRunnable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable, IFluidRunnable } from \"./fluidLoadable.js\";\n\nexport type {\n\tIFluidPackageEnvironment,\n\tIFluidPackage,\n\tIFluidCodeDetailsConfig,\n\tIFluidCodeDetails,\n\tIProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage.js\";\nexport { isFluidPackage, isFluidCodeDetails, IFluidCodeDetailsComparer } from \"./fluidPackage.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 { IProvideFluidHandleContext, IProvideFluidHandle } from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope } from \"./messages.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,uCAA6C;AAApC,2GAAA,eAAe,OAAA;AAcxB,uDAAoE;AAA3D,kHAAA,cAAc,OAAA;AAAE,kHAAA,cAAc,OAAA;AAQvC,2CAAiE;AAAxD,iHAAA,mBAAmB,OAAA;AAAE,0GAAA,YAAY,OAAA;AAU1C,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type { IErrorBase, IGenericError, IUsageError, IThrottlingWarning } from \"./error.js\";\nexport { FluidErrorTypes } from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable, IProvideFluidRunnable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable, IFluidRunnable } from \"./fluidLoadable.js\";\n\n// TypeScript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type { IProvideFluidHandleContext, IProvideFluidHandle } from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope } from \"./messages.js\";\nexport type { ErasedType } from \"./erasedType.js\";\n"]}
@@ -0,0 +1,48 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export {
12
+ // public APIs
13
+ ConfigTypes,
14
+ ErasedType,
15
+ ExtendEventProvider,
16
+ FluidObject,
17
+ FluidObjectKeys,
18
+ FluidObjectProviderKeys,
19
+ IConfigProviderBase,
20
+ IDisposable,
21
+ IErrorBase,
22
+ IErrorEvent,
23
+ IEvent,
24
+ IEventProvider,
25
+ IEventThisPlaceHolder,
26
+ IEventTransformer,
27
+ IFluidHandle,
28
+ IFluidHandleContext,
29
+ IFluidLoadable,
30
+ IProvideFluidHandle,
31
+ IProvideFluidHandleContext,
32
+ IProvideFluidLoadable,
33
+ IRequest,
34
+ IRequestHeader,
35
+ IResponse,
36
+ ITelemetryBaseEvent,
37
+ ITelemetryBaseLogger,
38
+ ITelemetryBaseProperties,
39
+ LogLevel,
40
+ ReplaceIEventThisPlaceHolder,
41
+ Tagged,
42
+ TelemetryBaseEventPropertyType,
43
+ TransformedEvent,
44
+
45
+ // alpha APIs
46
+ FluidErrorTypes,
47
+ IThrottlingWarning
48
+ } from "./index.js";
@@ -0,0 +1,44 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export {
12
+ // public APIs
13
+ ConfigTypes,
14
+ ErasedType,
15
+ ExtendEventProvider,
16
+ FluidObject,
17
+ FluidObjectKeys,
18
+ FluidObjectProviderKeys,
19
+ IConfigProviderBase,
20
+ IDisposable,
21
+ IErrorBase,
22
+ IErrorEvent,
23
+ IEvent,
24
+ IEventProvider,
25
+ IEventThisPlaceHolder,
26
+ IEventTransformer,
27
+ IFluidHandle,
28
+ IFluidHandleContext,
29
+ IFluidLoadable,
30
+ IProvideFluidHandle,
31
+ IProvideFluidHandleContext,
32
+ IProvideFluidLoadable,
33
+ IRequest,
34
+ IRequestHeader,
35
+ IResponse,
36
+ ITelemetryBaseEvent,
37
+ ITelemetryBaseLogger,
38
+ ITelemetryBaseProperties,
39
+ LogLevel,
40
+ ReplaceIEventThisPlaceHolder,
41
+ Tagged,
42
+ TelemetryBaseEventPropertyType,
43
+ TransformedEvent
44
+ } from "./index.js";
package/internal.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export * from "./lib/index.js";
package/legacy.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export * from "./lib/legacy.js";
@@ -0,0 +1,79 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Erased type which can be used to expose a opaque/erased version of a type without referencing the actual type.
7
+ * @remarks
8
+ * This similar to the [type erasure](https://en.wikipedia.org/wiki/Type_erasure) pattern,
9
+ * but for erasing types at the package boundary.
10
+ *
11
+ * This can be used to implement the TypeScript typing for the [handle](https://en.wikipedia.org/wiki/Handle_(computing)) pattern,
12
+ * allowing code outside of a package to have a reference/handle to something in the package in a type safe way without the package having to publicly export the types of the object.
13
+ * This should not be confused with the more specific IFluidHandle which is also named after this design pattern.
14
+ *
15
+ * Recommended usage is to use `interface` instead of `type` so tooling (such as tsc and refactoring tools)
16
+ * uses the type name instead of expanding it.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * // public
21
+ * export interface ErasedMyType extends ErasedType<"myPackage.MyType"> {}
22
+ * // internal
23
+ * export interface MyType {
24
+ * example: number;
25
+ * }
26
+ * // Usage
27
+ * function extract(input: ErasedMyType): MyType {
28
+ * return input as unknown as MyType;
29
+ * }
30
+ * function erase(input: MyType): ErasedMyType {
31
+ * return input as unknown as ErasedMyType;
32
+ * }
33
+ * ```
34
+ *
35
+ * Do not use this class with `instanceof`: this will always be false at runtime,
36
+ * but the compiler may think it's true in some cases.
37
+ * @privateRemarks
38
+ * For this pattern to work well it needs to be difficult for a user of the erased type to
39
+ * implicitly use something other than a instance received from the package as an instance of the erased type in type safe code.
40
+ *
41
+ * This means that this type must not be able to be implicitly converted to from any strong type (not `any` or `never`),
42
+ * and no amount of auto complete or auto-implement refactoring will produce something that can be used as an erased type.
43
+ * This is accomplished by:
44
+ *
45
+ * 1. requiring that values of this type be an instance of this class.
46
+ * Typescript does not enforce this requirement for class: only for classes with protected or private members, so such member is included.
47
+ *
48
+ * 2. making this class impossible to get an instance of.
49
+ * This is done by having a private constructor.
50
+ *
51
+ * 3. ensuring different erased types also using this library can not be implicitly converted between each-other.
52
+ * This is done by using the "Name" type parameter.
53
+ * Note that just having the type parameter is not enough since the presence of type parameters has no impact on implicit conversion in TypeScript:
54
+ * only the usages of the type parameter matter.
55
+ *
56
+ * @sealed
57
+ * @public
58
+ */
59
+ export declare abstract class ErasedType<out Name = unknown> {
60
+ /**
61
+ * Compile time only marker to make type checking more strict.
62
+ * This method will not exist at runtime and accessing it is invalid.
63
+ * @privateRemarks
64
+ * `Name` is used as the return type of a method rather than a a simple readonly member as this allows types with two brands to be intersected without getting `never`.
65
+ * The method takes in never to help emphasize that its not callable.
66
+ */
67
+ protected abstract brand(dummy: never): Name;
68
+ /**
69
+ * This class should never exist at runtime, so make it un-constructable.
70
+ */
71
+ private constructor();
72
+ /**
73
+ * Since this class is a compile time only type brand, `instanceof` will never work with it.
74
+ * This `Symbol.hasInstance` implementation ensures that `instanceof` will error if used,
75
+ * and in TypeScript 5.3 and newer will produce a compile time error if used.
76
+ */
77
+ static [Symbol.hasInstance](value: never): value is never;
78
+ }
79
+ //# sourceMappingURL=erasedType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erasedType.d.ts","sourceRoot":"","sources":["../src/erasedType.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,8BAAsB,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,OAAO;IAClD;;;;;;OAMG;IACH,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAE5C;;OAEG;IACH,OAAO;IAEP;;;;OAIG;WACW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,KAAK;CAKhE"}