@fluidframework/core-interfaces 0.43.1000-60718 → 0.43.1000-60792

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.
@@ -8,7 +8,7 @@
8
8
  //
9
9
  // @public
10
10
  export type FluidObject<T = unknown> = {
11
- readonly [P in FluidObjectProviderKeys<T>]?: T[P];
11
+ [P in FluidObjectProviderKeys<T>]?: T[P];
12
12
  };
13
13
 
14
14
  // @public
@@ -53,7 +53,7 @@ export declare type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T>
53
53
  *
54
54
  */
55
55
  export declare type FluidObject<T = unknown> = {
56
- readonly [P in FluidObjectProviderKeys<T>]?: T[P];
56
+ [P in FluidObjectProviderKeys<T>]?: T[P];
57
57
  };
58
58
  /**
59
59
  * This utility type creates a type that is the union of all keys on the generic type
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACF,oBAAY,uBAAuB,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,IACnE,MAAM,SAAS,KAAK,GAAG,KAAK,GAAG,MAAM,SAAS,KAAK,GAAE,KAAK,GAC1D,KAAK,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAChC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAC1D,KAAK,GACL,KAAK,GACT,KAAK,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACF,oBAAY,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI;IACpC,QAAQ,EAAE,CAAC,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACpD,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,eAAe,CAAC,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACF,oBAAY,uBAAuB,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,IACnE,MAAM,SAAS,KAAK,GAAG,KAAK,GAAG,MAAM,SAAS,KAAK,GAAE,KAAK,GAC1D,KAAK,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAChC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAC1D,KAAK,GACL,KAAK,GACT,KAAK,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACF,oBAAY,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI;KACnC,CAAC,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,eAAe,CAAC,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @internal\n * This utility type is meant for internal use by @see FluidObject\n * Produces a valid FluidObject key given a type and a property.\n * A valid FluidObject key is a property that exists on the incoming type\n * as well as on the type of the property itself. For example, IProvideFoo.IFoo.IFoo\n * This aligns with the FluidObject pattern expected to be used with all FluidObjects.\n * For example:\n * ```\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n * This pattern enables discovery, and delegation in a standard way which is central\n * to FluidObject pattern\n */\n export type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> =\n string extends TProp ? never : number extends TProp? never : // exclude indexers [key:string |number]: any\n TProp extends keyof Required<T>[TProp] // TProp is a property of T, and T[TProp]\n ? Required<T>[TProp] extends Required<Required<T>[TProp]>[TProp] // T[TProp] is the same type as T[TProp][TProp]\n ? TProp\n : never\n : never;\n\n/**\n * This utility type take interface(s) that follow the FluidObject pattern, and produces\n * a new type that can be used for inspection and discovery of those interfaces.\n *\n * It is meant to be used with types that are known to implement the FluidObject pattern.\n * A common way to specify a type implements the FluidObject pattern is to expose it as a\n * FluidObject without a generic argument.\n *\n * For example, if we have an interface like below\n * ```\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n *\n * and a function that returns a FluidObject. You would do the following\n *\n * `const maybeFoo: FluidObject<IFoo> = getFluidObject()`;\n *\n * Either IFoo or IProvideFoo are valid generic arguments. In both case\n * maybeFoo will be of type `{IFoo?: IFoo}`. If IFoo is not undefined,\n * then the FluidObject provides IFoo, and it can be used.\n *\n * You can inspect multiple types via a intersection. For example:\n * `FluidObject<IFoo & IBar>`\n *\n */\n export type FluidObject<T = unknown> = {\n readonly [P in FluidObjectProviderKeys<T>]?: T[P];\n};\n\n/**\n * This utility type creates a type that is the union of all keys on the generic type\n * which implement the FluidObject pattern. @see FluidObject\n *\n * For example `FluidObjectKeys<IFoo & IBar>` would result in `\"IFoo\" | \"IBar\"`\n *\n */\nexport type FluidObjectKeys<T> = keyof FluidObject<T>;\n"]}
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @internal\n * This utility type is meant for internal use by @see FluidObject\n * Produces a valid FluidObject key given a type and a property.\n * A valid FluidObject key is a property that exists on the incoming type\n * as well as on the type of the property itself. For example, IProvideFoo.IFoo.IFoo\n * This aligns with the FluidObject pattern expected to be used with all FluidObjects.\n * For example:\n * ```\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n * This pattern enables discovery, and delegation in a standard way which is central\n * to FluidObject pattern\n */\n export type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> =\n string extends TProp ? never : number extends TProp? never : // exclude indexers [key:string |number]: any\n TProp extends keyof Required<T>[TProp] // TProp is a property of T, and T[TProp]\n ? Required<T>[TProp] extends Required<Required<T>[TProp]>[TProp] // T[TProp] is the same type as T[TProp][TProp]\n ? TProp\n : never\n : never;\n\n/**\n * This utility type take interface(s) that follow the FluidObject pattern, and produces\n * a new type that can be used for inspection and discovery of those interfaces.\n *\n * It is meant to be used with types that are known to implement the FluidObject pattern.\n * A common way to specify a type implements the FluidObject pattern is to expose it as a\n * FluidObject without a generic argument.\n *\n * For example, if we have an interface like below\n * ```\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n *\n * and a function that returns a FluidObject. You would do the following\n *\n * `const maybeFoo: FluidObject<IFoo> = getFluidObject()`;\n *\n * Either IFoo or IProvideFoo are valid generic arguments. In both case\n * maybeFoo will be of type `{IFoo?: IFoo}`. If IFoo is not undefined,\n * then the FluidObject provides IFoo, and it can be used.\n *\n * You can inspect multiple types via a intersection. For example:\n * `FluidObject<IFoo & IBar>`\n *\n */\n export type FluidObject<T = unknown> = {\n [P in FluidObjectProviderKeys<T>]?: T[P];\n};\n\n/**\n * This utility type creates a type that is the union of all keys on the generic type\n * which implement the FluidObject pattern. @see FluidObject\n *\n * For example `FluidObjectKeys<IFoo & IBar>` would result in `\"IFoo\" | \"IBar\"`\n *\n */\nexport type FluidObjectKeys<T> = keyof FluidObject<T>;\n"]}
package/lib/provider.d.ts CHANGED
@@ -53,7 +53,7 @@ export declare type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T>
53
53
  *
54
54
  */
55
55
  export declare type FluidObject<T = unknown> = {
56
- readonly [P in FluidObjectProviderKeys<T>]?: T[P];
56
+ [P in FluidObjectProviderKeys<T>]?: T[P];
57
57
  };
58
58
  /**
59
59
  * This utility type creates a type that is the union of all keys on the generic type
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACF,oBAAY,uBAAuB,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,IACnE,MAAM,SAAS,KAAK,GAAG,KAAK,GAAG,MAAM,SAAS,KAAK,GAAE,KAAK,GAC1D,KAAK,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAChC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAC1D,KAAK,GACL,KAAK,GACT,KAAK,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACF,oBAAY,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI;IACpC,QAAQ,EAAE,CAAC,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACpD,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,eAAe,CAAC,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACF,oBAAY,uBAAuB,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,IACnE,MAAM,SAAS,KAAK,GAAG,KAAK,GAAG,MAAM,SAAS,KAAK,GAAE,KAAK,GAC1D,KAAK,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAChC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAC1D,KAAK,GACL,KAAK,GACT,KAAK,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACF,oBAAY,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI;KACnC,CAAC,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,eAAe,CAAC,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @internal\n * This utility type is meant for internal use by @see FluidObject\n * Produces a valid FluidObject key given a type and a property.\n * A valid FluidObject key is a property that exists on the incoming type\n * as well as on the type of the property itself. For example, IProvideFoo.IFoo.IFoo\n * This aligns with the FluidObject pattern expected to be used with all FluidObjects.\n * For example:\n * ```\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n * This pattern enables discovery, and delegation in a standard way which is central\n * to FluidObject pattern\n */\n export type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> =\n string extends TProp ? never : number extends TProp? never : // exclude indexers [key:string |number]: any\n TProp extends keyof Required<T>[TProp] // TProp is a property of T, and T[TProp]\n ? Required<T>[TProp] extends Required<Required<T>[TProp]>[TProp] // T[TProp] is the same type as T[TProp][TProp]\n ? TProp\n : never\n : never;\n\n/**\n * This utility type take interface(s) that follow the FluidObject pattern, and produces\n * a new type that can be used for inspection and discovery of those interfaces.\n *\n * It is meant to be used with types that are known to implement the FluidObject pattern.\n * A common way to specify a type implements the FluidObject pattern is to expose it as a\n * FluidObject without a generic argument.\n *\n * For example, if we have an interface like below\n * ```\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n *\n * and a function that returns a FluidObject. You would do the following\n *\n * `const maybeFoo: FluidObject<IFoo> = getFluidObject()`;\n *\n * Either IFoo or IProvideFoo are valid generic arguments. In both case\n * maybeFoo will be of type `{IFoo?: IFoo}`. If IFoo is not undefined,\n * then the FluidObject provides IFoo, and it can be used.\n *\n * You can inspect multiple types via a intersection. For example:\n * `FluidObject<IFoo & IBar>`\n *\n */\n export type FluidObject<T = unknown> = {\n readonly [P in FluidObjectProviderKeys<T>]?: T[P];\n};\n\n/**\n * This utility type creates a type that is the union of all keys on the generic type\n * which implement the FluidObject pattern. @see FluidObject\n *\n * For example `FluidObjectKeys<IFoo & IBar>` would result in `\"IFoo\" | \"IBar\"`\n *\n */\nexport type FluidObjectKeys<T> = keyof FluidObject<T>;\n"]}
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @internal\n * This utility type is meant for internal use by @see FluidObject\n * Produces a valid FluidObject key given a type and a property.\n * A valid FluidObject key is a property that exists on the incoming type\n * as well as on the type of the property itself. For example, IProvideFoo.IFoo.IFoo\n * This aligns with the FluidObject pattern expected to be used with all FluidObjects.\n * For example:\n * ```\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n * This pattern enables discovery, and delegation in a standard way which is central\n * to FluidObject pattern\n */\n export type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> =\n string extends TProp ? never : number extends TProp? never : // exclude indexers [key:string |number]: any\n TProp extends keyof Required<T>[TProp] // TProp is a property of T, and T[TProp]\n ? Required<T>[TProp] extends Required<Required<T>[TProp]>[TProp] // T[TProp] is the same type as T[TProp][TProp]\n ? TProp\n : never\n : never;\n\n/**\n * This utility type take interface(s) that follow the FluidObject pattern, and produces\n * a new type that can be used for inspection and discovery of those interfaces.\n *\n * It is meant to be used with types that are known to implement the FluidObject pattern.\n * A common way to specify a type implements the FluidObject pattern is to expose it as a\n * FluidObject without a generic argument.\n *\n * For example, if we have an interface like below\n * ```\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n *\n * and a function that returns a FluidObject. You would do the following\n *\n * `const maybeFoo: FluidObject<IFoo> = getFluidObject()`;\n *\n * Either IFoo or IProvideFoo are valid generic arguments. In both case\n * maybeFoo will be of type `{IFoo?: IFoo}`. If IFoo is not undefined,\n * then the FluidObject provides IFoo, and it can be used.\n *\n * You can inspect multiple types via a intersection. For example:\n * `FluidObject<IFoo & IBar>`\n *\n */\n export type FluidObject<T = unknown> = {\n [P in FluidObjectProviderKeys<T>]?: T[P];\n};\n\n/**\n * This utility type creates a type that is the union of all keys on the generic type\n * which implement the FluidObject pattern. @see FluidObject\n *\n * For example `FluidObjectKeys<IFoo & IBar>` would result in `\"IFoo\" | \"IBar\"`\n *\n */\nexport type FluidObjectKeys<T> = keyof FluidObject<T>;\n"]}
@@ -94,4 +94,15 @@ import { IFluidLoadable } from "../../";
94
94
  useProvider((_g = c.IFooChild) === null || _g === void 0 ? void 0 : _g.parent());
95
95
  useProvider((_j = (_h = c.IFooChild) === null || _h === void 0 ? void 0 : _h.IFooParent) === null || _j === void 0 ? void 0 : _j.parent());
96
96
  }
97
+ // validate usage as builder
98
+ {
99
+ const builder = {};
100
+ builder.IFluidLoadable = getLoadable();
101
+ }
102
+ // validate readonly prevents modification
103
+ {
104
+ const builder = {};
105
+ // @ts-expect-error Cannot assign to 'IFluidLoadable' because it is a read-only property.
106
+ builder.IFluidLoadable = getLoadable();
107
+ }
97
108
  //# sourceMappingURL=fluidObjectTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fluidObjectTypes.js","sourceRoot":"","sources":["../../../src/test/types/fluidObjectTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAqE,MAAM,QAAQ,CAAC;AAa3G,4FAA4F;AAC5F;IACI,MAAM,QAAQ,GAAuC,cAAc,EAAE,CAAC;IACtE,cAAc,CAAC,QAAQ,CAAC,CAAC;IACzB,cAAc,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACxC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACtB,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACrC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACtB,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACrC,uEAAuE;IACvE,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrB,GAAG,OAAC,QAAQ,CAAC,cAAc,0CAAE,MAAM,CAAC,CAAC;IACrC,MAAM,OAAO,GAA4B,QAAQ,CAAC,cAAc,CAAC;IACjE,cAAc,CAAC,OAAO,CAAC,CAAC;IACxB,WAAW,CAAC,OAAO,CAAC,CAAC;IACrB,WAAW,CAAiB,OAAO,CAAC,CAAC;IACrC,WAAW,CAAC,OAAO,CAAC,CAAC;CACxB;AAED,kGAAkG;AAClG;IACI,MAAM,GAAG,GAAgC,cAAc,EAAE,CAAC;IAC1D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AAC,OAAO,CAAC,CAAC;IACrB,WAAW,CAAO,OAAO,CAAC,CAAC;IAC3B,WAAW,CAAC,OAAO,CAAC,CAAC;CACxB;AAID;IACI,MAAM,WAAW,GAAgB,eAAe,EAAE,CAAC;IACnD,MAAM,MAAM,GAAiB,cAAc,EAAE,CAAC;IAC9C,WAAW,CAAC,WAAW,CAAC,CAAC;IACzB,WAAW,CAAC,MAAM,CAAC,CAAC;IACpB,cAAc,CAAC,WAAW,CAAC,CAAC;IAC5B,cAAc,CAAC,MAAM,CAAC,CAAC;IACvB,WAAW,CAAC,MAAM,CAAC,CAAC;IACpB,WAAW,CAAC,WAAW,CAAC,CAAC;IACzB,WAAW,CAAiB,MAAM,CAAC,CAAC;IACpC,WAAW,CAAiB,WAAW,CAAC,CAAC;CAC5C;AAED,8CAA8C;AAC9C;IAKI,MAAM,GAAG,GAAsB,cAAc,EAAE,CAAC;IAChD,8EAA8E;IAC9E,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACtB;AAED,gCAAgC;AAChC;IAiBI,MAAM,CAAC,GAAmC,cAAc,EAAE,CAAC;IAC3D,WAAW,OAAC,CAAC,CAAC,UAAU,0CAAE,MAAM,GAAG,CAAC;IAEpC,MAAM,CAAC,GAAkC,cAAc,EAAE,CAAC;IAC1D,iGAAiG;IACjG,WAAW,OAAC,CAAC,CAAC,UAAU,0CAAE,MAAM,GAAG,CAAC;IACpC,WAAW,OAAC,CAAC,CAAC,SAAS,0CAAE,KAAK,GAAG,CAAC;IAClC,WAAW,OAAC,CAAC,CAAC,SAAS,0CAAE,MAAM,GAAG,CAAC;IACnC,WAAW,aAAC,CAAC,CAAC,SAAS,0CAAE,UAAU,0CAAE,MAAM,GAAG,CAAC;CAClD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IFluidLoadable, IProvideFluidLoadable, FluidObject, FluidObjectKeys, IFluidObject } from \"../../\";\n\ndeclare function getFluidObject(): FluidObject;\n\ndeclare function useFluidObject(params: FluidObject | undefined): void;\n\ndeclare function useProvider<T extends FluidObject>(params: FluidObject<T> | undefined): void;\n\ndeclare function useProviderKey<T,TKey extends FluidObjectKeys<T> = FluidObjectKeys<T>>(key: TKey): void;\n\ndeclare function useLoadable(params: FluidObject<IFluidLoadable> | undefined): void;\n\ndeclare function use(obj: any);\n// test implicit conversions between FluidObject and a FluidObject with a provides interface\n{\n const provider: FluidObject<IProvideFluidLoadable> = getFluidObject();\n useFluidObject(provider);\n useFluidObject(provider.IFluidLoadable);\n useProvider(provider);\n useProvider(provider.IFluidLoadable);\n useLoadable(provider);\n useLoadable(provider.IFluidLoadable);\n // @ts-expect-error provider shouldn't have any non-provider properties\n use(provider.handle);\n use(provider.IFluidLoadable?.handle);\n const unknown: FluidObject | undefined = provider.IFluidLoadable;\n useFluidObject(unknown);\n useProvider(unknown);\n useProvider<IFluidLoadable>(unknown);\n useLoadable(unknown);\n}\n\n// test implicit conversions between FluidObject and a FluidObject with a implementation interface\n{\n const foo: FluidObject<IFluidLoadable> = getFluidObject();\n useFluidObject(foo);\n useFluidObject(foo.IFluidLoadable);\n useProvider(foo);\n useProvider(foo.IFluidLoadable);\n useLoadable(foo);\n useLoadable(foo.IFluidLoadable);\n // @ts-expect-error provider shouldn't have any non-provider properties\n use(foo.handle);\n use(foo.IFluidLoadable?.handle);\n const unknown: FluidObject | undefined = foo.IFluidLoadable;\n useFluidObject(unknown);\n useProvider(unknown);\n useProvider<IFluidLoadable>(unknown);\n useLoadable(unknown);\n}\n\n// test getting keys\n{\n useProviderKey<IProvideFluidLoadable>(IFluidLoadable);\n useProviderKey<IFluidLoadable>(IFluidLoadable);\n const loadableKey: keyof IFluidLoadable = \"handle\";\n // @ts-expect-error provider shouldn't have any non-provider properties\n useProviderKey<IFluidLoadable>(loadableKey);\n}\n\n// test implicit conversions between FluidObject and a FluidObject with a partial provider interface\n{\n interface IProvideFoo{\n IFoo: IFoo;\n }\n interface IFoo extends Partial<IProvideFoo>{\n doFoo();\n }\n\n const foo: FluidObject<IFoo> = getFluidObject();\n useFluidObject(foo);\n useFluidObject(foo.IFoo);\n useProvider(foo);\n useProvider(foo.IFoo);\n foo.IFoo?.doFoo();\n const fooKey: keyof IFoo = \"doFoo\";\n // @ts-expect-error provider shouldn't have any non-provider properties\n useProviderKey<IFoo>(fooKey);\n const unknown: FluidObject | undefined = foo.IFoo;\n useFluidObject(unknown);\n useProvider(unknown);\n useProvider<IFoo>(unknown);\n useLoadable(unknown);\n}\n\n// test implicit conversions between FluidObject and IFluidObject for backcompat\ndeclare function getIFluidObject(): IFluidObject;\n{\n const fluidObject: FluidObject = getIFluidObject();\n const legacy: IFluidObject = getFluidObject();\n useLoadable(fluidObject);\n useLoadable(legacy);\n useFluidObject(fluidObject);\n useFluidObject(legacy);\n useProvider(legacy);\n useProvider(fluidObject);\n useProvider<IFluidLoadable>(legacy);\n useProvider<IFluidLoadable>(fluidObject);\n}\n\n// validate nested property is FluidObject too\n{\n interface IFoo {\n z: { z: { z: boolean } };\n }\n\n const foo: FluidObject<IFoo> = getFluidObject();\n // @ts-expect-error \"Property 'z' does not exist on type 'FluidObject<IFoo>'.\"\n useProvider(foo.z);\n}\n\n// validate provider inheritance\n{\n interface IProvideFooParent{\n IFooParent: IFooParent\n }\n\n interface IFooParent extends Partial<IProvideFooParent>{\n parent();\n }\n\n interface IFooProvideChild {\n IFooChild: IFooChild\n }\n\n interface IFooChild extends IFooParent, Partial<IFooProvideChild>{\n child();\n }\n\n const p: FluidObject<IProvideFooParent> = getFluidObject();\n useProvider(p.IFooParent?.parent());\n\n const c: FluidObject<IFooProvideChild> = getFluidObject();\n // @ts-expect-error Property 'IFooParent' does not exist on type 'FluidObject<IFooProvideChild>'.\n useProvider(c.IFooParent?.parent());\n useProvider(c.IFooChild?.child());\n useProvider(c.IFooChild?.parent());\n useProvider(c.IFooChild?.IFooParent?.parent());\n}\n"]}
1
+ {"version":3,"file":"fluidObjectTypes.js","sourceR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AAW,CAAC,CAAC;IACzB,WAAW,CAAiB,MAAM,CAAC,CAAC;IACpC,WAAW,CAAiB,WAAW,CAAC,CAAC;CAC5C;AAED,8CAA8C;AAC9C;IAKI,MAAM,GAAG,GAAsB,cAAc,EAAE,CAAC;IAChD,8EAA8E;IAC9E,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACtB;AAED,gCAAgC;AAChC;IAiBI,MAAM,CAAC,GAAmC,cAAc,EAAE,CAAC;IAC3D,WAAW,OAAC,CAAC,CAAC,UAAU,0CAAE,MAAM,GAAG,CAAC;IAEpC,MAAM,CAAC,GAAkC,cAAc,EAAE,CAAC;IAC1D,iGAAiG;IACjG,WAAW,OAAC,CAAC,CAAC,UAAU,0CAAE,MAAM,GAAG,CAAC;IACpC,WAAW,OAAC,CAAC,CAAC,SAAS,0CAAE,KAAK,GAAG,CAAC;IAClC,WAAW,OAAC,CAAC,CAAC,SAAS,0CAAE,MAAM,GAAG,CAAC;IACnC,WAAW,aAAC,CAAC,CAAC,SAAS,0CAAE,UAAU,0CAAE,MAAM,GAAG,CAAC;CAClD;AAED,4BAA4B;AAC5B;IACI,MAAM,OAAO,GAAgC,EAAE,CAAC;IAChD,OAAO,CAAC,cAAc,GAAG,WAAW,EAAE,CAAC;CAC1C;AAED,0CAA0C;AAC1C;IACI,MAAM,OAAO,GAA0C,EAAE,CAAC;IAC1D,yFAAyF;IACzF,OAAO,CAAC,cAAc,GAAG,WAAW,EAAE,CAAC;CAC1C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IFluidLoadable, IProvideFluidLoadable, FluidObject, FluidObjectKeys, IFluidObject } from \"../../\";\n\ndeclare function getFluidObject(): FluidObject;\n\ndeclare function useFluidObject(params: FluidObject | undefined): void;\n\ndeclare function useProvider<T extends FluidObject>(params: FluidObject<T> | undefined): void;\n\ndeclare function useProviderKey<T,TKey extends FluidObjectKeys<T> = FluidObjectKeys<T>>(key: TKey): void;\n\ndeclare function useLoadable(params: FluidObject<IFluidLoadable> | undefined): void;\ndeclare function getLoadable(): IFluidLoadable;\n\ndeclare function use(obj: any);\n// test implicit conversions between FluidObject and a FluidObject with a provides interface\n{\n const provider: FluidObject<IProvideFluidLoadable> = getFluidObject();\n useFluidObject(provider);\n useFluidObject(provider.IFluidLoadable);\n useProvider(provider);\n useProvider(provider.IFluidLoadable);\n useLoadable(provider);\n useLoadable(provider.IFluidLoadable);\n // @ts-expect-error provider shouldn't have any non-provider properties\n use(provider.handle);\n use(provider.IFluidLoadable?.handle);\n const unknown: FluidObject | undefined = provider.IFluidLoadable;\n useFluidObject(unknown);\n useProvider(unknown);\n useProvider<IFluidLoadable>(unknown);\n useLoadable(unknown);\n}\n\n// test implicit conversions between FluidObject and a FluidObject with a implementation interface\n{\n const foo: FluidObject<IFluidLoadable> = getFluidObject();\n useFluidObject(foo);\n useFluidObject(foo.IFluidLoadable);\n useProvider(foo);\n useProvider(foo.IFluidLoadable);\n useLoadable(foo);\n useLoadable(foo.IFluidLoadable);\n // @ts-expect-error provider shouldn't have any non-provider properties\n use(foo.handle);\n use(foo.IFluidLoadable?.handle);\n const unknown: FluidObject | undefined = foo.IFluidLoadable;\n useFluidObject(unknown);\n useProvider(unknown);\n useProvider<IFluidLoadable>(unknown);\n useLoadable(unknown);\n}\n\n// test getting keys\n{\n useProviderKey<IProvideFluidLoadable>(IFluidLoadable);\n useProviderKey<IFluidLoadable>(IFluidLoadable);\n const loadableKey: keyof IFluidLoadable = \"handle\";\n // @ts-expect-error provider shouldn't have any non-provider properties\n useProviderKey<IFluidLoadable>(loadableKey);\n}\n\n// test implicit conversions between FluidObject and a FluidObject with a partial provider interface\n{\n interface IProvideFoo{\n IFoo: IFoo;\n }\n interface IFoo extends Partial<IProvideFoo>{\n doFoo();\n }\n\n const foo: FluidObject<IFoo> = getFluidObject();\n useFluidObject(foo);\n useFluidObject(foo.IFoo);\n useProvider(foo);\n useProvider(foo.IFoo);\n foo.IFoo?.doFoo();\n const fooKey: keyof IFoo = \"doFoo\";\n // @ts-expect-error provider shouldn't have any non-provider properties\n useProviderKey<IFoo>(fooKey);\n const unknown: FluidObject | undefined = foo.IFoo;\n useFluidObject(unknown);\n useProvider(unknown);\n useProvider<IFoo>(unknown);\n useLoadable(unknown);\n}\n\n// test implicit conversions between FluidObject and IFluidObject for backcompat\ndeclare function getIFluidObject(): IFluidObject;\n{\n const fluidObject: FluidObject = getIFluidObject();\n const legacy: IFluidObject = getFluidObject();\n useLoadable(fluidObject);\n useLoadable(legacy);\n useFluidObject(fluidObject);\n useFluidObject(legacy);\n useProvider(legacy);\n useProvider(fluidObject);\n useProvider<IFluidLoadable>(legacy);\n useProvider<IFluidLoadable>(fluidObject);\n}\n\n// validate nested property is FluidObject too\n{\n interface IFoo {\n z: { z: { z: boolean } };\n }\n\n const foo: FluidObject<IFoo> = getFluidObject();\n // @ts-expect-error \"Property 'z' does not exist on type 'FluidObject<IFoo>'.\"\n useProvider(foo.z);\n}\n\n// validate provider inheritance\n{\n interface IProvideFooParent{\n IFooParent: IFooParent\n }\n\n interface IFooParent extends Partial<IProvideFooParent>{\n parent();\n }\n\n interface IFooProvideChild {\n IFooChild: IFooChild\n }\n\n interface IFooChild extends IFooParent, Partial<IFooProvideChild>{\n child();\n }\n\n const p: FluidObject<IProvideFooParent> = getFluidObject();\n useProvider(p.IFooParent?.parent());\n\n const c: FluidObject<IFooProvideChild> = getFluidObject();\n // @ts-expect-error Property 'IFooParent' does not exist on type 'FluidObject<IFooProvideChild>'.\n useProvider(c.IFooParent?.parent());\n useProvider(c.IFooChild?.child());\n useProvider(c.IFooChild?.parent());\n useProvider(c.IFooChild?.IFooParent?.parent());\n}\n\n// validate usage as builder\n{\n const builder: FluidObject<IFluidLoadable> = {};\n builder.IFluidLoadable = getLoadable();\n}\n\n// validate readonly prevents modification\n{\n const builder: Readonly<FluidObject<IFluidLoadable>> = {};\n // @ts-expect-error Cannot assign to 'IFluidLoadable' because it is a read-only property.\n builder.IFluidLoadable = getLoadable();\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/core-interfaces",
3
- "version": "0.43.1000-60718",
3
+ "version": "0.43.1000-60792",
4
4
  "description": "Fluid object interfaces",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
package/src/provider.ts CHANGED
@@ -61,7 +61,7 @@
61
61
  *
62
62
  */
63
63
  export type FluidObject<T = unknown> = {
64
- readonly [P in FluidObjectProviderKeys<T>]?: T[P];
64
+ [P in FluidObjectProviderKeys<T>]?: T[P];
65
65
  };
66
66
 
67
67
  /**