@fluidframework/fluid-static 2.0.0-dev-rc.2.0.0.246488 → 2.0.0-dev-rc.3.0.0.253463
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-report/fluid-static.api.md +13 -21
- package/dist/fluid-static-alpha.d.ts +14 -35
- package/dist/fluid-static-beta.d.ts +14 -35
- package/dist/fluid-static-public.d.ts +14 -35
- package/dist/fluid-static-untrimmed.d.ts +14 -35
- package/dist/fluidContainer.d.ts +3 -2
- package/dist/fluidContainer.d.ts.map +1 -1
- package/dist/fluidContainer.js +1 -0
- package/dist/fluidContainer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/rootDataObject.d.ts +1 -1
- package/dist/rootDataObject.d.ts.map +1 -1
- package/dist/rootDataObject.js +11 -9
- package/dist/rootDataObject.js.map +1 -1
- package/dist/serviceAudience.d.ts +2 -2
- package/dist/serviceAudience.d.ts.map +1 -1
- package/dist/serviceAudience.js.map +1 -1
- package/dist/types.d.ts +12 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +6 -5
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +16 -9
- package/dist/utils.js.map +1 -1
- package/lib/fluid-static-alpha.d.ts +14 -35
- package/lib/fluid-static-beta.d.ts +14 -35
- package/lib/fluid-static-public.d.ts +14 -35
- package/lib/fluid-static-untrimmed.d.ts +14 -35
- package/lib/fluidContainer.d.ts +3 -2
- package/lib/fluidContainer.d.ts.map +1 -1
- package/lib/fluidContainer.js +1 -0
- package/lib/fluidContainer.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/rootDataObject.d.ts +1 -1
- package/lib/rootDataObject.d.ts.map +1 -1
- package/lib/rootDataObject.js +7 -5
- package/lib/rootDataObject.js.map +1 -1
- package/lib/serviceAudience.d.ts +2 -2
- package/lib/serviceAudience.d.ts.map +1 -1
- package/lib/serviceAudience.js.map +1 -1
- package/lib/tsdoc-metadata.json +11 -0
- package/lib/types.d.ts +12 -31
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/lib/utils.d.ts +6 -5
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +14 -7
- package/lib/utils.js.map +1 -1
- package/package.json +32 -31
- package/src/fluidContainer.ts +9 -7
- package/src/index.ts +0 -2
- package/src/rootDataObject.ts +15 -13
- package/src/serviceAudience.ts +4 -2
- package/src/types.ts +13 -34
- package/src/utils.ts +32 -19
- package/lib/test/fluidContainer.spec.js +0 -21
- package/lib/test/fluidContainer.spec.js.map +0 -1
- package/lib/test/types/validateFluidStaticPrevious.generated.js +0 -46
- package/lib/test/types/validateFluidStaticPrevious.generated.js.map +0 -1
- package/lib/test/utils.spec.js +0 -86
- package/lib/test/utils.spec.js.map +0 -1
package/src/index.ts
CHANGED
|
@@ -28,10 +28,8 @@ export {
|
|
|
28
28
|
type IServiceAudienceEvents,
|
|
29
29
|
type LoadableObjectClass,
|
|
30
30
|
type LoadableObjectClassRecord,
|
|
31
|
-
type LoadableObjectCtor,
|
|
32
31
|
type LoadableObjectRecord,
|
|
33
32
|
type MemberChangedListener,
|
|
34
33
|
type Myself,
|
|
35
|
-
type SharedObjectClass,
|
|
36
34
|
type IProvideRootDataObject,
|
|
37
35
|
} from "./types.js";
|
package/src/rootDataObject.ts
CHANGED
|
@@ -7,19 +7,20 @@ import {
|
|
|
7
7
|
BaseContainerRuntimeFactory,
|
|
8
8
|
DataObject,
|
|
9
9
|
DataObjectFactory,
|
|
10
|
-
} from "@fluidframework/aqueduct";
|
|
11
|
-
import { type
|
|
10
|
+
} from "@fluidframework/aqueduct/internal";
|
|
11
|
+
import { type IRuntimeFactory } from "@fluidframework/container-definitions/internal";
|
|
12
|
+
import { type ContainerRuntime } from "@fluidframework/container-runtime/internal";
|
|
13
|
+
import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions/internal";
|
|
12
14
|
import {
|
|
13
15
|
type FluidObject,
|
|
14
16
|
type IFluidLoadable,
|
|
15
17
|
type IRequest,
|
|
16
18
|
type IResponse,
|
|
17
19
|
} from "@fluidframework/core-interfaces";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { RequestParser } from "@fluidframework/runtime-utils";
|
|
21
|
-
import {
|
|
22
|
-
import { type IDirectory } from "@fluidframework/map";
|
|
20
|
+
import { type IDirectory } from "@fluidframework/map/internal";
|
|
21
|
+
import { FlushMode } from "@fluidframework/runtime-definitions/internal";
|
|
22
|
+
import { RequestParser } from "@fluidframework/runtime-utils/internal";
|
|
23
|
+
import type { ISharedObjectKind } from "@fluidframework/shared-object-base";
|
|
23
24
|
|
|
24
25
|
import {
|
|
25
26
|
type ContainerSchema,
|
|
@@ -27,12 +28,11 @@ import {
|
|
|
27
28
|
type LoadableObjectClass,
|
|
28
29
|
type LoadableObjectClassRecord,
|
|
29
30
|
type LoadableObjectRecord,
|
|
30
|
-
type SharedObjectClass,
|
|
31
31
|
} from "./types.js";
|
|
32
32
|
import {
|
|
33
33
|
type InternalDataObjectClass,
|
|
34
34
|
isDataObjectClass,
|
|
35
|
-
|
|
35
|
+
isSharedObjectKind,
|
|
36
36
|
parseDataObjectsFromSharedObjects,
|
|
37
37
|
} from "./utils.js";
|
|
38
38
|
|
|
@@ -129,9 +129,9 @@ class RootDataObject
|
|
|
129
129
|
*/
|
|
130
130
|
public async create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T> {
|
|
131
131
|
if (isDataObjectClass(objectClass)) {
|
|
132
|
-
return this.createDataObject
|
|
133
|
-
} else if (
|
|
134
|
-
return this.createSharedObject
|
|
132
|
+
return this.createDataObject(objectClass);
|
|
133
|
+
} else if (isSharedObjectKind(objectClass)) {
|
|
134
|
+
return this.createSharedObject(objectClass);
|
|
135
135
|
}
|
|
136
136
|
throw new Error("Could not create new Fluid object because an unknown object was passed");
|
|
137
137
|
}
|
|
@@ -147,7 +147,7 @@ class RootDataObject
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
private createSharedObject<T extends IFluidLoadable>(
|
|
150
|
-
sharedObjectClass:
|
|
150
|
+
sharedObjectClass: ISharedObjectKind<T>,
|
|
151
151
|
): T {
|
|
152
152
|
const factory = sharedObjectClass.getFactory();
|
|
153
153
|
const obj = this.runtime.createChannel(undefined, factory.type);
|
|
@@ -227,12 +227,14 @@ class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFactory {
|
|
|
227
227
|
super({
|
|
228
228
|
registryEntries: [rootDataObjectFactory.registryEntry],
|
|
229
229
|
requestHandlers: [getDefaultObject],
|
|
230
|
+
// WARNING: These settigs are not compatible with FF 1.3 clients!
|
|
230
231
|
runtimeOptions: {
|
|
231
232
|
// temporary workaround to disable message batching until the message batch size issue is resolved
|
|
232
233
|
// resolution progress is tracked by the Feature 465 work item in AzDO
|
|
233
234
|
flushMode: FlushMode.Immediate,
|
|
234
235
|
// The runtime compressor is required to be on to use @fluidframework/tree.
|
|
235
236
|
enableRuntimeIdCompressor: "on",
|
|
237
|
+
explicitSchemaControl: true,
|
|
236
238
|
},
|
|
237
239
|
provideEntryPoint,
|
|
238
240
|
});
|
package/src/serviceAudience.ts
CHANGED
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
|
-
import { type IAudience
|
|
7
|
+
import { type IAudience } from "@fluidframework/container-definitions";
|
|
8
|
+
import { type IContainer } from "@fluidframework/container-definitions/internal";
|
|
8
9
|
import { type IClient } from "@fluidframework/protocol-definitions";
|
|
10
|
+
|
|
9
11
|
import {
|
|
12
|
+
type IMember,
|
|
10
13
|
type IServiceAudience,
|
|
11
14
|
type IServiceAudienceEvents,
|
|
12
|
-
type IMember,
|
|
13
15
|
type Myself,
|
|
14
16
|
} from "./types.js";
|
|
15
17
|
|
package/src/types.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
type IEventProvider,
|
|
9
9
|
type IFluidLoadable,
|
|
10
10
|
} from "@fluidframework/core-interfaces";
|
|
11
|
-
import { type
|
|
11
|
+
import { type ISharedObjectKind } from "@fluidframework/shared-object-base";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.
|
|
@@ -33,11 +33,11 @@ export type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
|
|
|
33
33
|
* There are some edge cases in TypeScript where the order of the members in a union matter.
|
|
34
34
|
* Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
|
|
35
35
|
* In this case, its better to have the desired match and/or the simpler type first.
|
|
36
|
-
* In this case placing
|
|
36
|
+
* In this case placing ISharedObjectKind fixed one usage and didn't break anything, and generally seems more likely to work than the reverse, so this is the order being used.
|
|
37
37
|
* This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
|
|
38
38
|
*/
|
|
39
39
|
export type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =
|
|
40
|
-
|
|
|
40
|
+
| ISharedObjectKind<T>
|
|
41
41
|
| DataObjectClass<T>;
|
|
42
42
|
|
|
43
43
|
/**
|
|
@@ -47,31 +47,10 @@ export type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =
|
|
|
47
47
|
* @typeParam T - The class of the `DataObject`.
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
50
|
-
export type DataObjectClass<T extends IFluidLoadable> = {
|
|
51
|
-
readonly factory: { IFluidDataStoreFactory: DataObjectClass<T>["factory"] };
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* A factory that produces a factory that can create a DDSes (`SharedObject`s).
|
|
56
|
-
*
|
|
57
|
-
* @typeParam T - The class of the `SharedObject`.
|
|
58
|
-
* @public
|
|
59
|
-
*/
|
|
60
|
-
export interface SharedObjectClass<T extends IFluidLoadable> {
|
|
61
|
-
/**
|
|
62
|
-
* Gets the factory this factory is a wrapper for.
|
|
63
|
-
*/
|
|
64
|
-
readonly getFactory: () => IChannelFactory<T>;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
|
|
69
|
-
*
|
|
70
|
-
* @typeParam T - The class of the loadable object.
|
|
71
|
-
* @public
|
|
72
|
-
*/
|
|
73
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
|
-
export type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
50
|
+
export type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
51
|
+
readonly factory: { readonly IFluidDataStoreFactory: DataObjectClass<T>["factory"] };
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
} & (new (...args: any[]) => T);
|
|
75
54
|
|
|
76
55
|
/**
|
|
77
56
|
* Represents properties that can be attached to a container.
|
|
@@ -213,7 +192,7 @@ export interface IServiceAudience<M extends IMember>
|
|
|
213
192
|
* member object. The implementation may choose to exclude certain connections from the returned map.
|
|
214
193
|
* E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
|
|
215
194
|
*/
|
|
216
|
-
getMembers():
|
|
195
|
+
getMembers(): ReadonlyMap<string, M>;
|
|
217
196
|
|
|
218
197
|
/**
|
|
219
198
|
* Returns the current active user on this client once they are connected. Otherwise, returns undefined.
|
|
@@ -231,12 +210,12 @@ export interface IConnection {
|
|
|
231
210
|
/**
|
|
232
211
|
* A unique ID for the connection. A single user may have multiple connections, each with a different ID.
|
|
233
212
|
*/
|
|
234
|
-
id: string;
|
|
213
|
+
readonly id: string;
|
|
235
214
|
|
|
236
215
|
/**
|
|
237
216
|
* Whether the connection is in read or read/write mode.
|
|
238
217
|
*/
|
|
239
|
-
mode: "write" | "read";
|
|
218
|
+
readonly mode: "write" | "read";
|
|
240
219
|
}
|
|
241
220
|
|
|
242
221
|
/**
|
|
@@ -249,16 +228,16 @@ export interface IMember {
|
|
|
249
228
|
/**
|
|
250
229
|
* An ID for the user, unique among each individual user connecting to the session.
|
|
251
230
|
*/
|
|
252
|
-
userId: string;
|
|
231
|
+
readonly userId: string;
|
|
253
232
|
|
|
254
233
|
/**
|
|
255
234
|
* The set of connections the user has made, e.g. from multiple tabs or devices.
|
|
256
235
|
*/
|
|
257
|
-
connections: IConnection[];
|
|
236
|
+
readonly connections: IConnection[];
|
|
258
237
|
}
|
|
259
238
|
|
|
260
239
|
/**
|
|
261
240
|
* An extended member object that includes currentConnection
|
|
262
241
|
* @public
|
|
263
242
|
*/
|
|
264
|
-
export type Myself<M extends IMember = IMember> = M & { currentConnection: string };
|
|
243
|
+
export type Myself<M extends IMember = IMember> = M & { readonly currentConnection: string };
|
package/src/utils.ts
CHANGED
|
@@ -3,18 +3,16 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { type IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
6
7
|
import { type IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
7
8
|
import {
|
|
8
9
|
type IFluidDataStoreFactory,
|
|
9
10
|
type NamedFluidDataStoreRegistryEntry,
|
|
10
|
-
} from "@fluidframework/runtime-definitions";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
type LoadableObjectClass,
|
|
16
|
-
type SharedObjectClass,
|
|
17
|
-
} from "./types.js";
|
|
11
|
+
} from "@fluidframework/runtime-definitions/internal";
|
|
12
|
+
import type { ISharedObjectKind } from "@fluidframework/shared-object-base";
|
|
13
|
+
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
14
|
+
|
|
15
|
+
import { type ContainerSchema, type DataObjectClass, type LoadableObjectClass } from "./types.js";
|
|
18
16
|
|
|
19
17
|
/**
|
|
20
18
|
* An internal type used by the internal type guard isDataObjectClass to cast a
|
|
@@ -35,26 +33,41 @@ export function isDataObjectClass<T extends IFluidLoadable>(
|
|
|
35
33
|
/**
|
|
36
34
|
* Runtime check to determine if a class is a DataObject type.
|
|
37
35
|
*/
|
|
38
|
-
export function isDataObjectClass(
|
|
36
|
+
export function isDataObjectClass(
|
|
37
|
+
obj: LoadableObjectClass,
|
|
38
|
+
): obj is InternalDataObjectClass<IFluidLoadable>;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Runtime check to determine if a class is a DataObject type.
|
|
42
42
|
*/
|
|
43
|
-
export function isDataObjectClass(
|
|
43
|
+
export function isDataObjectClass(
|
|
44
|
+
obj: LoadableObjectClass,
|
|
45
|
+
): obj is InternalDataObjectClass<IFluidLoadable> {
|
|
44
46
|
const maybe = obj as Partial<InternalDataObjectClass<IFluidLoadable>> | undefined;
|
|
45
|
-
|
|
47
|
+
const isDataObject =
|
|
46
48
|
maybe?.factory?.IFluidDataStoreFactory !== undefined &&
|
|
47
|
-
maybe
|
|
48
|
-
|
|
49
|
+
maybe.factory.IFluidDataStoreFactory === maybe.factory;
|
|
50
|
+
|
|
51
|
+
if (
|
|
52
|
+
isDataObject ===
|
|
53
|
+
((obj as Partial<ISharedObjectKind<IFluidLoadable>>).getFactory !== undefined)
|
|
54
|
+
) {
|
|
55
|
+
// TODO: Currently nothing in the types or docs requires an actual DataObjectClass to not have a member called "getFactory" so there is a risk of this being a false positive.
|
|
56
|
+
// Refactoring the use of LoadableObjectClass such that explicit down casting is not required (for example by having a single factory API shared by both cases) could avoid problems like this.
|
|
57
|
+
throw new UsageError("Invalid LoadableObjectClass");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return isDataObject;
|
|
49
61
|
}
|
|
50
62
|
|
|
51
63
|
/**
|
|
52
64
|
* Runtime check to determine if a class is a SharedObject type
|
|
53
65
|
*/
|
|
54
|
-
export
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
export function isSharedObjectKind(
|
|
67
|
+
obj: LoadableObjectClass,
|
|
68
|
+
): obj is ISharedObjectKind<IFluidLoadable> {
|
|
69
|
+
return !isDataObjectClass(obj);
|
|
70
|
+
}
|
|
58
71
|
|
|
59
72
|
/**
|
|
60
73
|
* The ContainerSchema consists of initialObjects and dynamicObjectTypes. These types can be
|
|
@@ -67,8 +80,8 @@ export const parseDataObjectsFromSharedObjects = (
|
|
|
67
80
|
const registryEntries = new Set<NamedFluidDataStoreRegistryEntry>();
|
|
68
81
|
const sharedObjects = new Set<IChannelFactory>();
|
|
69
82
|
|
|
70
|
-
const tryAddObject = (obj:
|
|
71
|
-
if (
|
|
83
|
+
const tryAddObject = (obj: LoadableObjectClass): void => {
|
|
84
|
+
if (isSharedObjectKind(obj)) {
|
|
72
85
|
sharedObjects.add(obj.getFactory());
|
|
73
86
|
} else if (isDataObjectClass(obj)) {
|
|
74
87
|
registryEntries.add([obj.factory.type, Promise.resolve(obj.factory)]);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
// Type tests for InitialObjects
|
|
6
|
-
{
|
|
7
|
-
// ContainerSchema case
|
|
8
|
-
{
|
|
9
|
-
}
|
|
10
|
-
// LoadableObjectClass case
|
|
11
|
-
{
|
|
12
|
-
}
|
|
13
|
-
// SharedObject case
|
|
14
|
-
{
|
|
15
|
-
}
|
|
16
|
-
// DataObject case
|
|
17
|
-
{
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=fluidContainer.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fluidContainer.spec.js","sourceRoot":"","sources":["../../src/test/fluidContainer.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH,gCAAgC;AAChC;IACC,uBAAuB;IACvB;KAIC;IAgBD,2BAA2B;IAC3B;KAIC;IAED,oBAAoB;IACpB;KAIC;IAED,kBAAkB;IAClB;KAIC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport type { IChannel } from \"@fluidframework/datastore-definitions\";\nimport type { InitialObjects } from \"../index.js\";\nimport type {\n\tContainerSchema,\n\tDataObjectClass,\n\tLoadableObjectClass,\n\tSharedObjectClass,\n} from \"../types.js\";\n\n/**\n * Compile time assert that A is assignable to (extends) B.\n * To use, simply define a type:\n * `type _check = requireAssignableTo<T, Expected>;`\n */\nexport type requireAssignableTo<_A extends B, B> = true;\n\n// Type tests for InitialObjects\n{\n\t// ContainerSchema case\n\t{\n\t\ttype _a = InitialObjects<ContainerSchema>;\n\t\ttype _b = requireAssignableTo<_a, Record<string, IFluidLoadable>>;\n\t\ttype _c = requireAssignableTo<Record<string, IFluidLoadable>, _a>;\n\t}\n\ttype ContainerSchemaWith<T> = ContainerSchema & { initialObjects: { item: T } };\n\tinterface TestSharedObject extends IChannel {\n\t\tx: number;\n\t}\n\tinterface TestSharedObjectFactory extends SharedObjectClass<TestSharedObject> {\n\t\ty: number;\n\t}\n\n\tinterface TestDataObject extends IFluidLoadable {\n\t\tx: number;\n\t}\n\tinterface TestDataObjectFactory extends DataObjectClass<TestDataObject> {\n\t\ty: number;\n\t}\n\n\t// LoadableObjectClass case\n\t{\n\t\ttype _a = InitialObjects<ContainerSchemaWith<LoadableObjectClass>>[\"item\"];\n\t\ttype _b = requireAssignableTo<_a, IFluidLoadable>;\n\t\ttype _c = requireAssignableTo<IFluidLoadable, _a>;\n\t}\n\n\t// SharedObject case\n\t{\n\t\ttype _a = InitialObjects<ContainerSchemaWith<TestSharedObjectFactory>>[\"item\"];\n\t\ttype _b = requireAssignableTo<_a, TestSharedObject>;\n\t\ttype _c = requireAssignableTo<TestSharedObject, _a>;\n\t}\n\n\t// DataObject case\n\t{\n\t\ttype _a = InitialObjects<ContainerSchemaWith<TestDataObjectFactory>>[\"item\"];\n\t\ttype _b = requireAssignableTo<_a, TestDataObject>;\n\t\ttype _c = requireAssignableTo<TestDataObject, _a>;\n\t}\n}\n"]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
use_current_InterfaceDeclaration_ContainerSchema(get_old_InterfaceDeclaration_ContainerSchema());
|
|
2
|
-
use_old_InterfaceDeclaration_ContainerSchema(
|
|
3
|
-
// @ts-expect-error compatibility expected to be broken
|
|
4
|
-
get_current_InterfaceDeclaration_ContainerSchema());
|
|
5
|
-
use_current_TypeAliasDeclaration_DataObjectClass(get_old_TypeAliasDeclaration_DataObjectClass());
|
|
6
|
-
use_old_TypeAliasDeclaration_DataObjectClass(get_current_TypeAliasDeclaration_DataObjectClass());
|
|
7
|
-
use_current_InterfaceDeclaration_IConnection(get_old_InterfaceDeclaration_IConnection());
|
|
8
|
-
use_old_InterfaceDeclaration_IConnection(get_current_InterfaceDeclaration_IConnection());
|
|
9
|
-
use_current_InterfaceDeclaration_IFluidContainer(get_old_InterfaceDeclaration_IFluidContainer());
|
|
10
|
-
use_old_InterfaceDeclaration_IFluidContainer(get_current_InterfaceDeclaration_IFluidContainer());
|
|
11
|
-
use_current_InterfaceDeclaration_IFluidContainerEvents(get_old_InterfaceDeclaration_IFluidContainerEvents());
|
|
12
|
-
use_old_InterfaceDeclaration_IFluidContainerEvents(get_current_InterfaceDeclaration_IFluidContainerEvents());
|
|
13
|
-
use_current_InterfaceDeclaration_IMember(get_old_InterfaceDeclaration_IMember());
|
|
14
|
-
use_old_InterfaceDeclaration_IMember(get_current_InterfaceDeclaration_IMember());
|
|
15
|
-
use_current_InterfaceDeclaration_IProvideRootDataObject(get_old_InterfaceDeclaration_IProvideRootDataObject());
|
|
16
|
-
use_old_InterfaceDeclaration_IProvideRootDataObject(get_current_InterfaceDeclaration_IProvideRootDataObject());
|
|
17
|
-
use_current_InterfaceDeclaration_IRootDataObject(get_old_InterfaceDeclaration_IRootDataObject());
|
|
18
|
-
use_old_InterfaceDeclaration_IRootDataObject(get_current_InterfaceDeclaration_IRootDataObject());
|
|
19
|
-
use_current_InterfaceDeclaration_IServiceAudience(get_old_InterfaceDeclaration_IServiceAudience());
|
|
20
|
-
use_old_InterfaceDeclaration_IServiceAudience(get_current_InterfaceDeclaration_IServiceAudience());
|
|
21
|
-
use_current_InterfaceDeclaration_IServiceAudienceEvents(get_old_InterfaceDeclaration_IServiceAudienceEvents());
|
|
22
|
-
use_old_InterfaceDeclaration_IServiceAudienceEvents(get_current_InterfaceDeclaration_IServiceAudienceEvents());
|
|
23
|
-
use_current_TypeAliasDeclaration_InitialObjects(get_old_TypeAliasDeclaration_InitialObjects());
|
|
24
|
-
use_old_TypeAliasDeclaration_InitialObjects(get_current_TypeAliasDeclaration_InitialObjects());
|
|
25
|
-
use_current_TypeAliasDeclaration_LoadableObjectClass(get_old_TypeAliasDeclaration_LoadableObjectClass());
|
|
26
|
-
use_old_TypeAliasDeclaration_LoadableObjectClass(get_current_TypeAliasDeclaration_LoadableObjectClass());
|
|
27
|
-
use_current_TypeAliasDeclaration_LoadableObjectClassRecord(get_old_TypeAliasDeclaration_LoadableObjectClassRecord());
|
|
28
|
-
use_old_TypeAliasDeclaration_LoadableObjectClassRecord(get_current_TypeAliasDeclaration_LoadableObjectClassRecord());
|
|
29
|
-
use_current_TypeAliasDeclaration_LoadableObjectCtor(get_old_TypeAliasDeclaration_LoadableObjectCtor());
|
|
30
|
-
use_old_TypeAliasDeclaration_LoadableObjectCtor(get_current_TypeAliasDeclaration_LoadableObjectCtor());
|
|
31
|
-
use_current_TypeAliasDeclaration_LoadableObjectRecord(get_old_TypeAliasDeclaration_LoadableObjectRecord());
|
|
32
|
-
use_old_TypeAliasDeclaration_LoadableObjectRecord(get_current_TypeAliasDeclaration_LoadableObjectRecord());
|
|
33
|
-
use_current_TypeAliasDeclaration_MemberChangedListener(get_old_TypeAliasDeclaration_MemberChangedListener());
|
|
34
|
-
use_old_TypeAliasDeclaration_MemberChangedListener(get_current_TypeAliasDeclaration_MemberChangedListener());
|
|
35
|
-
use_current_TypeAliasDeclaration_Myself(get_old_TypeAliasDeclaration_Myself());
|
|
36
|
-
use_old_TypeAliasDeclaration_Myself(get_current_TypeAliasDeclaration_Myself());
|
|
37
|
-
use_current_RemovedTypeAliasDeclaration_SharedObjectClass(get_old_TypeAliasDeclaration_SharedObjectClass());
|
|
38
|
-
use_old_TypeAliasDeclaration_SharedObjectClass(get_current_RemovedTypeAliasDeclaration_SharedObjectClass());
|
|
39
|
-
use_current_FunctionDeclaration_createDOProviderContainerRuntimeFactory(get_old_FunctionDeclaration_createDOProviderContainerRuntimeFactory());
|
|
40
|
-
use_old_FunctionDeclaration_createDOProviderContainerRuntimeFactory(get_current_FunctionDeclaration_createDOProviderContainerRuntimeFactory());
|
|
41
|
-
use_current_FunctionDeclaration_createFluidContainer(get_old_FunctionDeclaration_createFluidContainer());
|
|
42
|
-
use_old_FunctionDeclaration_createFluidContainer(get_current_FunctionDeclaration_createFluidContainer());
|
|
43
|
-
use_current_FunctionDeclaration_createServiceAudience(get_old_FunctionDeclaration_createServiceAudience());
|
|
44
|
-
use_old_FunctionDeclaration_createServiceAudience(get_current_FunctionDeclaration_createServiceAudience());
|
|
45
|
-
export {};
|
|
46
|
-
//# sourceMappingURL=validateFluidStaticPrevious.generated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateFluidStaticPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateFluidStaticPrevious.generated.ts"],"names":[],"mappings":"AAgCA,gDAAgD,CAC5C,4CAA4C,EAAE,CAAC,CAAC;AAWpD,4CAA4C;AACxC,uDAAuD;AACvD,gDAAgD,EAAE,CAAC,CAAC;AAWxD,gDAAgD,CAC5C,4CAA4C,EAAE,CAAC,CAAC;AAWpD,4CAA4C,CACxC,gDAAgD,EAAE,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D,iDAAiD,CAC7C,qDAAqD,EAAE,CAAC,CAAC;AAW7D,sDAAsD,CAClD,kDAAkD,EAAE,CAAC,CAAC;AAW1D,kDAAkD,CAC9C,sDAAsD,EAAE,CAAC,CAAC;AAW9D,uCAAuC,CACnC,mCAAmC,EAAE,CAAC,CAAC;AAW3C,mCAAmC,CAC/B,uCAAuC,EAAE,CAAC,CAAC;AAW/C,yDAAyD,CACrD,8CAA8C,EAAE,CAAC,CAAC;AAWtD,8CAA8C,CAC1C,yDAAyD,EAAE,CAAC,CAAC;AAWjE,uEAAuE,CACnE,mEAAmE,EAAE,CAAC,CAAC;AAW3E,mEAAmE,CAC/D,uEAAuE,EAAE,CAAC,CAAC;AAW/E,oDAAoD,CAChD,gDAAgD,EAAE,CAAC,CAAC;AAWxD,gDAAgD,CAC5C,oDAAoD,EAAE,CAAC,CAAC;AAW5D,qDAAqD,CACjD,iDAAiD,EAAE,CAAC,CAAC;AAWzD,iDAAiD,CAC7C,qDAAqD,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-test-generator in @fluidframework/build-tools.\n */\nimport type * as old from \"@fluidframework/fluid-static-previous\";\nimport type * as current from \"../../index.js\";\n\n\n// See 'build-tools/src/type-test-generator/compatibility.ts' for more information.\ntype TypeOnly<T> = T extends number\n\t? number\n\t: T extends string\n\t? string\n\t: T extends boolean | bigint | symbol\n\t? T\n\t: {\n\t\t\t[P in keyof T]: TypeOnly<T[P]>;\n\t };\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:\n* \"InterfaceDeclaration_ContainerSchema\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_ContainerSchema():\n TypeOnly<old.ContainerSchema>;\ndeclare function use_current_InterfaceDeclaration_ContainerSchema(\n use: TypeOnly<current.ContainerSchema>): void;\nuse_current_InterfaceDeclaration_ContainerSchema(\n get_old_InterfaceDeclaration_ContainerSchema());\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:\n* \"InterfaceDeclaration_ContainerSchema\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_ContainerSchema():\n TypeOnly<current.ContainerSchema>;\ndeclare function use_old_InterfaceDeclaration_ContainerSchema(\n use: TypeOnly<old.ContainerSchema>): void;\nuse_old_InterfaceDeclaration_ContainerSchema(\n // @ts-expect-error compatibility expected to be broken\n get_current_InterfaceDeclaration_ContainerSchema());\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:\n* \"TypeAliasDeclaration_DataObjectClass\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_DataObjectClass():\n TypeOnly<old.DataObjectClass<any>>;\ndeclare function use_current_TypeAliasDeclaration_DataObjectClass(\n use: TypeOnly<current.DataObjectClass<any>>): void;\nuse_current_TypeAliasDeclaration_DataObjectClass(\n get_old_TypeAliasDeclaration_DataObjectClass());\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:\n* \"TypeAliasDeclaration_DataObjectClass\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_DataObjectClass():\n TypeOnly<current.DataObjectClass<any>>;\ndeclare function use_old_TypeAliasDeclaration_DataObjectClass(\n use: TypeOnly<old.DataObjectClass<any>>): void;\nuse_old_TypeAliasDeclaration_DataObjectClass(\n get_current_TypeAliasDeclaration_DataObjectClass());\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:\n* \"InterfaceDeclaration_IConnection\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IConnection():\n TypeOnly<old.IConnection>;\ndeclare function use_current_InterfaceDeclaration_IConnection(\n use: TypeOnly<current.IConnection>): void;\nuse_current_InterfaceDeclaration_IConnection(\n get_old_InterfaceDeclaration_IConnection());\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:\n* \"InterfaceDeclaration_IConnection\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IConnection():\n TypeOnly<current.IConnection>;\ndeclare function use_old_InterfaceDeclaration_IConnection(\n use: TypeOnly<old.IConnection>): void;\nuse_old_InterfaceDeclaration_IConnection(\n get_current_InterfaceDeclaration_IConnection());\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:\n* \"InterfaceDeclaration_IFluidContainer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IFluidContainer():\n TypeOnly<old.IFluidContainer>;\ndeclare function use_current_InterfaceDeclaration_IFluidContainer(\n use: TypeOnly<current.IFluidContainer>): void;\nuse_current_InterfaceDeclaration_IFluidContainer(\n get_old_InterfaceDeclaration_IFluidContainer());\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:\n* \"InterfaceDeclaration_IFluidContainer\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IFluidContainer():\n TypeOnly<current.IFluidContainer>;\ndeclare function use_old_InterfaceDeclaration_IFluidContainer(\n use: TypeOnly<old.IFluidContainer>): void;\nuse_old_InterfaceDeclaration_IFluidContainer(\n get_current_InterfaceDeclaration_IFluidContainer());\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:\n* \"InterfaceDeclaration_IFluidContainerEvents\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IFluidContainerEvents():\n TypeOnly<old.IFluidContainerEvents>;\ndeclare function use_current_InterfaceDeclaration_IFluidContainerEvents(\n use: TypeOnly<current.IFluidContainerEvents>): void;\nuse_current_InterfaceDeclaration_IFluidContainerEvents(\n get_old_InterfaceDeclaration_IFluidContainerEvents());\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:\n* \"InterfaceDeclaration_IFluidContainerEvents\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IFluidContainerEvents():\n TypeOnly<current.IFluidContainerEvents>;\ndeclare function use_old_InterfaceDeclaration_IFluidContainerEvents(\n use: TypeOnly<old.IFluidContainerEvents>): void;\nuse_old_InterfaceDeclaration_IFluidContainerEvents(\n get_current_InterfaceDeclaration_IFluidContainerEvents());\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:\n* \"InterfaceDeclaration_IMember\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IMember():\n TypeOnly<old.IMember>;\ndeclare function use_current_InterfaceDeclaration_IMember(\n use: TypeOnly<current.IMember>): void;\nuse_current_InterfaceDeclaration_IMember(\n get_old_InterfaceDeclaration_IMember());\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:\n* \"InterfaceDeclaration_IMember\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IMember():\n TypeOnly<current.IMember>;\ndeclare function use_old_InterfaceDeclaration_IMember(\n use: TypeOnly<old.IMember>): void;\nuse_old_InterfaceDeclaration_IMember(\n get_current_InterfaceDeclaration_IMember());\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:\n* \"InterfaceDeclaration_IProvideRootDataObject\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IProvideRootDataObject():\n TypeOnly<old.IProvideRootDataObject>;\ndeclare function use_current_InterfaceDeclaration_IProvideRootDataObject(\n use: TypeOnly<current.IProvideRootDataObject>): void;\nuse_current_InterfaceDeclaration_IProvideRootDataObject(\n get_old_InterfaceDeclaration_IProvideRootDataObject());\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:\n* \"InterfaceDeclaration_IProvideRootDataObject\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IProvideRootDataObject():\n TypeOnly<current.IProvideRootDataObject>;\ndeclare function use_old_InterfaceDeclaration_IProvideRootDataObject(\n use: TypeOnly<old.IProvideRootDataObject>): void;\nuse_old_InterfaceDeclaration_IProvideRootDataObject(\n get_current_InterfaceDeclaration_IProvideRootDataObject());\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:\n* \"InterfaceDeclaration_IRootDataObject\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IRootDataObject():\n TypeOnly<old.IRootDataObject>;\ndeclare function use_current_InterfaceDeclaration_IRootDataObject(\n use: TypeOnly<current.IRootDataObject>): void;\nuse_current_InterfaceDeclaration_IRootDataObject(\n get_old_InterfaceDeclaration_IRootDataObject());\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:\n* \"InterfaceDeclaration_IRootDataObject\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IRootDataObject():\n TypeOnly<current.IRootDataObject>;\ndeclare function use_old_InterfaceDeclaration_IRootDataObject(\n use: TypeOnly<old.IRootDataObject>): void;\nuse_old_InterfaceDeclaration_IRootDataObject(\n get_current_InterfaceDeclaration_IRootDataObject());\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:\n* \"InterfaceDeclaration_IServiceAudience\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IServiceAudience():\n TypeOnly<old.IServiceAudience<any>>;\ndeclare function use_current_InterfaceDeclaration_IServiceAudience(\n use: TypeOnly<current.IServiceAudience<any>>): void;\nuse_current_InterfaceDeclaration_IServiceAudience(\n get_old_InterfaceDeclaration_IServiceAudience());\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:\n* \"InterfaceDeclaration_IServiceAudience\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IServiceAudience():\n TypeOnly<current.IServiceAudience<any>>;\ndeclare function use_old_InterfaceDeclaration_IServiceAudience(\n use: TypeOnly<old.IServiceAudience<any>>): void;\nuse_old_InterfaceDeclaration_IServiceAudience(\n get_current_InterfaceDeclaration_IServiceAudience());\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:\n* \"InterfaceDeclaration_IServiceAudienceEvents\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IServiceAudienceEvents():\n TypeOnly<old.IServiceAudienceEvents<any>>;\ndeclare function use_current_InterfaceDeclaration_IServiceAudienceEvents(\n use: TypeOnly<current.IServiceAudienceEvents<any>>): void;\nuse_current_InterfaceDeclaration_IServiceAudienceEvents(\n get_old_InterfaceDeclaration_IServiceAudienceEvents());\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:\n* \"InterfaceDeclaration_IServiceAudienceEvents\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IServiceAudienceEvents():\n TypeOnly<current.IServiceAudienceEvents<any>>;\ndeclare function use_old_InterfaceDeclaration_IServiceAudienceEvents(\n use: TypeOnly<old.IServiceAudienceEvents<any>>): void;\nuse_old_InterfaceDeclaration_IServiceAudienceEvents(\n get_current_InterfaceDeclaration_IServiceAudienceEvents());\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:\n* \"TypeAliasDeclaration_InitialObjects\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_InitialObjects():\n TypeOnly<old.InitialObjects<any>>;\ndeclare function use_current_TypeAliasDeclaration_InitialObjects(\n use: TypeOnly<current.InitialObjects<any>>): void;\nuse_current_TypeAliasDeclaration_InitialObjects(\n get_old_TypeAliasDeclaration_InitialObjects());\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:\n* \"TypeAliasDeclaration_InitialObjects\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_InitialObjects():\n TypeOnly<current.InitialObjects<any>>;\ndeclare function use_old_TypeAliasDeclaration_InitialObjects(\n use: TypeOnly<old.InitialObjects<any>>): void;\nuse_old_TypeAliasDeclaration_InitialObjects(\n get_current_TypeAliasDeclaration_InitialObjects());\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:\n* \"TypeAliasDeclaration_LoadableObjectClass\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_LoadableObjectClass():\n TypeOnly<old.LoadableObjectClass<any>>;\ndeclare function use_current_TypeAliasDeclaration_LoadableObjectClass(\n use: TypeOnly<current.LoadableObjectClass>): void;\nuse_current_TypeAliasDeclaration_LoadableObjectClass(\n get_old_TypeAliasDeclaration_LoadableObjectClass());\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:\n* \"TypeAliasDeclaration_LoadableObjectClass\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_LoadableObjectClass():\n TypeOnly<current.LoadableObjectClass>;\ndeclare function use_old_TypeAliasDeclaration_LoadableObjectClass(\n use: TypeOnly<old.LoadableObjectClass<any>>): void;\nuse_old_TypeAliasDeclaration_LoadableObjectClass(\n get_current_TypeAliasDeclaration_LoadableObjectClass());\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:\n* \"TypeAliasDeclaration_LoadableObjectClassRecord\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_LoadableObjectClassRecord():\n TypeOnly<old.LoadableObjectClassRecord>;\ndeclare function use_current_TypeAliasDeclaration_LoadableObjectClassRecord(\n use: TypeOnly<current.LoadableObjectClassRecord>): void;\nuse_current_TypeAliasDeclaration_LoadableObjectClassRecord(\n get_old_TypeAliasDeclaration_LoadableObjectClassRecord());\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:\n* \"TypeAliasDeclaration_LoadableObjectClassRecord\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_LoadableObjectClassRecord():\n TypeOnly<current.LoadableObjectClassRecord>;\ndeclare function use_old_TypeAliasDeclaration_LoadableObjectClassRecord(\n use: TypeOnly<old.LoadableObjectClassRecord>): void;\nuse_old_TypeAliasDeclaration_LoadableObjectClassRecord(\n get_current_TypeAliasDeclaration_LoadableObjectClassRecord());\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:\n* \"TypeAliasDeclaration_LoadableObjectCtor\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_LoadableObjectCtor():\n TypeOnly<old.LoadableObjectCtor<any>>;\ndeclare function use_current_TypeAliasDeclaration_LoadableObjectCtor(\n use: TypeOnly<current.LoadableObjectCtor<any>>): void;\nuse_current_TypeAliasDeclaration_LoadableObjectCtor(\n get_old_TypeAliasDeclaration_LoadableObjectCtor());\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:\n* \"TypeAliasDeclaration_LoadableObjectCtor\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_LoadableObjectCtor():\n TypeOnly<current.LoadableObjectCtor<any>>;\ndeclare function use_old_TypeAliasDeclaration_LoadableObjectCtor(\n use: TypeOnly<old.LoadableObjectCtor<any>>): void;\nuse_old_TypeAliasDeclaration_LoadableObjectCtor(\n get_current_TypeAliasDeclaration_LoadableObjectCtor());\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:\n* \"TypeAliasDeclaration_LoadableObjectRecord\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_LoadableObjectRecord():\n TypeOnly<old.LoadableObjectRecord>;\ndeclare function use_current_TypeAliasDeclaration_LoadableObjectRecord(\n use: TypeOnly<current.LoadableObjectRecord>): void;\nuse_current_TypeAliasDeclaration_LoadableObjectRecord(\n get_old_TypeAliasDeclaration_LoadableObjectRecord());\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:\n* \"TypeAliasDeclaration_LoadableObjectRecord\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_LoadableObjectRecord():\n TypeOnly<current.LoadableObjectRecord>;\ndeclare function use_old_TypeAliasDeclaration_LoadableObjectRecord(\n use: TypeOnly<old.LoadableObjectRecord>): void;\nuse_old_TypeAliasDeclaration_LoadableObjectRecord(\n get_current_TypeAliasDeclaration_LoadableObjectRecord());\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:\n* \"TypeAliasDeclaration_MemberChangedListener\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_MemberChangedListener():\n TypeOnly<old.MemberChangedListener<any>>;\ndeclare function use_current_TypeAliasDeclaration_MemberChangedListener(\n use: TypeOnly<current.MemberChangedListener<any>>): void;\nuse_current_TypeAliasDeclaration_MemberChangedListener(\n get_old_TypeAliasDeclaration_MemberChangedListener());\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:\n* \"TypeAliasDeclaration_MemberChangedListener\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_MemberChangedListener():\n TypeOnly<current.MemberChangedListener<any>>;\ndeclare function use_old_TypeAliasDeclaration_MemberChangedListener(\n use: TypeOnly<old.MemberChangedListener<any>>): void;\nuse_old_TypeAliasDeclaration_MemberChangedListener(\n get_current_TypeAliasDeclaration_MemberChangedListener());\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:\n* \"TypeAliasDeclaration_Myself\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_Myself():\n TypeOnly<old.Myself>;\ndeclare function use_current_TypeAliasDeclaration_Myself(\n use: TypeOnly<current.Myself>): void;\nuse_current_TypeAliasDeclaration_Myself(\n get_old_TypeAliasDeclaration_Myself());\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:\n* \"TypeAliasDeclaration_Myself\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_Myself():\n TypeOnly<current.Myself>;\ndeclare function use_old_TypeAliasDeclaration_Myself(\n use: TypeOnly<old.Myself>): void;\nuse_old_TypeAliasDeclaration_Myself(\n get_current_TypeAliasDeclaration_Myself());\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:\n* \"RemovedTypeAliasDeclaration_SharedObjectClass\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_SharedObjectClass():\n TypeOnly<old.SharedObjectClass<any>>;\ndeclare function use_current_RemovedTypeAliasDeclaration_SharedObjectClass(\n use: TypeOnly<current.SharedObjectClass<any>>): void;\nuse_current_RemovedTypeAliasDeclaration_SharedObjectClass(\n get_old_TypeAliasDeclaration_SharedObjectClass());\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:\n* \"RemovedTypeAliasDeclaration_SharedObjectClass\": {\"backCompat\": false}\n*/\ndeclare function get_current_RemovedTypeAliasDeclaration_SharedObjectClass():\n TypeOnly<current.SharedObjectClass<any>>;\ndeclare function use_old_TypeAliasDeclaration_SharedObjectClass(\n use: TypeOnly<old.SharedObjectClass<any>>): void;\nuse_old_TypeAliasDeclaration_SharedObjectClass(\n get_current_RemovedTypeAliasDeclaration_SharedObjectClass());\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:\n* \"FunctionDeclaration_createDOProviderContainerRuntimeFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_createDOProviderContainerRuntimeFactory():\n TypeOnly<typeof old.createDOProviderContainerRuntimeFactory>;\ndeclare function use_current_FunctionDeclaration_createDOProviderContainerRuntimeFactory(\n use: TypeOnly<typeof current.createDOProviderContainerRuntimeFactory>): void;\nuse_current_FunctionDeclaration_createDOProviderContainerRuntimeFactory(\n get_old_FunctionDeclaration_createDOProviderContainerRuntimeFactory());\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:\n* \"FunctionDeclaration_createDOProviderContainerRuntimeFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_createDOProviderContainerRuntimeFactory():\n TypeOnly<typeof current.createDOProviderContainerRuntimeFactory>;\ndeclare function use_old_FunctionDeclaration_createDOProviderContainerRuntimeFactory(\n use: TypeOnly<typeof old.createDOProviderContainerRuntimeFactory>): void;\nuse_old_FunctionDeclaration_createDOProviderContainerRuntimeFactory(\n get_current_FunctionDeclaration_createDOProviderContainerRuntimeFactory());\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:\n* \"FunctionDeclaration_createFluidContainer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_createFluidContainer():\n TypeOnly<typeof old.createFluidContainer>;\ndeclare function use_current_FunctionDeclaration_createFluidContainer(\n use: TypeOnly<typeof current.createFluidContainer>): void;\nuse_current_FunctionDeclaration_createFluidContainer(\n get_old_FunctionDeclaration_createFluidContainer());\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:\n* \"FunctionDeclaration_createFluidContainer\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_createFluidContainer():\n TypeOnly<typeof current.createFluidContainer>;\ndeclare function use_old_FunctionDeclaration_createFluidContainer(\n use: TypeOnly<typeof old.createFluidContainer>): void;\nuse_old_FunctionDeclaration_createFluidContainer(\n get_current_FunctionDeclaration_createFluidContainer());\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:\n* \"FunctionDeclaration_createServiceAudience\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_createServiceAudience():\n TypeOnly<typeof old.createServiceAudience>;\ndeclare function use_current_FunctionDeclaration_createServiceAudience(\n use: TypeOnly<typeof current.createServiceAudience>): void;\nuse_current_FunctionDeclaration_createServiceAudience(\n get_old_FunctionDeclaration_createServiceAudience());\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:\n* \"FunctionDeclaration_createServiceAudience\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_createServiceAudience():\n TypeOnly<typeof current.createServiceAudience>;\ndeclare function use_old_FunctionDeclaration_createServiceAudience(\n use: TypeOnly<typeof old.createServiceAudience>): void;\nuse_old_FunctionDeclaration_createServiceAudience(\n get_current_FunctionDeclaration_createServiceAudience());\n"]}
|
package/lib/test/utils.spec.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { strict as assert } from "node:assert";
|
|
6
|
-
import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct";
|
|
7
|
-
import { MapFactory, SharedMap } from "@fluidframework/map";
|
|
8
|
-
import { SharedString, SharedStringFactory } from "@fluidframework/sequence";
|
|
9
|
-
import { parseDataObjectsFromSharedObjects } from "../utils.js";
|
|
10
|
-
class TestDataObject extends DataObject {
|
|
11
|
-
}
|
|
12
|
-
TestDataObject.Name = "@fluid-example/test-data-object";
|
|
13
|
-
TestDataObject.factory = new DataObjectFactory(TestDataObject.Name, TestDataObject, [], {});
|
|
14
|
-
describe("parseDataObjectsFromSharedObjects", () => {
|
|
15
|
-
it("should be able to handle basic DDS types", () => {
|
|
16
|
-
const schema = {
|
|
17
|
-
initialObjects: {
|
|
18
|
-
map: SharedMap,
|
|
19
|
-
text: SharedString,
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
const [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);
|
|
23
|
-
assert.strictEqual(registryEntries.length, 0, "We should have no registry entries");
|
|
24
|
-
assert.strictEqual(sharedObjects.length, 2, "We should have 2 shared objects");
|
|
25
|
-
const types = sharedObjects.map((item) => item.type);
|
|
26
|
-
assert.strictEqual(types[0], MapFactory.Type, "SharedMap should be included");
|
|
27
|
-
assert.strictEqual(types[1], SharedStringFactory.Type, "SharedString should be included");
|
|
28
|
-
});
|
|
29
|
-
it("should be able to handle dup DDS types", () => {
|
|
30
|
-
const schema = {
|
|
31
|
-
initialObjects: {
|
|
32
|
-
map: SharedMap,
|
|
33
|
-
text: SharedString,
|
|
34
|
-
text2: SharedString,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
const [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);
|
|
38
|
-
assert.strictEqual(registryEntries.length, 0, "We should have no registry entries");
|
|
39
|
-
assert.strictEqual(sharedObjects.length, 2, "We should have 2 shared objects");
|
|
40
|
-
const types = sharedObjects.map((item) => item.type);
|
|
41
|
-
assert.strictEqual(types[0], MapFactory.Type, "SharedMap should be included");
|
|
42
|
-
assert.strictEqual(types[1], SharedStringFactory.Type, "SharedString should be included");
|
|
43
|
-
});
|
|
44
|
-
it("should be able to handle Data Objects", () => {
|
|
45
|
-
const schema = {
|
|
46
|
-
initialObjects: {
|
|
47
|
-
map: SharedMap,
|
|
48
|
-
do: TestDataObject,
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
const [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);
|
|
52
|
-
assert.strictEqual(registryEntries.length, 1, "We should have one registry entry");
|
|
53
|
-
assert.strictEqual(sharedObjects.length, 1, "We should have 1 shared object");
|
|
54
|
-
const types = registryEntries.map((item) => item[0]);
|
|
55
|
-
assert.strictEqual(types[0], TestDataObject.Name, "TestDataObject should be included");
|
|
56
|
-
});
|
|
57
|
-
it("should be able to dedup Data Objects", () => {
|
|
58
|
-
const schema = {
|
|
59
|
-
initialObjects: {
|
|
60
|
-
map: SharedMap,
|
|
61
|
-
do: TestDataObject,
|
|
62
|
-
do2: TestDataObject,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
const [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);
|
|
66
|
-
assert.strictEqual(registryEntries.length, 1, "We should have one registry entry");
|
|
67
|
-
assert.strictEqual(sharedObjects.length, 1, "We should have 1 shared object");
|
|
68
|
-
const types = registryEntries.map((item) => item[0]);
|
|
69
|
-
assert.strictEqual(types[0], TestDataObject.Name, "TestDataObject should be included");
|
|
70
|
-
});
|
|
71
|
-
it("should be able to dedup Data Objects even if passed as dynamic types", () => {
|
|
72
|
-
const schema = {
|
|
73
|
-
initialObjects: {
|
|
74
|
-
map: SharedMap,
|
|
75
|
-
do: TestDataObject,
|
|
76
|
-
},
|
|
77
|
-
dynamicObjectTypes: [SharedString, TestDataObject],
|
|
78
|
-
};
|
|
79
|
-
const [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);
|
|
80
|
-
assert.strictEqual(registryEntries.length, 1, "We should have one registry entry");
|
|
81
|
-
assert.strictEqual(sharedObjects.length, 2, "We should have 2 shared object");
|
|
82
|
-
const types = registryEntries.map((item) => item[0]);
|
|
83
|
-
assert.strictEqual(types[0], TestDataObject.Name, "TestDataObject should be included");
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
//# sourceMappingURL=utils.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.spec.js","sourceRoot":"","sources":["../../src/test/utils.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACzE,O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,gCAAgC,CAAC,CAAC;QAE9E,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,IAAI,EAAE,mCAAmC,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"node:assert\";\nimport { DataObject, DataObjectFactory } from \"@fluidframework/aqueduct\";\nimport { MapFactory, SharedMap } from \"@fluidframework/map\";\nimport { SharedString, SharedStringFactory } from \"@fluidframework/sequence\";\nimport { parseDataObjectsFromSharedObjects } from \"../utils.js\";\nimport { type ContainerSchema } from \"../types.js\";\n\nclass TestDataObject extends DataObject {\n\tpublic static readonly Name = \"@fluid-example/test-data-object\";\n\n\tpublic static readonly factory = new DataObjectFactory(\n\t\tTestDataObject.Name,\n\t\tTestDataObject,\n\t\t[],\n\t\t{},\n\t);\n}\n\ndescribe(\"parseDataObjectsFromSharedObjects\", () => {\n\tit(\"should be able to handle basic DDS types\", () => {\n\t\tconst schema = {\n\t\t\tinitialObjects: {\n\t\t\t\tmap: SharedMap,\n\t\t\t\ttext: SharedString,\n\t\t\t},\n\t\t} satisfies ContainerSchema;\n\t\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\n\t\tassert.strictEqual(registryEntries.length, 0, \"We should have no registry entries\");\n\t\tassert.strictEqual(sharedObjects.length, 2, \"We should have 2 shared objects\");\n\n\t\tconst types = sharedObjects.map((item) => item.type);\n\t\tassert.strictEqual(types[0], MapFactory.Type, \"SharedMap should be included\");\n\t\tassert.strictEqual(types[1], SharedStringFactory.Type, \"SharedString should be included\");\n\t});\n\n\tit(\"should be able to handle dup DDS types\", () => {\n\t\tconst schema = {\n\t\t\tinitialObjects: {\n\t\t\t\tmap: SharedMap,\n\t\t\t\ttext: SharedString,\n\t\t\t\ttext2: SharedString,\n\t\t\t},\n\t\t} satisfies ContainerSchema;\n\t\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\n\t\tassert.strictEqual(registryEntries.length, 0, \"We should have no registry entries\");\n\t\tassert.strictEqual(sharedObjects.length, 2, \"We should have 2 shared objects\");\n\n\t\tconst types = sharedObjects.map((item) => item.type);\n\t\tassert.strictEqual(types[0], MapFactory.Type, \"SharedMap should be included\");\n\t\tassert.strictEqual(types[1], SharedStringFactory.Type, \"SharedString should be included\");\n\t});\n\n\tit(\"should be able to handle Data Objects\", () => {\n\t\tconst schema = {\n\t\t\tinitialObjects: {\n\t\t\t\tmap: SharedMap,\n\t\t\t\tdo: TestDataObject,\n\t\t\t},\n\t\t} satisfies ContainerSchema;\n\t\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\n\t\tassert.strictEqual(registryEntries.length, 1, \"We should have one registry entry\");\n\t\tassert.strictEqual(sharedObjects.length, 1, \"We should have 1 shared object\");\n\n\t\tconst types = registryEntries.map((item) => item[0]);\n\t\tassert.strictEqual(types[0], TestDataObject.Name, \"TestDataObject should be included\");\n\t});\n\n\tit(\"should be able to dedup Data Objects\", () => {\n\t\tconst schema = {\n\t\t\tinitialObjects: {\n\t\t\t\tmap: SharedMap,\n\t\t\t\tdo: TestDataObject,\n\t\t\t\tdo2: TestDataObject,\n\t\t\t},\n\t\t} satisfies ContainerSchema;\n\t\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\n\t\tassert.strictEqual(registryEntries.length, 1, \"We should have one registry entry\");\n\t\tassert.strictEqual(sharedObjects.length, 1, \"We should have 1 shared object\");\n\n\t\tconst types = registryEntries.map((item) => item[0]);\n\t\tassert.strictEqual(types[0], TestDataObject.Name, \"TestDataObject should be included\");\n\t});\n\n\tit(\"should be able to dedup Data Objects even if passed as dynamic types\", () => {\n\t\tconst schema: ContainerSchema = {\n\t\t\tinitialObjects: {\n\t\t\t\tmap: SharedMap,\n\t\t\t\tdo: TestDataObject,\n\t\t\t},\n\t\t\tdynamicObjectTypes: [SharedString, TestDataObject],\n\t\t} satisfies ContainerSchema;\n\t\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\n\t\tassert.strictEqual(registryEntries.length, 1, \"We should have one registry entry\");\n\t\tassert.strictEqual(sharedObjects.length, 2, \"We should have 2 shared object\");\n\n\t\tconst types = registryEntries.map((item) => item[0]);\n\t\tassert.strictEqual(types[0], TestDataObject.Name, \"TestDataObject should be included\");\n\t});\n});\n"]}
|