@fluidframework/synthesize 0.58.2001 → 0.59.2000-61729

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.
@@ -65,7 +65,7 @@ class DependencyContainer {
65
65
  */
66
66
  getProvider(provider) {
67
67
  // this was removed, but some partners have trouble with back compat where they
68
- // use invalid patterns with IFluidObject and IFluidDependencySynthesizer
68
+ // use invalid patterns with FluidObject and IFluidDependencySynthesizer
69
69
  // this is just for back compat until those are removed
70
70
  if (this.has(provider)) {
71
71
  if (this.providers.has(provider)) {
@@ -1 +1 @@
1
- {"version":3,"file":"dependencyContainer.js","sourceRoot":"","sources":["../src/dependencyContainer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,+EAEuC;AAEvC;;;GAGG;AACH,MAAa,mBAAmB;IAK5B,YAAmB,GAAI,OAAoD;QAJ1D,cAAS,GAAG,IAAI,GAAG,EAAwC,CAAC;QAKzE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAoC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IAC5F,CAAC;IAJD,IAAW,2BAA2B,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAMzD;;;;;OAKG;IACI,QAAQ,CAAoC,IAAO,EAAE,QAA4C;QACpG,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,6CAA6C,IAAI,sBAAsB,CAAC,CAAC;SAC5F;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,IAAgB;QAC9B,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC1B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC/B;IACL,CAA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IAAI,CAAC,OAAO,EAAE;gBAC/B,yEAAyE;gBACzE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAA8C,CAAC;gBAClE,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CACzB,EAAE,EACF,EAAE,CAAC,CAAC;gBACR,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;gBAC3D,IAAI,UAAU,KAAK,SAAS,EAAE;oBAC1B,OAAO,UAAU,CAAC;iBACrB;aACJ;YACD,OAAO,SAAS,CAAC;SACpB;QAED,+EAA+E;QAC/E,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;YAChC,OAAO;gBACH,GAAG;oBACC,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;wBAC5C,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,yDAA2B,CAAC,CAAC;6BACpD,IAAI,CAAC,KAAK,EAAE,GAAG,EAAgB,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;6BAChD,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAG,CAAC,CAAC,CAAC,CAAC;qBAC5B;gBACL,CAAC;aACJ,CAAC;SACL;QACD,OAAO;YACC,GAAG;gBACC,IAAI,QAAQ,EAAE;oBACV,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;wBACxC,IAAI,CAAC,EAAE;4BACH,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;yBACf;oBACL,CAAC,CAAC,CAAC;iBACN;YACL,CAAC;SACJ,CAAC;IACV,CAAC;CACJ;AAnKD,kDAmKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n AsyncFluidObjectProvider,\n FluidObjectSymbolProvider,\n FluidObjectProvider,\n AsyncOptionalFluidObjectProvider,\n AsyncRequiredFluidObjectProvider,\n} from \"./types\";\nimport {\n IFluidDependencySynthesizer,\n} from \"./IFluidDependencySynthesizer\";\n\n/**\n * DependencyContainer is similar to a IoC Container. It takes providers and will\n * synthesize an object based on them when requested.\n */\nexport class DependencyContainer<TMap> implements IFluidDependencySynthesizer {\n private readonly providers = new Map<keyof TMap, FluidObjectProvider<any>>();\n private readonly parents: IFluidDependencySynthesizer[];\n public get IFluidDependencySynthesizer() { return this; }\n\n public constructor(... parents: (IFluidDependencySynthesizer | undefined)[]) {\n this.parents = parents.filter((v): v is IFluidDependencySynthesizer => v !== undefined);\n }\n\n /**\n * Add a new provider\n * @param type - Name of the Type T being provided\n * @param provider - A provider that will resolve the T correctly when asked\n * @throws - If passing a type that's already registered\n */\n public register<T extends keyof TMap = keyof TMap>(type: T, provider: FluidObjectProvider<Pick<TMap, T>>): void {\n if (this.providers.has(type)) {\n throw new Error(`Attempting to register a provider of type ${type} that already exists`);\n }\n\n this.providers.set(type, provider);\n }\n\n /**\n * Remove a provider\n * @param type - Name of the provider to remove\n */\n public unregister(type: keyof TMap): void {\n if (this.providers.has(type)) {\n this.providers.delete(type);\n }\n }\n\n /**\n * {@inheritDoc (IFluidDependencySynthesizer:interface).synthesize}\n */\n public synthesize<O, R = undefined | Record<string, never>>(\n optionalTypes: FluidObjectSymbolProvider<O>,\n requiredTypes: Required<FluidObjectSymbolProvider<R>>,\n ): AsyncFluidObjectProvider<O, R> {\n const base: AsyncFluidObjectProvider<O, R> = {} as any;\n this.generateRequired<R>(base, requiredTypes);\n this.generateOptional<O>(base, optionalTypes);\n Object.defineProperty(base, IFluidDependencySynthesizer, { get: () => this });\n return base;\n }\n\n /**\n * {@inheritDoc (IFluidDependencySynthesizer:interface).has}\n * @param excludeParents - If true, exclude checking parent registries\n */\n public has(type: string, excludeParents?: boolean): boolean {\n if (this.providers.has(type as keyof TMap)) {\n return true;\n }\n if (excludeParents !== true) {\n return this.parents.some((p: IFluidDependencySynthesizer) => p.has(type));\n }\n return false;\n }\n /**\n * @deprecated - Needed for back compat\n */\n private getProvider(provider: string & keyof TMap) {\n // this was removed, but some partners have trouble with back compat where they\n // use invalid patterns with IFluidObject and IFluidDependencySynthesizer\n // this is just for back compat until those are removed\n if(this.has(provider)) {\n if(this.providers.has(provider)) {\n return this.providers.get(provider);\n }\n for(const parent of this.parents) {\n if(parent instanceof DependencyContainer) {\n return parent.getProvider(provider);\n }else{\n // older implementations of the IFluidDependencySynthesizer exposed getProvider\n const maybeGetProvider: {getProvider?(provider: string & keyof TMap)} = parent as any;\n if(maybeGetProvider?.getProvider !== undefined) {\n return maybeGetProvider.getProvider(provider);\n }\n }\n }\n }\n }\n\n private generateRequired<T>(\n base: AsyncRequiredFluidObjectProvider<T>,\n types: Required<FluidObjectSymbolProvider<T>>,\n ) {\n if (types === undefined) { return; }\n for (const key of Object.keys(types) as unknown as (keyof TMap)[]) {\n const provider = this.resolveProvider(key);\n if(provider === undefined) {\n throw new Error(`Object attempted to be created without registered required provider ${key}`);\n }\n Object.defineProperty(\n base,\n key,\n provider,\n );\n }\n }\n\n private generateOptional<T>(\n base: AsyncOptionalFluidObjectProvider<T>,\n types: FluidObjectSymbolProvider<T>,\n ) {\n if (types === undefined) { return; }\n for (const key of Object.keys(types) as unknown as (keyof TMap)[]) {\n // back-compat: in 0.56 we allow undefined in the types, but we didn't before\n // this will keep runtime back compat, eventually we should support undefined properties\n // rather than properties that return promises that resolve to undefined\n const provider = this.resolveProvider(key) ?? { get: async () => undefined };\n Object.defineProperty(\n base,\n key,\n provider,\n );\n }\n }\n\n private resolveProvider<T extends keyof TMap>(t: T): PropertyDescriptor | undefined {\n // If we have the provider return it\n const provider = this.providers.get(t);\n if (provider === undefined) {\n for (const parent of this.parents) {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n const sp = { [t]: t } as FluidObjectSymbolProvider<Pick<TMap, T>>;\n const syn = parent.synthesize<Pick<TMap, T>,{}>(\n sp,\n {});\n const descriptor = Object.getOwnPropertyDescriptor(syn, t);\n if (descriptor !== undefined) {\n return descriptor;\n }\n }\n return undefined;\n }\n\n // The double nested gets are required for lazy loading the provider resolution\n if (typeof provider === \"function\") {\n return {\n get() {\n if (provider && typeof provider === \"function\") {\n return Promise.resolve(this[IFluidDependencySynthesizer])\n .then(async (fds): Promise<any> => provider(fds))\n .then((p) => p?.[t]);\n }\n },\n };\n }\n return {\n get() {\n if (provider) {\n return Promise.resolve(provider).then((p) => {\n if (p) {\n return p[t];\n }\n });\n }\n },\n };\n }\n}\n"]}
1
+ {"version":3,"file":"dependencyContainer.js","sourceRoot":"","sources":["../src/dependencyContainer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,+EAEuC;AAEvC;;;GAGG;AACH,MAAa,mBAAmB;IAK5B,YAAmB,GAAI,OAAoD;QAJ1D,cAAS,GAAG,IAAI,GAAG,EAAwC,CAAC;QAKzE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAoC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IAC5F,CAAC;IAJD,IAAW,2BAA2B,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAMzD;;;;;OAKG;IACI,QAAQ,CAAoC,IAAO,EAAE,QAA4C;QACpG,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,6CAA6C,IAAI,sBAAsB,CAAC,CAAC;SAC5F;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,IAAgB;QAC9B,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC1B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC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MAAM,IAAI,IAAI,CAAC,OAAO,EAAE;gBAC/B,yEAAyE;gBACzE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAA8C,CAAC;gBAClE,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CACzB,EAAE,EACF,EAAE,CAAC,CAAC;gBACR,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;gBAC3D,IAAI,UAAU,KAAK,SAAS,EAAE;oBAC1B,OAAO,UAAU,CAAC;iBACrB;aACJ;YACD,OAAO,SAAS,CAAC;SACpB;QAED,+EAA+E;QAC/E,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;YAChC,OAAO;gBACH,GAAG;oBACC,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;wBAC5C,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,yDAA2B,CAAC,CAAC;6BACpD,IAAI,CAAC,KAAK,EAAE,GAAG,EAAgB,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;6BAChD,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAG,CAAC,CAAC,CAAC,CAAC;qBAC5B;gBACL,CAAC;aACJ,CAAC;SACL;QACD,OAAO;YACC,GAAG;gBACC,IAAI,QAAQ,EAAE;oBACV,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;wBACxC,IAAI,CAAC,EAAE;4BACH,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;yBACf;oBACL,CAAC,CAAC,CAAC;iBACN;YACL,CAAC;SACJ,CAAC;IACV,CAAC;CACJ;AAnKD,kDAmKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n AsyncFluidObjectProvider,\n FluidObjectSymbolProvider,\n FluidObjectProvider,\n AsyncOptionalFluidObjectProvider,\n AsyncRequiredFluidObjectProvider,\n} from \"./types\";\nimport {\n IFluidDependencySynthesizer,\n} from \"./IFluidDependencySynthesizer\";\n\n/**\n * DependencyContainer is similar to a IoC Container. It takes providers and will\n * synthesize an object based on them when requested.\n */\nexport class DependencyContainer<TMap> implements IFluidDependencySynthesizer {\n private readonly providers = new Map<keyof TMap, FluidObjectProvider<any>>();\n private readonly parents: IFluidDependencySynthesizer[];\n public get IFluidDependencySynthesizer() { return this; }\n\n public constructor(... parents: (IFluidDependencySynthesizer | undefined)[]) {\n this.parents = parents.filter((v): v is IFluidDependencySynthesizer => v !== undefined);\n }\n\n /**\n * Add a new provider\n * @param type - Name of the Type T being provided\n * @param provider - A provider that will resolve the T correctly when asked\n * @throws - If passing a type that's already registered\n */\n public register<T extends keyof TMap = keyof TMap>(type: T, provider: FluidObjectProvider<Pick<TMap, T>>): void {\n if (this.providers.has(type)) {\n throw new Error(`Attempting to register a provider of type ${type} that already exists`);\n }\n\n this.providers.set(type, provider);\n }\n\n /**\n * Remove a provider\n * @param type - Name of the provider to remove\n */\n public unregister(type: keyof TMap): void {\n if (this.providers.has(type)) {\n this.providers.delete(type);\n }\n }\n\n /**\n * {@inheritDoc (IFluidDependencySynthesizer:interface).synthesize}\n */\n public synthesize<O, R = undefined | Record<string, never>>(\n optionalTypes: FluidObjectSymbolProvider<O>,\n requiredTypes: Required<FluidObjectSymbolProvider<R>>,\n ): AsyncFluidObjectProvider<O, R> {\n const base: AsyncFluidObjectProvider<O, R> = {} as any;\n this.generateRequired<R>(base, requiredTypes);\n this.generateOptional<O>(base, optionalTypes);\n Object.defineProperty(base, IFluidDependencySynthesizer, { get: () => this });\n return base;\n }\n\n /**\n * {@inheritDoc (IFluidDependencySynthesizer:interface).has}\n * @param excludeParents - If true, exclude checking parent registries\n */\n public has(type: string, excludeParents?: boolean): boolean {\n if (this.providers.has(type as keyof TMap)) {\n return true;\n }\n if (excludeParents !== true) {\n return this.parents.some((p: IFluidDependencySynthesizer) => p.has(type));\n }\n return false;\n }\n /**\n * @deprecated - Needed for back compat\n */\n private getProvider(provider: string & keyof TMap) {\n // this was removed, but some partners have trouble with back compat where they\n // use invalid patterns with FluidObject and IFluidDependencySynthesizer\n // this is just for back compat until those are removed\n if(this.has(provider)) {\n if(this.providers.has(provider)) {\n return this.providers.get(provider);\n }\n for(const parent of this.parents) {\n if(parent instanceof DependencyContainer) {\n return parent.getProvider(provider);\n }else{\n // older implementations of the IFluidDependencySynthesizer exposed getProvider\n const maybeGetProvider: {getProvider?(provider: string & keyof TMap)} = parent as any;\n if(maybeGetProvider?.getProvider !== undefined) {\n return maybeGetProvider.getProvider(provider);\n }\n }\n }\n }\n }\n\n private generateRequired<T>(\n base: AsyncRequiredFluidObjectProvider<T>,\n types: Required<FluidObjectSymbolProvider<T>>,\n ) {\n if (types === undefined) { return; }\n for (const key of Object.keys(types) as unknown as (keyof TMap)[]) {\n const provider = this.resolveProvider(key);\n if(provider === undefined) {\n throw new Error(`Object attempted to be created without registered required provider ${key}`);\n }\n Object.defineProperty(\n base,\n key,\n provider,\n );\n }\n }\n\n private generateOptional<T>(\n base: AsyncOptionalFluidObjectProvider<T>,\n types: FluidObjectSymbolProvider<T>,\n ) {\n if (types === undefined) { return; }\n for (const key of Object.keys(types) as unknown as (keyof TMap)[]) {\n // back-compat: in 0.56 we allow undefined in the types, but we didn't before\n // this will keep runtime back compat, eventually we should support undefined properties\n // rather than properties that return promises that resolve to undefined\n const provider = this.resolveProvider(key) ?? { get: async () => undefined };\n Object.defineProperty(\n base,\n key,\n provider,\n );\n }\n }\n\n private resolveProvider<T extends keyof TMap>(t: T): PropertyDescriptor | undefined {\n // If we have the provider return it\n const provider = this.providers.get(t);\n if (provider === undefined) {\n for (const parent of this.parents) {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n const sp = { [t]: t } as FluidObjectSymbolProvider<Pick<TMap, T>>;\n const syn = parent.synthesize<Pick<TMap, T>, Record<string, unknown>>(\n sp,\n {});\n const descriptor = Object.getOwnPropertyDescriptor(syn, t);\n if (descriptor !== undefined) {\n return descriptor;\n }\n }\n return undefined;\n }\n\n // The double nested gets are required for lazy loading the provider resolution\n if (typeof provider === \"function\") {\n return {\n get() {\n if (provider && typeof provider === \"function\") {\n return Promise.resolve(this[IFluidDependencySynthesizer])\n .then(async (fds): Promise<any> => provider(fds))\n .then((p) => p?.[t]);\n }\n },\n };\n }\n return {\n get() {\n if (provider) {\n return Promise.resolve(provider).then((p) => {\n if (p) {\n return p[t];\n }\n });\n }\n },\n };\n }\n}\n"]}
@@ -152,18 +152,18 @@
152
152
  "affectsGlobalScope": false
153
153
  },
154
154
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/provider.d.ts": {
155
- "version": "bc7c554f306ede38ac8d2c79c8325320a596f8331c008032cc5fc87626d9c0b9",
156
- "signature": "bc7c554f306ede38ac8d2c79c8325320a596f8331c008032cc5fc87626d9c0b9",
155
+ "version": "ffe2fe2824ad18643c67bdea603c0b13ce0b8e03fcedd7e830c3621e7495b8e4",
156
+ "signature": "ffe2fe2824ad18643c67bdea603c0b13ce0b8e03fcedd7e830c3621e7495b8e4",
157
157
  "affectsGlobalScope": false
158
158
  },
159
159
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/handles.d.ts": {
160
- "version": "a2228831e5efcba6c26dfd52c63d279e88d626c72e58cbd9b0d08a34b267ebf2",
161
- "signature": "a2228831e5efcba6c26dfd52c63d279e88d626c72e58cbd9b0d08a34b267ebf2",
160
+ "version": "008b0f774aa53fadf66f518d63e53df8a1bb6389908ac361895f3acae06159df",
161
+ "signature": "008b0f774aa53fadf66f518d63e53df8a1bb6389908ac361895f3acae06159df",
162
162
  "affectsGlobalScope": false
163
163
  },
164
164
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts": {
165
- "version": "4e9d111924468ed4547451e4962457ec18ad69ef965311681d1272bfd352e9f9",
166
- "signature": "4e9d111924468ed4547451e4962457ec18ad69ef965311681d1272bfd352e9f9",
165
+ "version": "8692a1ed3a979fa000b62e01f8d33cf940e030b7af50945176428f9cdd4dca80",
166
+ "signature": "8692a1ed3a979fa000b62e01f8d33cf940e030b7af50945176428f9cdd4dca80",
167
167
  "affectsGlobalScope": false
168
168
  },
169
169
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/serializer.d.ts": {
@@ -172,8 +172,8 @@
172
172
  "affectsGlobalScope": false
173
173
  },
174
174
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts": {
175
- "version": "62c426ebd149e87125813c604d9a6a1addb45ccd73f0e7fcc24181e8bd6e51cf",
176
- "signature": "62c426ebd149e87125813c604d9a6a1addb45ccd73f0e7fcc24181e8bd6e51cf",
175
+ "version": "4de717c31e6a926ab75d60b15881fcb86eedfe4c86a10ecc7bcbb132b704ec25",
176
+ "signature": "4de717c31e6a926ab75d60b15881fcb86eedfe4c86a10ecc7bcbb132b704ec25",
177
177
  "affectsGlobalScope": false
178
178
  },
179
179
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidPackage.d.ts": {
@@ -457,8 +457,8 @@
457
457
  "affectsGlobalScope": false
458
458
  },
459
459
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/storage.d.ts": {
460
- "version": "efcdf8d3587b6d332ee9e4098822b5421100849eabf5efbdf8c2736ae6975c8d",
461
- "signature": "efcdf8d3587b6d332ee9e4098822b5421100849eabf5efbdf8c2736ae6975c8d",
460
+ "version": "400b71c3fd22577b532c14206b3e39f1cd13d7222e12a23f18253b1a8a573efc",
461
+ "signature": "400b71c3fd22577b532c14206b3e39f1cd13d7222e12a23f18253b1a8a573efc",
462
462
  "affectsGlobalScope": false
463
463
  },
464
464
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/summary.d.ts": {
@@ -491,9 +491,14 @@
491
491
  "signature": "383dced3ebba2967eeab64d0b7facd4529fe3ed2c352744f3f6c1988482206d4",
492
492
  "affectsGlobalScope": false
493
493
  },
494
+ "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts": {
495
+ "version": "29af84fd868f666a8d2b0766b188faed869babeb3da5c556fc1151cc4e1e5153",
496
+ "signature": "29af84fd868f666a8d2b0766b188faed869babeb3da5c556fc1151cc4e1e5153",
497
+ "affectsGlobalScope": false
498
+ },
494
499
  "../../../../../node_modules/@fluidframework/container-definitions/dist/browserPackage.d.ts": {
495
- "version": "3eaa82d284d2ecf646a9f84e79269ec4505c0491876a9fd07f0cd7b5827f7df9",
496
- "signature": "3eaa82d284d2ecf646a9f84e79269ec4505c0491876a9fd07f0cd7b5827f7df9",
500
+ "version": "5a6da0fe8e8896c8f05057396d825d36506a1527de189150cf4d8dea3e794239",
501
+ "signature": "5a6da0fe8e8896c8f05057396d825d36506a1527de189150cf4d8dea3e794239",
497
502
  "affectsGlobalScope": false
498
503
  },
499
504
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/driverError.d.ts": {
@@ -501,14 +506,54 @@
501
506
  "signature": "9c35bf4f305ed653f657ebe97ced739b0778fab04b76268d4adcac72f279b242",
502
507
  "affectsGlobalScope": false
503
508
  },
509
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts": {
510
+ "version": "766d8c595f94c9fe9dbb779b60d7a4d6d7a6526ef22090ccedbc658c2d8c77e0",
511
+ "signature": "766d8c595f94c9fe9dbb779b60d7a4d6d7a6526ef22090ccedbc658c2d8c77e0",
512
+ "affectsGlobalScope": false
513
+ },
514
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/provider.d.ts": {
515
+ "version": "bc7c554f306ede38ac8d2c79c8325320a596f8331c008032cc5fc87626d9c0b9",
516
+ "signature": "bc7c554f306ede38ac8d2c79c8325320a596f8331c008032cc5fc87626d9c0b9",
517
+ "affectsGlobalScope": false
518
+ },
519
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/handles.d.ts": {
520
+ "version": "a2228831e5efcba6c26dfd52c63d279e88d626c72e58cbd9b0d08a34b267ebf2",
521
+ "signature": "a2228831e5efcba6c26dfd52c63d279e88d626c72e58cbd9b0d08a34b267ebf2",
522
+ "affectsGlobalScope": false
523
+ },
524
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts": {
525
+ "version": "4e9d111924468ed4547451e4962457ec18ad69ef965311681d1272bfd352e9f9",
526
+ "signature": "4e9d111924468ed4547451e4962457ec18ad69ef965311681d1272bfd352e9f9",
527
+ "affectsGlobalScope": false
528
+ },
529
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/serializer.d.ts": {
530
+ "version": "9d1f552cc6eb78389d10237e3c61d114b9681f5098c3fc594436e7d448afe55b",
531
+ "signature": "9d1f552cc6eb78389d10237e3c61d114b9681f5098c3fc594436e7d448afe55b",
532
+ "affectsGlobalScope": false
533
+ },
534
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts": {
535
+ "version": "62c426ebd149e87125813c604d9a6a1addb45ccd73f0e7fcc24181e8bd6e51cf",
536
+ "signature": "62c426ebd149e87125813c604d9a6a1addb45ccd73f0e7fcc24181e8bd6e51cf",
537
+ "affectsGlobalScope": false
538
+ },
539
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidPackage.d.ts": {
540
+ "version": "970e1154a10ec841ea6a3f2605044a65e2261bb953f3b72a1ca1faa480c697f8",
541
+ "signature": "970e1154a10ec841ea6a3f2605044a65e2261bb953f3b72a1ca1faa480c697f8",
542
+ "affectsGlobalScope": false
543
+ },
544
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/index.d.ts": {
545
+ "version": "398cf7701e7ebd8094e625fff1ba84c2b97a23aefe2ea135f0b47df0a58cf465",
546
+ "signature": "398cf7701e7ebd8094e625fff1ba84c2b97a23aefe2ea135f0b47df0a58cf465",
547
+ "affectsGlobalScope": false
548
+ },
504
549
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/urlResolver.d.ts": {
505
550
  "version": "fb75519ad714b609817f371b9e3fca4f02e2302d50bb84a3e8e9ba6ba233ce3d",
506
551
  "signature": "fb75519ad714b609817f371b9e3fca4f02e2302d50bb84a3e8e9ba6ba233ce3d",
507
552
  "affectsGlobalScope": false
508
553
  },
509
554
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/storage.d.ts": {
510
- "version": "dc51da03872a900f82db416a294523a0d37f4be324e1fd9d69c20856f01604e8",
511
- "signature": "dc51da03872a900f82db416a294523a0d37f4be324e1fd9d69c20856f01604e8",
555
+ "version": "23333bf4703c216fc9707c31b1c80d913f0dcbb66b2603011a399c5bc517cc84",
556
+ "signature": "23333bf4703c216fc9707c31b1c80d913f0dcbb66b2603011a399c5bc517cc84",
512
557
  "affectsGlobalScope": false
513
558
  },
514
559
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/index.d.ts": {
@@ -527,18 +572,18 @@
527
572
  "affectsGlobalScope": false
528
573
  },
529
574
  "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts": {
530
- "version": "fd64a9d2be496b6b5831ed862a5828906f4821f109a8bc7e5c20d340942a6c2a",
531
- "signature": "fd64a9d2be496b6b5831ed862a5828906f4821f109a8bc7e5c20d340942a6c2a",
575
+ "version": "8023ac345236d4f16563d8dee36b7db6a3b58d2d478c2de674cbd70ce0249737",
576
+ "signature": "8023ac345236d4f16563d8dee36b7db6a3b58d2d478c2de674cbd70ce0249737",
532
577
  "affectsGlobalScope": false
533
578
  },
534
579
  "../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts": {
535
- "version": "34c3d5cfa7f01c2c116a0db84b92c0b3bc598cb282bb230b1df4a9a525519207",
536
- "signature": "34c3d5cfa7f01c2c116a0db84b92c0b3bc598cb282bb230b1df4a9a525519207",
580
+ "version": "4427d0a7919b0ecf1fc78cb51e48ff8de72e41a41c5f13489e55470a2f7b7995",
581
+ "signature": "4427d0a7919b0ecf1fc78cb51e48ff8de72e41a41c5f13489e55470a2f7b7995",
537
582
  "affectsGlobalScope": false
538
583
  },
539
584
  "../../../../../node_modules/@fluidframework/container-definitions/dist/runtime.d.ts": {
540
- "version": "d354a98d9977074408d68db0d291fe988584eeddc8cc6a211f45a4c1a245e944",
541
- "signature": "d354a98d9977074408d68db0d291fe988584eeddc8cc6a211f45a4c1a245e944",
585
+ "version": "597fef4eabc67556e36afaefae4d924153cd3dace784f44529891dffda5abe7e",
586
+ "signature": "597fef4eabc67556e36afaefae4d924153cd3dace784f44529891dffda5abe7e",
542
587
  "affectsGlobalScope": false
543
588
  },
544
589
  "../../../../../node_modules/@fluidframework/container-definitions/dist/legacy/index.d.ts": {
@@ -546,11 +591,6 @@
546
591
  "signature": "419d3554e67aed44fbad75878a168ec530032ea11a2572c769e98d15b91cad81",
547
592
  "affectsGlobalScope": false
548
593
  },
549
- "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts": {
550
- "version": "29af84fd868f666a8d2b0766b188faed869babeb3da5c556fc1151cc4e1e5153",
551
- "signature": "29af84fd868f666a8d2b0766b188faed869babeb3da5c556fc1151cc4e1e5153",
552
- "affectsGlobalScope": false
553
- },
554
594
  "../../../../../node_modules/@fluidframework/container-definitions/dist/proxyLoader.d.ts": {
555
595
  "version": "0ee40e5e446be73c62334a574d628dac014b292699bca2527d2abb99b8e31bf9",
556
596
  "signature": "0ee40e5e446be73c62334a574d628dac014b292699bca2527d2abb99b8e31bf9",
@@ -707,8 +747,8 @@
707
747
  "affectsGlobalScope": false
708
748
  },
709
749
  "../../../../runtime/runtime-definitions/dist/dataStoreContext.d.ts": {
710
- "version": "e51deb6147caefb48bf6079266b51eae164a6e770ff47945464cbdf20a74ce70",
711
- "signature": "e51deb6147caefb48bf6079266b51eae164a6e770ff47945464cbdf20a74ce70",
750
+ "version": "2137a49910486c5f9a6a028bc19d2afbbfc147885e46ebcb434d1ecb24983821",
751
+ "signature": "2137a49910486c5f9a6a028bc19d2afbbfc147885e46ebcb434d1ecb24983821",
712
752
  "affectsGlobalScope": false
713
753
  },
714
754
  "../../../../runtime/runtime-definitions/dist/dataStoreFactory.d.ts": {
@@ -752,13 +792,13 @@
752
792
  "affectsGlobalScope": false
753
793
  },
754
794
  "../../../../runtime/datastore/dist/dataStoreRuntime.d.ts": {
755
- "version": "08109e06a36fb9219bb0de1d0879eef2f7d42a92aa5fb585b80775259fa09316",
756
- "signature": "08109e06a36fb9219bb0de1d0879eef2f7d42a92aa5fb585b80775259fa09316",
795
+ "version": "0161b59129dab096029007e9bb4eb287d6aafe5131943bd99ffbe942df0cb312",
796
+ "signature": "0161b59129dab096029007e9bb4eb287d6aafe5131943bd99ffbe942df0cb312",
757
797
  "affectsGlobalScope": false
758
798
  },
759
799
  "../../../../runtime/datastore/dist/fluidHandle.d.ts": {
760
- "version": "0db40fc64ac6d6c6601fc83f29439e9b81c487c39e34ae18503582b39323fd39",
761
- "signature": "0db40fc64ac6d6c6601fc83f29439e9b81c487c39e34ae18503582b39323fd39",
800
+ "version": "fa2391e2793c9deed82cbdc69ca6ec910498b73d02aefd1fbce7080a69ec3eef",
801
+ "signature": "fa2391e2793c9deed82cbdc69ca6ec910498b73d02aefd1fbce7080a69ec3eef",
762
802
  "affectsGlobalScope": false
763
803
  },
764
804
  "../../../../runtime/datastore/dist/index.d.ts": {
@@ -767,8 +807,8 @@
767
807
  "affectsGlobalScope": false
768
808
  },
769
809
  "../types.d.ts": {
770
- "version": "461180d6ff91eb3902b1a5fa34185327d785e059fdc52ad2fe2b0a16c0960489",
771
- "signature": "461180d6ff91eb3902b1a5fa34185327d785e059fdc52ad2fe2b0a16c0960489",
810
+ "version": "0019f06f88e66fa5371d8eebb0e81dc749e54a8f65f8ec9b59760c77e759e46e",
811
+ "signature": "0019f06f88e66fa5371d8eebb0e81dc749e54a8f65f8ec9b59760c77e759e46e",
772
812
  "affectsGlobalScope": false
773
813
  },
774
814
  "../IFluidDependencySynthesizer.d.ts": {
@@ -791,6 +831,31 @@
791
831
  "signature": "abc949a48872f03572ff3108a999c28e5e394296186194fa9e4ad357fa3cfcd7",
792
832
  "affectsGlobalScope": false
793
833
  },
834
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/types.d.ts": {
835
+ "version": "461180d6ff91eb3902b1a5fa34185327d785e059fdc52ad2fe2b0a16c0960489",
836
+ "signature": "461180d6ff91eb3902b1a5fa34185327d785e059fdc52ad2fe2b0a16c0960489",
837
+ "affectsGlobalScope": false
838
+ },
839
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/IFluidDependencySynthesizer.d.ts": {
840
+ "version": "a15809b8be1e3dd5a4f89df2886c9609eff56afa7b5e262adae346dc81d80a19",
841
+ "signature": "a15809b8be1e3dd5a4f89df2886c9609eff56afa7b5e262adae346dc81d80a19",
842
+ "affectsGlobalScope": false
843
+ },
844
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/dependencyContainer.d.ts": {
845
+ "version": "abbf5a289e8fbe488cf30a8024ebb89cafa6ab47277ffe735ce2dd18fe1ca107",
846
+ "signature": "abbf5a289e8fbe488cf30a8024ebb89cafa6ab47277ffe735ce2dd18fe1ca107",
847
+ "affectsGlobalScope": false
848
+ },
849
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/index.d.ts": {
850
+ "version": "48010a1e04aff055895b4d95949566d9cd43f356bf1d989548dcbe34b07e0702",
851
+ "signature": "48010a1e04aff055895b4d95949566d9cd43f356bf1d989548dcbe34b07e0702",
852
+ "affectsGlobalScope": false
853
+ },
854
+ "../../src/test/types/validateSynthesizePrevious.ts": {
855
+ "version": "a468afb6b7ceb12b0f43c2c7ec6b299188f150e68e1c3f9f24dacf7418502bf6",
856
+ "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
857
+ "affectsGlobalScope": false
858
+ },
794
859
  "../../../../../node_modules/@types/mocha/index.d.ts": {
795
860
  "version": "5f186a758a616c107c70e8918db4630d063bd782f22e6e0b17573b125765b40b",
796
861
  "signature": "5f186a758a616c107c70e8918db4630d063bd782f22e6e0b17573b125765b40b",
@@ -887,20 +952,20 @@
887
952
  "../../../../../node_modules/@types/node/index.d.ts"
888
953
  ],
889
954
  "../../../../../node_modules/@fluidframework/container-definitions/dist/browserPackage.d.ts": [
890
- "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
955
+ "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts"
891
956
  ],
892
957
  "../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts": [
893
958
  "../../../../../node_modules/@fluidframework/common-definitions/dist/index.d.ts",
894
959
  "../../../../../node_modules/@fluidframework/container-definitions/dist/legacy/index.d.ts",
895
960
  "../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts",
896
961
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts",
897
- "../../../../../node_modules/@fluidframework/driver-definitions/dist/urlResolver.d.ts",
898
962
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/index.d.ts"
899
963
  ],
900
964
  "../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts": [
901
965
  "../../../../../node_modules/@fluidframework/common-definitions/dist/index.d.ts"
902
966
  ],
903
967
  "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts": [
968
+ "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts",
904
969
  "../../../../../node_modules/@fluidframework/container-definitions/dist/runtime.d.ts",
905
970
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
906
971
  ],
@@ -920,8 +985,7 @@
920
985
  "../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
921
986
  "../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts",
922
987
  "../../../../../node_modules/@fluidframework/container-definitions/dist/runtime.d.ts",
923
- "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts",
924
- "../../../../../node_modules/@fluidframework/driver-definitions/dist/urlResolver.d.ts"
988
+ "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
925
989
  ],
926
990
  "../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts": [
927
991
  "../../../../../node_modules/@fluidframework/common-definitions/dist/index.d.ts",
@@ -929,11 +993,11 @@
929
993
  "../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
930
994
  "../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts",
931
995
  "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts",
996
+ "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts",
932
997
  "../../../../../node_modules/@fluidframework/container-definitions/dist/legacy/index.d.ts",
933
998
  "../../../../../node_modules/@fluidframework/container-definitions/dist/runtime.d.ts",
934
999
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts",
935
1000
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/index.d.ts",
936
- "../../../../../node_modules/@fluidframework/driver-definitions/dist/urlResolver.d.ts",
937
1001
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/index.d.ts"
938
1002
  ],
939
1003
  "../../../../../node_modules/@fluidframework/container-definitions/dist/proxyLoader.d.ts": [
@@ -945,6 +1009,7 @@
945
1009
  "../../../../../node_modules/@fluidframework/container-definitions/dist/audience.d.ts",
946
1010
  "../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
947
1011
  "../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts",
1012
+ "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts",
948
1013
  "../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts",
949
1014
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts",
950
1015
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/index.d.ts",
@@ -961,7 +1026,6 @@
961
1026
  ],
962
1027
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/handles.d.ts": [
963
1028
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
964
- "../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts",
965
1029
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts",
966
1030
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/provider.d.ts"
967
1031
  ],
@@ -988,10 +1052,34 @@
988
1052
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/index.d.ts"
989
1053
  ],
990
1054
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/urlResolver.d.ts": [
991
- "../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
992
- "../../../../../node_modules/@fluidframework/container-definitions/dist/legacy/index.d.ts",
993
- "../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts",
994
- "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
1055
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
1056
+ ],
1057
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts": [
1058
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/handles.d.ts"
1059
+ ],
1060
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts": [
1061
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
1062
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts",
1063
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/handles.d.ts",
1064
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/serializer.d.ts"
1065
+ ],
1066
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/handles.d.ts": [
1067
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
1068
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts",
1069
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts",
1070
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/provider.d.ts"
1071
+ ],
1072
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/index.d.ts": [
1073
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
1074
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts",
1075
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidPackage.d.ts",
1076
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts",
1077
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/handles.d.ts",
1078
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/provider.d.ts",
1079
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/serializer.d.ts"
1080
+ ],
1081
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/serializer.d.ts": [
1082
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/handles.d.ts"
995
1083
  ],
996
1084
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/clients.d.ts": [
997
1085
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/users.d.ts"
@@ -1021,6 +1109,21 @@
1021
1109
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/tokens.d.ts": [
1022
1110
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/users.d.ts"
1023
1111
  ],
1112
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/IFluidDependencySynthesizer.d.ts": [
1113
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/types.d.ts"
1114
+ ],
1115
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/dependencyContainer.d.ts": [
1116
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/IFluidDependencySynthesizer.d.ts",
1117
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/types.d.ts"
1118
+ ],
1119
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/index.d.ts": [
1120
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/IFluidDependencySynthesizer.d.ts",
1121
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/dependencyContainer.d.ts",
1122
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/types.d.ts"
1123
+ ],
1124
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/types.d.ts": [
1125
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/index.d.ts"
1126
+ ],
1024
1127
  "../../../../../node_modules/@types/node/assert.d.ts": [
1025
1128
  "../../../../../node_modules/@types/node/assert.d.ts"
1026
1129
  ],
@@ -1269,6 +1372,10 @@
1269
1372
  "../index.d.ts",
1270
1373
  "../types.d.ts"
1271
1374
  ],
1375
+ "../../src/test/types/validateSynthesizePrevious.ts": [
1376
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/index.d.ts",
1377
+ "../index.d.ts"
1378
+ ],
1272
1379
  "../../../../runtime/datastore-definitions/dist/channel.d.ts": [
1273
1380
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts",
1274
1381
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/index.d.ts",
@@ -1406,20 +1513,20 @@
1406
1513
  "../../../../../node_modules/@types/node/index.d.ts"
1407
1514
  ],
1408
1515
  "../../../../../node_modules/@fluidframework/container-definitions/dist/browserPackage.d.ts": [
1409
- "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
1516
+ "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts"
1410
1517
  ],
1411
1518
  "../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts": [
1412
1519
  "../../../../../node_modules/@fluidframework/common-definitions/dist/index.d.ts",
1413
1520
  "../../../../../node_modules/@fluidframework/container-definitions/dist/legacy/index.d.ts",
1414
1521
  "../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts",
1415
1522
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts",
1416
- "../../../../../node_modules/@fluidframework/driver-definitions/dist/urlResolver.d.ts",
1417
1523
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/index.d.ts"
1418
1524
  ],
1419
1525
  "../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts": [
1420
1526
  "../../../../../node_modules/@fluidframework/common-definitions/dist/index.d.ts"
1421
1527
  ],
1422
1528
  "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts": [
1529
+ "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts",
1423
1530
  "../../../../../node_modules/@fluidframework/container-definitions/dist/runtime.d.ts",
1424
1531
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
1425
1532
  ],
@@ -1439,8 +1546,7 @@
1439
1546
  "../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
1440
1547
  "../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts",
1441
1548
  "../../../../../node_modules/@fluidframework/container-definitions/dist/runtime.d.ts",
1442
- "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts",
1443
- "../../../../../node_modules/@fluidframework/driver-definitions/dist/urlResolver.d.ts"
1549
+ "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
1444
1550
  ],
1445
1551
  "../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts": [
1446
1552
  "../../../../../node_modules/@fluidframework/common-definitions/dist/index.d.ts",
@@ -1448,11 +1554,11 @@
1448
1554
  "../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
1449
1555
  "../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts",
1450
1556
  "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts",
1557
+ "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts",
1451
1558
  "../../../../../node_modules/@fluidframework/container-definitions/dist/legacy/index.d.ts",
1452
1559
  "../../../../../node_modules/@fluidframework/container-definitions/dist/runtime.d.ts",
1453
1560
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts",
1454
1561
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/index.d.ts",
1455
- "../../../../../node_modules/@fluidframework/driver-definitions/dist/urlResolver.d.ts",
1456
1562
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/index.d.ts"
1457
1563
  ],
1458
1564
  "../../../../../node_modules/@fluidframework/container-definitions/dist/proxyLoader.d.ts": [
@@ -1464,6 +1570,7 @@
1464
1570
  "../../../../../node_modules/@fluidframework/container-definitions/dist/audience.d.ts",
1465
1571
  "../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
1466
1572
  "../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts",
1573
+ "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts",
1467
1574
  "../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts",
1468
1575
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts",
1469
1576
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/index.d.ts",
@@ -1480,7 +1587,6 @@
1480
1587
  ],
1481
1588
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/handles.d.ts": [
1482
1589
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
1483
- "../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts",
1484
1590
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts",
1485
1591
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/provider.d.ts"
1486
1592
  ],
@@ -1507,10 +1613,34 @@
1507
1613
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/index.d.ts"
1508
1614
  ],
1509
1615
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/urlResolver.d.ts": [
1510
- "../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
1511
- "../../../../../node_modules/@fluidframework/container-definitions/dist/legacy/index.d.ts",
1512
- "../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts",
1513
- "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
1616
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
1617
+ ],
1618
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts": [
1619
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/handles.d.ts"
1620
+ ],
1621
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts": [
1622
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
1623
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts",
1624
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/handles.d.ts",
1625
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/serializer.d.ts"
1626
+ ],
1627
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/handles.d.ts": [
1628
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
1629
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts",
1630
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts",
1631
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/provider.d.ts"
1632
+ ],
1633
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/index.d.ts": [
1634
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
1635
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts",
1636
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidPackage.d.ts",
1637
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts",
1638
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/handles.d.ts",
1639
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/provider.d.ts",
1640
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/serializer.d.ts"
1641
+ ],
1642
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/serializer.d.ts": [
1643
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/handles.d.ts"
1514
1644
  ],
1515
1645
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/clients.d.ts": [
1516
1646
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/users.d.ts"
@@ -1540,6 +1670,21 @@
1540
1670
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/tokens.d.ts": [
1541
1671
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/users.d.ts"
1542
1672
  ],
1673
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/IFluidDependencySynthesizer.d.ts": [
1674
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/types.d.ts"
1675
+ ],
1676
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/dependencyContainer.d.ts": [
1677
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/IFluidDependencySynthesizer.d.ts",
1678
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/types.d.ts"
1679
+ ],
1680
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/index.d.ts": [
1681
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/IFluidDependencySynthesizer.d.ts",
1682
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/dependencyContainer.d.ts",
1683
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/types.d.ts"
1684
+ ],
1685
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/types.d.ts": [
1686
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/index.d.ts"
1687
+ ],
1543
1688
  "../../../../../node_modules/@types/node/assert.d.ts": [
1544
1689
  "../../../../../node_modules/@types/node/assert.d.ts"
1545
1690
  ],
@@ -1909,6 +2054,14 @@
1909
2054
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/index.d.ts",
1910
2055
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/storage.d.ts",
1911
2056
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/urlResolver.d.ts",
2057
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
2058
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts",
2059
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidPackage.d.ts",
2060
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts",
2061
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/handles.d.ts",
2062
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/index.d.ts",
2063
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/provider.d.ts",
2064
+ "../../../../../node_modules/@fluidframework/driver-definitions/node_modules/@fluidframework/core-interfaces/dist/serializer.d.ts",
1912
2065
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/clients.d.ts",
1913
2066
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/config.d.ts",
1914
2067
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/consensus.d.ts",
@@ -1920,6 +2073,10 @@
1920
2073
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/summary.d.ts",
1921
2074
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/tokens.d.ts",
1922
2075
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/users.d.ts",
2076
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/IFluidDependencySynthesizer.d.ts",
2077
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/dependencyContainer.d.ts",
2078
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/index.d.ts",
2079
+ "../../../../../node_modules/@fluidframework/synthesize-previous/dist/types.d.ts",
1923
2080
  "../../../../../node_modules/@types/events/index.d.ts",
1924
2081
  "../../../../../node_modules/@types/mocha/index.d.ts",
1925
2082
  "../../../../../node_modules/@types/node/assert.d.ts",
@@ -2000,6 +2157,7 @@
2000
2157
  "../index.d.ts",
2001
2158
  "../types.d.ts",
2002
2159
  "../../src/test/dependencyContainer.spec.ts",
2160
+ "../../src/test/types/validateSynthesizePrevious.ts",
2003
2161
  "../../../../runtime/datastore-definitions/dist/channel.d.ts",
2004
2162
  "../../../../runtime/datastore-definitions/dist/dataStoreRuntime.d.ts",
2005
2163
  "../../../../runtime/datastore-definitions/dist/index.d.ts",
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ use_current_TypeAliasDeclaration_AsyncFluidObjectProvider(get_old_TypeAliasDeclaration_AsyncFluidObjectProvider());
4
+ use_old_TypeAliasDeclaration_AsyncFluidObjectProvider(get_current_TypeAliasDeclaration_AsyncFluidObjectProvider());
5
+ use_current_TypeAliasDeclaration_AsyncOptionalFluidObjectProvider(get_old_TypeAliasDeclaration_AsyncOptionalFluidObjectProvider());
6
+ use_old_TypeAliasDeclaration_AsyncOptionalFluidObjectProvider(get_current_TypeAliasDeclaration_AsyncOptionalFluidObjectProvider());
7
+ use_current_TypeAliasDeclaration_AsyncRequiredFluidObjectProvider(get_old_TypeAliasDeclaration_AsyncRequiredFluidObjectProvider());
8
+ use_old_TypeAliasDeclaration_AsyncRequiredFluidObjectProvider(get_current_TypeAliasDeclaration_AsyncRequiredFluidObjectProvider());
9
+ use_current_ClassDeclaration_DependencyContainer(get_old_ClassDeclaration_DependencyContainer());
10
+ use_old_ClassDeclaration_DependencyContainer(get_current_ClassDeclaration_DependencyContainer());
11
+ use_current_TypeAliasDeclaration_FluidObjectProvider(get_old_TypeAliasDeclaration_FluidObjectProvider());
12
+ use_old_TypeAliasDeclaration_FluidObjectProvider(get_current_TypeAliasDeclaration_FluidObjectProvider());
13
+ use_current_TypeAliasDeclaration_FluidObjectSymbolProvider(get_old_TypeAliasDeclaration_FluidObjectSymbolProvider());
14
+ use_old_TypeAliasDeclaration_FluidObjectSymbolProvider(get_current_TypeAliasDeclaration_FluidObjectSymbolProvider());
15
+ use_current_VariableDeclaration_IFluidDependencySynthesizer(get_old_VariableDeclaration_IFluidDependencySynthesizer());
16
+ use_old_VariableDeclaration_IFluidDependencySynthesizer(get_current_VariableDeclaration_IFluidDependencySynthesizer());
17
+ use_current_InterfaceDeclaration_IFluidDependencySynthesizer(get_old_InterfaceDeclaration_IFluidDependencySynthesizer());
18
+ use_old_InterfaceDeclaration_IFluidDependencySynthesizer(get_current_InterfaceDeclaration_IFluidDependencySynthesizer());
19
+ use_current_InterfaceDeclaration_IProvideFluidDependencySynthesizer(get_old_InterfaceDeclaration_IProvideFluidDependencySynthesizer());
20
+ use_old_InterfaceDeclaration_IProvideFluidDependencySynthesizer(get_current_InterfaceDeclaration_IProvideFluidDependencySynthesizer());
21
+ //# sourceMappingURL=validateSynthesizePrevious.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateSynthesizePrevious.js","sourceRoot":"","sources":["../../../src/test/types/validateSynthesizePrevious.ts"],"names":[],"mappings":";;AAyBA,yDAAyD,CACrD,qDAAqD,EAAE,CAAC,CAAC;AAW7D,qDAAqD,CACjD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,iEAAiE,CAC7D,6DAA6D,EAAE,CAAC,CAAC;AAWrE,6DAA6D,CACzD,iEAAiE,EAAE,CAAC,CAAC;AAWzE,iEAAiE,CAC7D,6DAA6D,EAAE,CAAC,CAAC;AAWrE,6DAA6D,CACzD,iEAAiE,EAAE,CAAC,CAAC;AAWzE,gDAAgD,CAC5C,4CAA4C,EAAE,CAAC,CAAC;AAWpD,4CAA4C,CACxC,gDAAgD,EAAE,CAAC,CAAC;AAWxD,oDAAoD,CAChD,gDAAgD,EAAE,CAAC,CAAC;AAWxD,gDAAgD,CAC5C,oDAAoD,EAAE,CAAC,CAAC;AAW5D,0DAA0D,CACtD,sDAAsD,EAAE,CAAC,CAAC;AAW9D,sDAAsD,CAClD,0DAA0D,EAAE,CAAC,CAAC;AAWlE,2DAA2D,CACvD,uDAAuD,EAAE,CAAC,CAAC;AAW/D,uDAAuD,CACnD,2DAA2D,EAAE,CAAC,CAAC;AAWnE,4DAA4D,CACxD,wDAAwD,EAAE,CAAC,CAAC;AAWhE,wDAAwD,CACpD,4DAA4D,EAAE,CAAC,CAAC;AAWpE,mEAAmE,CAC/D,+DAA+D,EAAE,CAAC,CAAC;AAWvE,+DAA+D,CAC3D,mEAAmE,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-validator in @fluidframework/build-tools.\n */\n/* eslint-disable max-lines */\nimport * as old from \"@fluidframework/synthesize-previous\";\nimport * as current from \"../../index\";\n\ntype TypeOnly<T> = {\n [P in keyof T]: TypeOnly<T[P]>;\n};\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"TypeAliasDeclaration_AsyncFluidObjectProvider\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_AsyncFluidObjectProvider():\n TypeOnly<old.AsyncFluidObjectProvider<any,any>>;\ndeclare function use_current_TypeAliasDeclaration_AsyncFluidObjectProvider(\n use: TypeOnly<current.AsyncFluidObjectProvider<any,any>>);\nuse_current_TypeAliasDeclaration_AsyncFluidObjectProvider(\n get_old_TypeAliasDeclaration_AsyncFluidObjectProvider());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"TypeAliasDeclaration_AsyncFluidObjectProvider\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_AsyncFluidObjectProvider():\n TypeOnly<current.AsyncFluidObjectProvider<any,any>>;\ndeclare function use_old_TypeAliasDeclaration_AsyncFluidObjectProvider(\n use: TypeOnly<old.AsyncFluidObjectProvider<any,any>>);\nuse_old_TypeAliasDeclaration_AsyncFluidObjectProvider(\n get_current_TypeAliasDeclaration_AsyncFluidObjectProvider());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"TypeAliasDeclaration_AsyncOptionalFluidObjectProvider\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_AsyncOptionalFluidObjectProvider():\n TypeOnly<old.AsyncOptionalFluidObjectProvider<any>>;\ndeclare function use_current_TypeAliasDeclaration_AsyncOptionalFluidObjectProvider(\n use: TypeOnly<current.AsyncOptionalFluidObjectProvider<any>>);\nuse_current_TypeAliasDeclaration_AsyncOptionalFluidObjectProvider(\n get_old_TypeAliasDeclaration_AsyncOptionalFluidObjectProvider());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"TypeAliasDeclaration_AsyncOptionalFluidObjectProvider\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_AsyncOptionalFluidObjectProvider():\n TypeOnly<current.AsyncOptionalFluidObjectProvider<any>>;\ndeclare function use_old_TypeAliasDeclaration_AsyncOptionalFluidObjectProvider(\n use: TypeOnly<old.AsyncOptionalFluidObjectProvider<any>>);\nuse_old_TypeAliasDeclaration_AsyncOptionalFluidObjectProvider(\n get_current_TypeAliasDeclaration_AsyncOptionalFluidObjectProvider());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"TypeAliasDeclaration_AsyncRequiredFluidObjectProvider\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_AsyncRequiredFluidObjectProvider():\n TypeOnly<old.AsyncRequiredFluidObjectProvider<any>>;\ndeclare function use_current_TypeAliasDeclaration_AsyncRequiredFluidObjectProvider(\n use: TypeOnly<current.AsyncRequiredFluidObjectProvider<any>>);\nuse_current_TypeAliasDeclaration_AsyncRequiredFluidObjectProvider(\n get_old_TypeAliasDeclaration_AsyncRequiredFluidObjectProvider());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"TypeAliasDeclaration_AsyncRequiredFluidObjectProvider\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_AsyncRequiredFluidObjectProvider():\n TypeOnly<current.AsyncRequiredFluidObjectProvider<any>>;\ndeclare function use_old_TypeAliasDeclaration_AsyncRequiredFluidObjectProvider(\n use: TypeOnly<old.AsyncRequiredFluidObjectProvider<any>>);\nuse_old_TypeAliasDeclaration_AsyncRequiredFluidObjectProvider(\n get_current_TypeAliasDeclaration_AsyncRequiredFluidObjectProvider());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"ClassDeclaration_DependencyContainer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_DependencyContainer():\n TypeOnly<old.DependencyContainer<any>>;\ndeclare function use_current_ClassDeclaration_DependencyContainer(\n use: TypeOnly<current.DependencyContainer<any>>);\nuse_current_ClassDeclaration_DependencyContainer(\n get_old_ClassDeclaration_DependencyContainer());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"ClassDeclaration_DependencyContainer\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_DependencyContainer():\n TypeOnly<current.DependencyContainer<any>>;\ndeclare function use_old_ClassDeclaration_DependencyContainer(\n use: TypeOnly<old.DependencyContainer<any>>);\nuse_old_ClassDeclaration_DependencyContainer(\n get_current_ClassDeclaration_DependencyContainer());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"TypeAliasDeclaration_FluidObjectProvider\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_FluidObjectProvider():\n TypeOnly<old.FluidObjectProvider<any>>;\ndeclare function use_current_TypeAliasDeclaration_FluidObjectProvider(\n use: TypeOnly<current.FluidObjectProvider<any>>);\nuse_current_TypeAliasDeclaration_FluidObjectProvider(\n get_old_TypeAliasDeclaration_FluidObjectProvider());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"TypeAliasDeclaration_FluidObjectProvider\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_FluidObjectProvider():\n TypeOnly<current.FluidObjectProvider<any>>;\ndeclare function use_old_TypeAliasDeclaration_FluidObjectProvider(\n use: TypeOnly<old.FluidObjectProvider<any>>);\nuse_old_TypeAliasDeclaration_FluidObjectProvider(\n get_current_TypeAliasDeclaration_FluidObjectProvider());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"TypeAliasDeclaration_FluidObjectSymbolProvider\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_FluidObjectSymbolProvider():\n TypeOnly<old.FluidObjectSymbolProvider<any>>;\ndeclare function use_current_TypeAliasDeclaration_FluidObjectSymbolProvider(\n use: TypeOnly<current.FluidObjectSymbolProvider<any>>);\nuse_current_TypeAliasDeclaration_FluidObjectSymbolProvider(\n get_old_TypeAliasDeclaration_FluidObjectSymbolProvider());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"TypeAliasDeclaration_FluidObjectSymbolProvider\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_FluidObjectSymbolProvider():\n TypeOnly<current.FluidObjectSymbolProvider<any>>;\ndeclare function use_old_TypeAliasDeclaration_FluidObjectSymbolProvider(\n use: TypeOnly<old.FluidObjectSymbolProvider<any>>);\nuse_old_TypeAliasDeclaration_FluidObjectSymbolProvider(\n get_current_TypeAliasDeclaration_FluidObjectSymbolProvider());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"VariableDeclaration_IFluidDependencySynthesizer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_IFluidDependencySynthesizer():\n TypeOnly<typeof old.IFluidDependencySynthesizer>;\ndeclare function use_current_VariableDeclaration_IFluidDependencySynthesizer(\n use: TypeOnly<typeof current.IFluidDependencySynthesizer>);\nuse_current_VariableDeclaration_IFluidDependencySynthesizer(\n get_old_VariableDeclaration_IFluidDependencySynthesizer());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"VariableDeclaration_IFluidDependencySynthesizer\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_IFluidDependencySynthesizer():\n TypeOnly<typeof current.IFluidDependencySynthesizer>;\ndeclare function use_old_VariableDeclaration_IFluidDependencySynthesizer(\n use: TypeOnly<typeof old.IFluidDependencySynthesizer>);\nuse_old_VariableDeclaration_IFluidDependencySynthesizer(\n get_current_VariableDeclaration_IFluidDependencySynthesizer());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"InterfaceDeclaration_IFluidDependencySynthesizer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IFluidDependencySynthesizer():\n TypeOnly<old.IFluidDependencySynthesizer>;\ndeclare function use_current_InterfaceDeclaration_IFluidDependencySynthesizer(\n use: TypeOnly<current.IFluidDependencySynthesizer>);\nuse_current_InterfaceDeclaration_IFluidDependencySynthesizer(\n get_old_InterfaceDeclaration_IFluidDependencySynthesizer());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"InterfaceDeclaration_IFluidDependencySynthesizer\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IFluidDependencySynthesizer():\n TypeOnly<current.IFluidDependencySynthesizer>;\ndeclare function use_old_InterfaceDeclaration_IFluidDependencySynthesizer(\n use: TypeOnly<old.IFluidDependencySynthesizer>);\nuse_old_InterfaceDeclaration_IFluidDependencySynthesizer(\n get_current_InterfaceDeclaration_IFluidDependencySynthesizer());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"InterfaceDeclaration_IProvideFluidDependencySynthesizer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IProvideFluidDependencySynthesizer():\n TypeOnly<old.IProvideFluidDependencySynthesizer>;\ndeclare function use_current_InterfaceDeclaration_IProvideFluidDependencySynthesizer(\n use: TypeOnly<current.IProvideFluidDependencySynthesizer>);\nuse_current_InterfaceDeclaration_IProvideFluidDependencySynthesizer(\n get_old_InterfaceDeclaration_IProvideFluidDependencySynthesizer());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:\n* \"InterfaceDeclaration_IProvideFluidDependencySynthesizer\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IProvideFluidDependencySynthesizer():\n TypeOnly<current.IProvideFluidDependencySynthesizer>;\ndeclare function use_old_InterfaceDeclaration_IProvideFluidDependencySynthesizer(\n use: TypeOnly<old.IProvideFluidDependencySynthesizer>);\nuse_old_InterfaceDeclaration_IProvideFluidDependencySynthesizer(\n get_current_InterfaceDeclaration_IProvideFluidDependencySynthesizer());\n"]}
package/dist/types.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  import { IFluidDependencySynthesizer } from ".";
6
6
  /**
7
7
  * This is a condensed version of Record that requires the object has all
8
- * the IFluidObject properties as its type mapped to a string representation
8
+ * the FluidObject properties as its type mapped to a string representation
9
9
  * of that property.
10
10
  *
11
11
  * @example - \{ IFoo: "IFoo" \}
@@ -15,7 +15,7 @@ export declare type FluidObjectSymbolProvider<T> = {
15
15
  };
16
16
  /**
17
17
  * This is a condensed version of Record that requires the object has all
18
- * the IFluidObject properties as its type mapped to an object that implements
18
+ * the FluidObject properties as its type mapped to an object that implements
19
19
  * the property.
20
20
  */
21
21
  export declare type AsyncRequiredFluidObjectProvider<T> = T extends undefined ? Record<string, never> : {
@@ -23,7 +23,7 @@ export declare type AsyncRequiredFluidObjectProvider<T> = T extends undefined ?
23
23
  };
24
24
  /**
25
25
  * This is a condensed version of Record that requires the object has all
26
- * the IFluidObject properties as its type, mapped to an object that implements
26
+ * the FluidObject properties as its type, mapped to an object that implements
27
27
  * the property or undefined.
28
28
  */
29
29
  export declare type AsyncOptionalFluidObjectProvider<T> = T extends undefined ? Record<string, never> : {
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IFluidDependencySynthesizer } from \".\";\n/**\n * This is a condensed version of Record that requires the object has all\n * the IFluidObject properties as its type mapped to a string representation\n * of that property.\n *\n * @example - \\{ IFoo: \"IFoo\" \\}\n */\nexport type FluidObjectSymbolProvider<T> = {\n [P in keyof T]?: P;\n};\n\n/**\n * This is a condensed version of Record that requires the object has all\n * the IFluidObject properties as its type mapped to an object that implements\n * the property.\n */\nexport type AsyncRequiredFluidObjectProvider<T> = T extends undefined ? Record<string, never> : {\n [P in keyof T]: Promise<NonNullable<Exclude<T[P], undefined | null>>>\n};\n\n/**\n * This is a condensed version of Record that requires the object has all\n * the IFluidObject properties as its type, mapped to an object that implements\n * the property or undefined.\n */\nexport type AsyncOptionalFluidObjectProvider<T> = T extends undefined\n ? Record<string, never>\n : {\n [P in keyof T]?: Promise<T[P] | undefined>;\n };\n\n/**\n * Combined type for Optional and Required Async Fluid object Providers\n */\nexport type AsyncFluidObjectProvider<O, R = undefined>\n = AsyncOptionalFluidObjectProvider<O> & AsyncRequiredFluidObjectProvider<R>;\n\n/**\n * Multiple ways to provide a Fluid object.\n */\nexport type FluidObjectProvider<T> =\n NonNullable<T>\n | Promise<NonNullable<T>>\n | ((dependencyContainer: IFluidDependencySynthesizer) => NonNullable<T>)\n | ((dependencyContainer: IFluidDependencySynthesizer) => Promise<NonNullable<T>>);\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IFluidDependencySynthesizer } from \".\";\n/**\n * This is a condensed version of Record that requires the object has all\n * the FluidObject properties as its type mapped to a string representation\n * of that property.\n *\n * @example - \\{ IFoo: \"IFoo\" \\}\n */\nexport type FluidObjectSymbolProvider<T> = {\n [P in keyof T]?: P;\n};\n\n/**\n * This is a condensed version of Record that requires the object has all\n * the FluidObject properties as its type mapped to an object that implements\n * the property.\n */\nexport type AsyncRequiredFluidObjectProvider<T> = T extends undefined ? Record<string, never> : {\n [P in keyof T]: Promise<NonNullable<Exclude<T[P], undefined | null>>>\n};\n\n/**\n * This is a condensed version of Record that requires the object has all\n * the FluidObject properties as its type, mapped to an object that implements\n * the property or undefined.\n */\nexport type AsyncOptionalFluidObjectProvider<T> = T extends undefined\n ? Record<string, never>\n : {\n [P in keyof T]?: Promise<T[P] | undefined>;\n };\n\n/**\n * Combined type for Optional and Required Async Fluid object Providers\n */\nexport type AsyncFluidObjectProvider<O, R = undefined>\n = AsyncOptionalFluidObjectProvider<O> & AsyncRequiredFluidObjectProvider<R>;\n\n/**\n * Multiple ways to provide a Fluid object.\n */\nexport type FluidObjectProvider<T> =\n NonNullable<T>\n | Promise<NonNullable<T>>\n | ((dependencyContainer: IFluidDependencySynthesizer) => NonNullable<T>)\n | ((dependencyContainer: IFluidDependencySynthesizer) => Promise<NonNullable<T>>);\n"]}
@@ -62,7 +62,7 @@ export class DependencyContainer {
62
62
  */
63
63
  getProvider(provider) {
64
64
  // this was removed, but some partners have trouble with back compat where they
65
- // use invalid patterns with IFluidObject and IFluidDependencySynthesizer
65
+ // use invalid patterns with FluidObject and IFluidDependencySynthesizer
66
66
  // this is just for back compat until those are removed
67
67
  if (this.has(provider)) {
68
68
  if (this.providers.has(provider)) {
@@ -1 +1 @@
1
- {"version":3,"file":"dependencyContainer.js","sourceRoot":"","sources":["../src/dependencyContainer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EACH,2BAA2B,GAC9B,MAAM,+BAA+B,CAAC;AAEvC;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAK5B,YAAmB,GAAI,OAAoD;QAJ1D,cAAS,GAAG,IAAI,GAAG,EAAwC,CAAC;QAKzE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAoC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IAC5F,CAAC;IAJD,IAAW,2BAA2B,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAMzD;;;;;OAKG;IACI,QAAQ,CAAoC,IAAO,EAAE,QAA4C;QACpG,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,6CAA6C,IAAI,sBAAsB,CAAC,CAAC;SAC5F;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,IAAgB;QAC9B,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC1B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC/B;IACL,CAAC;IAED;;OAEG;IACI,UAAU,CACb,aAA2C,EAC3C,aAAqD;QAErD,MAAM,IAAI,GAAmC,EAAS,CAAC;QACvD,IAA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AC,EAA8C,CAAC;gBAClE,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CACzB,EAAE,EACF,EAAE,CAAC,CAAC;gBACR,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;gBAC3D,IAAI,UAAU,KAAK,SAAS,EAAE;oBAC1B,OAAO,UAAU,CAAC;iBACrB;aACJ;YACD,OAAO,SAAS,CAAC;SACpB;QAED,+EAA+E;QAC/E,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;YAChC,OAAO;gBACH,GAAG;oBACC,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;wBAC5C,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;6BACpD,IAAI,CAAC,KAAK,EAAE,GAAG,EAAgB,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;6BAChD,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAG,CAAC,CAAC,CAAC,CAAC;qBAC5B;gBACL,CAAC;aACJ,CAAC;SACL;QACD,OAAO;YACC,GAAG;gBACC,IAAI,QAAQ,EAAE;oBACV,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;wBACxC,IAAI,CAAC,EAAE;4BACH,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;yBACf;oBACL,CAAC,CAAC,CAAC;iBACN;YACL,CAAC;SACJ,CAAC;IACV,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n AsyncFluidObjectProvider,\n FluidObjectSymbolProvider,\n FluidObjectProvider,\n AsyncOptionalFluidObjectProvider,\n AsyncRequiredFluidObjectProvider,\n} from \"./types\";\nimport {\n IFluidDependencySynthesizer,\n} from \"./IFluidDependencySynthesizer\";\n\n/**\n * DependencyContainer is similar to a IoC Container. It takes providers and will\n * synthesize an object based on them when requested.\n */\nexport class DependencyContainer<TMap> implements IFluidDependencySynthesizer {\n private readonly providers = new Map<keyof TMap, FluidObjectProvider<any>>();\n private readonly parents: IFluidDependencySynthesizer[];\n public get IFluidDependencySynthesizer() { return this; }\n\n public constructor(... parents: (IFluidDependencySynthesizer | undefined)[]) {\n this.parents = parents.filter((v): v is IFluidDependencySynthesizer => v !== undefined);\n }\n\n /**\n * Add a new provider\n * @param type - Name of the Type T being provided\n * @param provider - A provider that will resolve the T correctly when asked\n * @throws - If passing a type that's already registered\n */\n public register<T extends keyof TMap = keyof TMap>(type: T, provider: FluidObjectProvider<Pick<TMap, T>>): void {\n if (this.providers.has(type)) {\n throw new Error(`Attempting to register a provider of type ${type} that already exists`);\n }\n\n this.providers.set(type, provider);\n }\n\n /**\n * Remove a provider\n * @param type - Name of the provider to remove\n */\n public unregister(type: keyof TMap): void {\n if (this.providers.has(type)) {\n this.providers.delete(type);\n }\n }\n\n /**\n * {@inheritDoc (IFluidDependencySynthesizer:interface).synthesize}\n */\n public synthesize<O, R = undefined | Record<string, never>>(\n optionalTypes: FluidObjectSymbolProvider<O>,\n requiredTypes: Required<FluidObjectSymbolProvider<R>>,\n ): AsyncFluidObjectProvider<O, R> {\n const base: AsyncFluidObjectProvider<O, R> = {} as any;\n this.generateRequired<R>(base, requiredTypes);\n this.generateOptional<O>(base, optionalTypes);\n Object.defineProperty(base, IFluidDependencySynthesizer, { get: () => this });\n return base;\n }\n\n /**\n * {@inheritDoc (IFluidDependencySynthesizer:interface).has}\n * @param excludeParents - If true, exclude checking parent registries\n */\n public has(type: string, excludeParents?: boolean): boolean {\n if (this.providers.has(type as keyof TMap)) {\n return true;\n }\n if (excludeParents !== true) {\n return this.parents.some((p: IFluidDependencySynthesizer) => p.has(type));\n }\n return false;\n }\n /**\n * @deprecated - Needed for back compat\n */\n private getProvider(provider: string & keyof TMap) {\n // this was removed, but some partners have trouble with back compat where they\n // use invalid patterns with IFluidObject and IFluidDependencySynthesizer\n // this is just for back compat until those are removed\n if(this.has(provider)) {\n if(this.providers.has(provider)) {\n return this.providers.get(provider);\n }\n for(const parent of this.parents) {\n if(parent instanceof DependencyContainer) {\n return parent.getProvider(provider);\n }else{\n // older implementations of the IFluidDependencySynthesizer exposed getProvider\n const maybeGetProvider: {getProvider?(provider: string & keyof TMap)} = parent as any;\n if(maybeGetProvider?.getProvider !== undefined) {\n return maybeGetProvider.getProvider(provider);\n }\n }\n }\n }\n }\n\n private generateRequired<T>(\n base: AsyncRequiredFluidObjectProvider<T>,\n types: Required<FluidObjectSymbolProvider<T>>,\n ) {\n if (types === undefined) { return; }\n for (const key of Object.keys(types) as unknown as (keyof TMap)[]) {\n const provider = this.resolveProvider(key);\n if(provider === undefined) {\n throw new Error(`Object attempted to be created without registered required provider ${key}`);\n }\n Object.defineProperty(\n base,\n key,\n provider,\n );\n }\n }\n\n private generateOptional<T>(\n base: AsyncOptionalFluidObjectProvider<T>,\n types: FluidObjectSymbolProvider<T>,\n ) {\n if (types === undefined) { return; }\n for (const key of Object.keys(types) as unknown as (keyof TMap)[]) {\n // back-compat: in 0.56 we allow undefined in the types, but we didn't before\n // this will keep runtime back compat, eventually we should support undefined properties\n // rather than properties that return promises that resolve to undefined\n const provider = this.resolveProvider(key) ?? { get: async () => undefined };\n Object.defineProperty(\n base,\n key,\n provider,\n );\n }\n }\n\n private resolveProvider<T extends keyof TMap>(t: T): PropertyDescriptor | undefined {\n // If we have the provider return it\n const provider = this.providers.get(t);\n if (provider === undefined) {\n for (const parent of this.parents) {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n const sp = { [t]: t } as FluidObjectSymbolProvider<Pick<TMap, T>>;\n const syn = parent.synthesize<Pick<TMap, T>,{}>(\n sp,\n {});\n const descriptor = Object.getOwnPropertyDescriptor(syn, t);\n if (descriptor !== undefined) {\n return descriptor;\n }\n }\n return undefined;\n }\n\n // The double nested gets are required for lazy loading the provider resolution\n if (typeof provider === \"function\") {\n return {\n get() {\n if (provider && typeof provider === \"function\") {\n return Promise.resolve(this[IFluidDependencySynthesizer])\n .then(async (fds): Promise<any> => provider(fds))\n .then((p) => p?.[t]);\n }\n },\n };\n }\n return {\n get() {\n if (provider) {\n return Promise.resolve(provider).then((p) => {\n if (p) {\n return p[t];\n }\n });\n }\n },\n };\n }\n}\n"]}
1
+ {"version":3,"file":"dependencyContainer.js","sourceRoot":"","sources":["../src/dependencyContainer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EACH,2BAA2B,GAC9B,MAAM,+BAA+B,CAAC;AAEvC;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAK5B,YAAmB,GAAI,OAAoD;QAJ1D,cAAS,GAAG,IAAI,GAAG,EAAwC,CAAC;QAKzE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAoC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IAC5F,CAAC;IAJD,IAAW,2BAA2B,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAMzD;;;;;OAKG;IACI,QAAQ,CAAoC,IAAO,EAAE,QAA4C;QACpG,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,6CAA6C,IAAI,sBAAsB,CAAC,CAAC;SAC5F;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,IAAgB;QAC9B,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC1B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC/B;IACL,CAAC;IAED;;OAEG;IACI,UAAU,CACb,aAA2C,EAC3C,aAAqD;QAErD,MA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GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAA8C,CAAC;gBAClE,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CACzB,EAAE,EACF,EAAE,CAAC,CAAC;gBACR,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;gBAC3D,IAAI,UAAU,KAAK,SAAS,EAAE;oBAC1B,OAAO,UAAU,CAAC;iBACrB;aACJ;YACD,OAAO,SAAS,CAAC;SACpB;QAED,+EAA+E;QAC/E,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;YAChC,OAAO;gBACH,GAAG;oBACC,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;wBAC5C,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;6BACpD,IAAI,CAAC,KAAK,EAAE,GAAG,EAAgB,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;6BAChD,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAG,CAAC,CAAC,CAAC,CAAC;qBAC5B;gBACL,CAAC;aACJ,CAAC;SACL;QACD,OAAO;YACC,GAAG;gBACC,IAAI,QAAQ,EAAE;oBACV,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;wBACxC,IAAI,CAAC,EAAE;4BACH,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;yBACf;oBACL,CAAC,CAAC,CAAC;iBACN;YACL,CAAC;SACJ,CAAC;IACV,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n AsyncFluidObjectProvider,\n FluidObjectSymbolProvider,\n FluidObjectProvider,\n AsyncOptionalFluidObjectProvider,\n AsyncRequiredFluidObjectProvider,\n} from \"./types\";\nimport {\n IFluidDependencySynthesizer,\n} from \"./IFluidDependencySynthesizer\";\n\n/**\n * DependencyContainer is similar to a IoC Container. It takes providers and will\n * synthesize an object based on them when requested.\n */\nexport class DependencyContainer<TMap> implements IFluidDependencySynthesizer {\n private readonly providers = new Map<keyof TMap, FluidObjectProvider<any>>();\n private readonly parents: IFluidDependencySynthesizer[];\n public get IFluidDependencySynthesizer() { return this; }\n\n public constructor(... parents: (IFluidDependencySynthesizer | undefined)[]) {\n this.parents = parents.filter((v): v is IFluidDependencySynthesizer => v !== undefined);\n }\n\n /**\n * Add a new provider\n * @param type - Name of the Type T being provided\n * @param provider - A provider that will resolve the T correctly when asked\n * @throws - If passing a type that's already registered\n */\n public register<T extends keyof TMap = keyof TMap>(type: T, provider: FluidObjectProvider<Pick<TMap, T>>): void {\n if (this.providers.has(type)) {\n throw new Error(`Attempting to register a provider of type ${type} that already exists`);\n }\n\n this.providers.set(type, provider);\n }\n\n /**\n * Remove a provider\n * @param type - Name of the provider to remove\n */\n public unregister(type: keyof TMap): void {\n if (this.providers.has(type)) {\n this.providers.delete(type);\n }\n }\n\n /**\n * {@inheritDoc (IFluidDependencySynthesizer:interface).synthesize}\n */\n public synthesize<O, R = undefined | Record<string, never>>(\n optionalTypes: FluidObjectSymbolProvider<O>,\n requiredTypes: Required<FluidObjectSymbolProvider<R>>,\n ): AsyncFluidObjectProvider<O, R> {\n const base: AsyncFluidObjectProvider<O, R> = {} as any;\n this.generateRequired<R>(base, requiredTypes);\n this.generateOptional<O>(base, optionalTypes);\n Object.defineProperty(base, IFluidDependencySynthesizer, { get: () => this });\n return base;\n }\n\n /**\n * {@inheritDoc (IFluidDependencySynthesizer:interface).has}\n * @param excludeParents - If true, exclude checking parent registries\n */\n public has(type: string, excludeParents?: boolean): boolean {\n if (this.providers.has(type as keyof TMap)) {\n return true;\n }\n if (excludeParents !== true) {\n return this.parents.some((p: IFluidDependencySynthesizer) => p.has(type));\n }\n return false;\n }\n /**\n * @deprecated - Needed for back compat\n */\n private getProvider(provider: string & keyof TMap) {\n // this was removed, but some partners have trouble with back compat where they\n // use invalid patterns with FluidObject and IFluidDependencySynthesizer\n // this is just for back compat until those are removed\n if(this.has(provider)) {\n if(this.providers.has(provider)) {\n return this.providers.get(provider);\n }\n for(const parent of this.parents) {\n if(parent instanceof DependencyContainer) {\n return parent.getProvider(provider);\n }else{\n // older implementations of the IFluidDependencySynthesizer exposed getProvider\n const maybeGetProvider: {getProvider?(provider: string & keyof TMap)} = parent as any;\n if(maybeGetProvider?.getProvider !== undefined) {\n return maybeGetProvider.getProvider(provider);\n }\n }\n }\n }\n }\n\n private generateRequired<T>(\n base: AsyncRequiredFluidObjectProvider<T>,\n types: Required<FluidObjectSymbolProvider<T>>,\n ) {\n if (types === undefined) { return; }\n for (const key of Object.keys(types) as unknown as (keyof TMap)[]) {\n const provider = this.resolveProvider(key);\n if(provider === undefined) {\n throw new Error(`Object attempted to be created without registered required provider ${key}`);\n }\n Object.defineProperty(\n base,\n key,\n provider,\n );\n }\n }\n\n private generateOptional<T>(\n base: AsyncOptionalFluidObjectProvider<T>,\n types: FluidObjectSymbolProvider<T>,\n ) {\n if (types === undefined) { return; }\n for (const key of Object.keys(types) as unknown as (keyof TMap)[]) {\n // back-compat: in 0.56 we allow undefined in the types, but we didn't before\n // this will keep runtime back compat, eventually we should support undefined properties\n // rather than properties that return promises that resolve to undefined\n const provider = this.resolveProvider(key) ?? { get: async () => undefined };\n Object.defineProperty(\n base,\n key,\n provider,\n );\n }\n }\n\n private resolveProvider<T extends keyof TMap>(t: T): PropertyDescriptor | undefined {\n // If we have the provider return it\n const provider = this.providers.get(t);\n if (provider === undefined) {\n for (const parent of this.parents) {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n const sp = { [t]: t } as FluidObjectSymbolProvider<Pick<TMap, T>>;\n const syn = parent.synthesize<Pick<TMap, T>, Record<string, unknown>>(\n sp,\n {});\n const descriptor = Object.getOwnPropertyDescriptor(syn, t);\n if (descriptor !== undefined) {\n return descriptor;\n }\n }\n return undefined;\n }\n\n // The double nested gets are required for lazy loading the provider resolution\n if (typeof provider === \"function\") {\n return {\n get() {\n if (provider && typeof provider === \"function\") {\n return Promise.resolve(this[IFluidDependencySynthesizer])\n .then(async (fds): Promise<any> => provider(fds))\n .then((p) => p?.[t]);\n }\n },\n };\n }\n return {\n get() {\n if (provider) {\n return Promise.resolve(provider).then((p) => {\n if (p) {\n return p[t];\n }\n });\n }\n },\n };\n }\n}\n"]}
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IFluidDependencySynthesizer } from \".\";\n/**\n * This is a condensed version of Record that requires the object has all\n * the IFluidObject properties as its type mapped to a string representation\n * of that property.\n *\n * @example - \\{ IFoo: \"IFoo\" \\}\n */\nexport type FluidObjectSymbolProvider<T> = {\n [P in keyof T]?: P;\n};\n\n/**\n * This is a condensed version of Record that requires the object has all\n * the IFluidObject properties as its type mapped to an object that implements\n * the property.\n */\nexport type AsyncRequiredFluidObjectProvider<T> = T extends undefined ? Record<string, never> : {\n [P in keyof T]: Promise<NonNullable<Exclude<T[P], undefined | null>>>\n};\n\n/**\n * This is a condensed version of Record that requires the object has all\n * the IFluidObject properties as its type, mapped to an object that implements\n * the property or undefined.\n */\nexport type AsyncOptionalFluidObjectProvider<T> = T extends undefined\n ? Record<string, never>\n : {\n [P in keyof T]?: Promise<T[P] | undefined>;\n };\n\n/**\n * Combined type for Optional and Required Async Fluid object Providers\n */\nexport type AsyncFluidObjectProvider<O, R = undefined>\n = AsyncOptionalFluidObjectProvider<O> & AsyncRequiredFluidObjectProvider<R>;\n\n/**\n * Multiple ways to provide a Fluid object.\n */\nexport type FluidObjectProvider<T> =\n NonNullable<T>\n | Promise<NonNullable<T>>\n | ((dependencyContainer: IFluidDependencySynthesizer) => NonNullable<T>)\n | ((dependencyContainer: IFluidDependencySynthesizer) => Promise<NonNullable<T>>);\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IFluidDependencySynthesizer } from \".\";\n/**\n * This is a condensed version of Record that requires the object has all\n * the FluidObject properties as its type mapped to a string representation\n * of that property.\n *\n * @example - \\{ IFoo: \"IFoo\" \\}\n */\nexport type FluidObjectSymbolProvider<T> = {\n [P in keyof T]?: P;\n};\n\n/**\n * This is a condensed version of Record that requires the object has all\n * the FluidObject properties as its type mapped to an object that implements\n * the property.\n */\nexport type AsyncRequiredFluidObjectProvider<T> = T extends undefined ? Record<string, never> : {\n [P in keyof T]: Promise<NonNullable<Exclude<T[P], undefined | null>>>\n};\n\n/**\n * This is a condensed version of Record that requires the object has all\n * the FluidObject properties as its type, mapped to an object that implements\n * the property or undefined.\n */\nexport type AsyncOptionalFluidObjectProvider<T> = T extends undefined\n ? Record<string, never>\n : {\n [P in keyof T]?: Promise<T[P] | undefined>;\n };\n\n/**\n * Combined type for Optional and Required Async Fluid object Providers\n */\nexport type AsyncFluidObjectProvider<O, R = undefined>\n = AsyncOptionalFluidObjectProvider<O> & AsyncRequiredFluidObjectProvider<R>;\n\n/**\n * Multiple ways to provide a Fluid object.\n */\nexport type FluidObjectProvider<T> =\n NonNullable<T>\n | Promise<NonNullable<T>>\n | ((dependencyContainer: IFluidDependencySynthesizer) => NonNullable<T>)\n | ((dependencyContainer: IFluidDependencySynthesizer) => Promise<NonNullable<T>>);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/synthesize",
3
- "version": "0.58.2001",
3
+ "version": "0.59.2000-61729",
4
4
  "description": "A library for synthesizing scope objects.",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "lint:fix": "npm run eslint:fix",
36
36
  "test": "npm run test:mocha",
37
37
  "test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
38
- "test:mocha": "mocha --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
38
+ "test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
39
39
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
40
40
  "tsc": "tsc",
41
41
  "tsfmt": "tsfmt --verify",
@@ -63,10 +63,11 @@
63
63
  },
64
64
  "devDependencies": {
65
65
  "@fluidframework/build-common": "^0.23.0",
66
- "@fluidframework/core-interfaces": "^0.42.0",
67
- "@fluidframework/datastore": "^0.58.2001",
68
- "@fluidframework/eslint-config-fluid": "^0.27.0",
69
- "@fluidframework/mocha-test-setup": "^0.58.2001",
66
+ "@fluidframework/core-interfaces": "^0.43.1000-0",
67
+ "@fluidframework/datastore": "0.59.2000-61729",
68
+ "@fluidframework/eslint-config-fluid": "^0.28.1000-61189",
69
+ "@fluidframework/mocha-test-setup": "0.59.2000-61729",
70
+ "@fluidframework/synthesize-previous": "npm:@fluidframework/synthesize@^0.58.0",
70
71
  "@microsoft/api-extractor": "^7.16.1",
71
72
  "@rushstack/eslint-config": "^2.5.1",
72
73
  "@types/mocha": "^8.2.2",
@@ -88,5 +89,9 @@
88
89
  "rimraf": "^2.6.2",
89
90
  "typescript": "~4.1.3",
90
91
  "typescript-formatter": "7.1.0"
92
+ },
93
+ "typeValidation": {
94
+ "version": "0.59.1000",
95
+ "broken": {}
91
96
  }
92
97
  }