@fluidframework/fluid-static 2.0.0-dev-rc.3.0.0.250606 → 2.0.0-dev-rc.3.0.0.254274
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 +9 -9
- package/dist/fluid-static-alpha.d.ts +12 -9
- package/dist/fluid-static-beta.d.ts +12 -9
- package/dist/fluid-static-public.d.ts +12 -9
- package/dist/fluid-static-untrimmed.d.ts +12 -9
- package/dist/fluidContainer.d.ts +2 -1
- package/dist/fluidContainer.d.ts.map +1 -1
- package/dist/fluidContainer.js +1 -0
- package/dist/fluidContainer.js.map +1 -1
- package/dist/rootDataObject.d.ts +1 -1
- package/dist/rootDataObject.d.ts.map +1 -1
- package/dist/rootDataObject.js +8 -8
- package/dist/rootDataObject.js.map +1 -1
- package/dist/serviceAudience.d.ts +1 -1
- package/dist/serviceAudience.d.ts.map +1 -1
- package/dist/serviceAudience.js.map +1 -1
- package/dist/types.d.ts +10 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -2
- package/dist/utils.js.map +1 -1
- package/lib/fluid-static-alpha.d.ts +12 -9
- package/lib/fluid-static-beta.d.ts +12 -9
- package/lib/fluid-static-public.d.ts +12 -9
- package/lib/fluid-static-untrimmed.d.ts +12 -9
- package/lib/fluidContainer.d.ts +2 -1
- package/lib/fluidContainer.d.ts.map +1 -1
- package/lib/fluidContainer.js +1 -0
- package/lib/fluidContainer.js.map +1 -1
- package/lib/rootDataObject.d.ts +1 -1
- package/lib/rootDataObject.d.ts.map +1 -1
- package/lib/rootDataObject.js +3 -3
- package/lib/rootDataObject.js.map +1 -1
- package/lib/serviceAudience.d.ts +1 -1
- 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 +10 -7
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/lib/utils.d.ts +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +19 -31
- package/src/fluidContainer.ts +3 -1
- package/src/rootDataObject.ts +8 -8
- package/src/serviceAudience.ts +3 -1
- package/src/types.ts +10 -7
- package/src/utils.ts +3 -2
- 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 -42
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceAudience.js","sourceRoot":"","sources":["../src/serviceAudience.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;
|
|
1
|
+
{"version":3,"file":"serviceAudience.js","sourceRoot":"","sources":["../src/serviceAudience.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAYjE;;;;;;;;;GASG;AACH,SAAgB,qBAAqB,CAAoC,KAGxE;IACA,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;AACxE,CAAC;AALD,sDAKC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,eACL,SAAQ,gCAAkD;IA2B1D;IACC;;OAEG;IACc,SAAqB,EACrB,mBAAyD;QAE1E,KAAK,EAAE,CAAC;QAHS,cAAS,GAAT,SAAS,CAAY;QACrB,wBAAmB,GAAnB,mBAAmB,CAAsC;QAxB3E;;;;;;;;;;;;;;;;WAgBG;QACK,gBAAW,GAAG,IAAI,GAAG,EAAmB,CAAC;QAUhD,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;QAEnC,iFAAiF;QACjF,+EAA+E;QAC/E,I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AM,GAAG,UAAU,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/D,IAAI,MAAM,KAAK,SAAS,EAAE;YACzB,MAAM,IAAI,KAAK,CACd,6BAA6B,QAAQ,8CAA8C,CACnF,CAAC;SACF;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACK,qBAAqB,CAAC,MAAe;QAC5C,6BAA6B;QAC7B,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC;IAChD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { type IAudience } from \"@fluidframework/container-definitions\";\nimport { type IContainer } from \"@fluidframework/container-definitions/internal\";\nimport { type IClient } from \"@fluidframework/protocol-definitions\";\n\nimport {\n\ttype IMember,\n\ttype IServiceAudience,\n\ttype IServiceAudienceEvents,\n\ttype Myself,\n} from \"./types.js\";\n\n/**\n * Creates a service audience for the provided container.\n *\n * @param container - The container with which the audience is associated.\n * @param createServiceMember - A function for creating audience members.\n *\n * @typeParam TMember - The {@link IMember} representation used by the audience.\n *\n * @internal\n */\nexport function createServiceAudience<TMember extends IMember = IMember>(props: {\n\tcontainer: IContainer;\n\tcreateServiceMember: (audienceMember: IClient) => TMember;\n}): IServiceAudience<TMember> {\n\treturn new ServiceAudience(props.container, props.createServiceMember);\n}\n\n/**\n * Base class for providing audience information for sessions interacting with {@link IFluidContainer}\n *\n * @remarks\n *\n * This can be extended by different service-specific client packages to additional parameters to\n * the user and client details returned in {@link IMember}.\n *\n * @typeParam TMember - A service-specific {@link IMember} implementation.\n *\n * @internal\n */\nclass ServiceAudience<TMember extends IMember = IMember>\n\textends TypedEventEmitter<IServiceAudienceEvents<TMember>>\n\timplements IServiceAudience<TMember>\n{\n\t/**\n\t * Audience object which includes all the existing members of the {@link IFluidContainer | container}.\n\t */\n\tprivate readonly audience: IAudience;\n\n\t/**\n\t * Retain the most recent member list.\n\t *\n\t * @remarks\n\t *\n\t * This is so we have more information about a member leaving the audience in the `removeMember` event.\n\t *\n\t * It allows us to match the behavior of the `addMember` event where it only fires on a change to the members this\n\t * class exposes (and would actually produce a change in what `getMembers` returns).\n\t *\n\t * It also allows us to provide the client details in the event which makes it easier to find that client connection\n\t * in a map keyed on the `userId` and not `clientId`.\n\t *\n\t * This map will always be up-to-date in a `removeMember` event because it is set once at construction and in\n\t * every `addMember` event. It is mapped `clientId` to `M` to be better work with what the {@link IServiceAudience}\n\t * events provide.\n\t */\n\tprivate lastMembers = new Map<string, TMember>();\n\n\tpublic constructor(\n\t\t/**\n\t\t * Fluid Container to read the audience from.\n\t\t */\n\t\tprivate readonly container: IContainer,\n\t\tprivate readonly createServiceMember: (audienceMember: IClient) => TMember,\n\t) {\n\t\tsuper();\n\t\tthis.audience = container.audience;\n\n\t\t// getMembers will assign lastMembers so the removeMember event has what it needs\n\t\t// in case it would fire before getMembers otherwise gets called the first time\n\t\tthis.getMembers();\n\n\t\tthis.audience.on(\"addMember\", (clientId: string, details: IClient) => {\n\t\t\tif (this.shouldIncludeAsMember(details)) {\n\t\t\t\tconst member = this.getMember(clientId);\n\t\t\t\tthis.emit(\"memberAdded\", clientId, member);\n\t\t\t\tthis.emit(\"membersChanged\");\n\t\t\t}\n\t\t});\n\n\t\tthis.audience.on(\"removeMember\", (clientId: string) => {\n\t\t\tif (this.lastMembers.has(clientId)) {\n\t\t\t\tthis.emit(\"memberRemoved\", clientId, this.lastMembers.get(clientId));\n\t\t\t\tthis.emit(\"membersChanged\");\n\t\t\t}\n\t\t});\n\n\t\tthis.container.on(\"connected\", () => this.emit(\"membersChanged\"));\n\t}\n\n\t/**\n\t * {@inheritDoc IServiceAudience.getMembers}\n\t */\n\tpublic getMembers(): Map<string, TMember> {\n\t\tconst users = new Map<string, TMember>();\n\t\tconst clientMemberMap = new Map<string, TMember>();\n\t\t// Iterate through the members and get the user specifics.\n\t\tfor (const [clientId, member] of this.audience.getMembers()) {\n\t\t\tif (this.shouldIncludeAsMember(member)) {\n\t\t\t\tconst userId = member.user.id;\n\t\t\t\t// Ensure we're tracking the user\n\t\t\t\tlet user = users.get(userId);\n\t\t\t\tif (user === undefined) {\n\t\t\t\t\tuser = this.createServiceMember(member);\n\t\t\t\t\tusers.set(userId, user);\n\t\t\t\t}\n\n\t\t\t\t// Add this connection to their collection\n\t\t\t\tuser.connections.push({ id: clientId, mode: member.mode });\n\t\t\t\tclientMemberMap.set(clientId, user);\n\t\t\t}\n\t\t}\n\t\tthis.lastMembers = clientMemberMap;\n\t\treturn users;\n\t}\n\n\t/**\n\t * {@inheritDoc IServiceAudience.getMyself}\n\t */\n\tpublic getMyself(): Myself<TMember> | undefined {\n\t\tconst clientId = this.container.clientId;\n\t\tif (clientId === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst member = this.getMember(clientId);\n\t\tif (member === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst myself: Myself<TMember> = { ...member, currentConnection: clientId };\n\n\t\treturn myself;\n\t}\n\n\tprivate getMember(clientId: string): TMember | undefined {\n\t\t// Fetch the user ID assoicated with this client ID from the runtime\n\t\tconst internalAudienceMember = this.audience.getMember(clientId);\n\t\tif (internalAudienceMember === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// Return the member object with any other clients associated for this user\n\t\tconst allMembers = this.getMembers();\n\t\tconst member = allMembers.get(internalAudienceMember?.user.id);\n\t\tif (member === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t`Attempted to fetch client ${clientId} that is not part of the current member list`,\n\t\t\t);\n\t\t}\n\t\treturn member;\n\t}\n\n\t/**\n\t * Provides ability for the inheriting class to include/omit specific members.\n\t * An example use case is omitting the summarizer client.\n\t *\n\t * @param member - Member to be included/omitted.\n\t */\n\tprivate shouldIncludeAsMember(member: IClient): boolean {\n\t\t// Include only human members\n\t\treturn member.details.capabilities.interactive;\n\t}\n}\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -34,11 +34,14 @@ export type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = ISh
|
|
|
34
34
|
* constructor that will return the type of the `DataObject`.
|
|
35
35
|
*
|
|
36
36
|
* @typeParam T - The class of the `DataObject`.
|
|
37
|
+
* @privateRemarks
|
|
38
|
+
* Having both `factory` and `LoadableObjectCtor` is redundant, and having `factory` not actually work as a factory is also strange.
|
|
39
|
+
* This may need some refinement.
|
|
37
40
|
* @public
|
|
38
41
|
*/
|
|
39
42
|
export type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
40
43
|
readonly factory: {
|
|
41
|
-
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
44
|
+
readonly IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
42
45
|
};
|
|
43
46
|
} & (new (...args: any[]) => T);
|
|
44
47
|
/**
|
|
@@ -170,7 +173,7 @@ export interface IServiceAudience<M extends IMember> extends IEventProvider<ISer
|
|
|
170
173
|
* member object. The implementation may choose to exclude certain connections from the returned map.
|
|
171
174
|
* E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
|
|
172
175
|
*/
|
|
173
|
-
getMembers():
|
|
176
|
+
getMembers(): ReadonlyMap<string, M>;
|
|
174
177
|
/**
|
|
175
178
|
* Returns the current active user on this client once they are connected. Otherwise, returns undefined.
|
|
176
179
|
*/
|
|
@@ -186,11 +189,11 @@ export interface IConnection {
|
|
|
186
189
|
/**
|
|
187
190
|
* A unique ID for the connection. A single user may have multiple connections, each with a different ID.
|
|
188
191
|
*/
|
|
189
|
-
id: string;
|
|
192
|
+
readonly id: string;
|
|
190
193
|
/**
|
|
191
194
|
* Whether the connection is in read or read/write mode.
|
|
192
195
|
*/
|
|
193
|
-
mode: "write" | "read";
|
|
196
|
+
readonly mode: "write" | "read";
|
|
194
197
|
}
|
|
195
198
|
/**
|
|
196
199
|
* Base interface to be implemented to fetch each service's member.
|
|
@@ -202,17 +205,17 @@ export interface IMember {
|
|
|
202
205
|
/**
|
|
203
206
|
* An ID for the user, unique among each individual user connecting to the session.
|
|
204
207
|
*/
|
|
205
|
-
userId: string;
|
|
208
|
+
readonly userId: string;
|
|
206
209
|
/**
|
|
207
210
|
* The set of connections the user has made, e.g. from multiple tabs or devices.
|
|
208
211
|
*/
|
|
209
|
-
connections: IConnection[];
|
|
212
|
+
readonly connections: IConnection[];
|
|
210
213
|
}
|
|
211
214
|
/**
|
|
212
215
|
* An extended member object that includes currentConnection
|
|
213
216
|
* @public
|
|
214
217
|
*/
|
|
215
218
|
export type Myself<M extends IMember = IMember> = M & {
|
|
216
|
-
currentConnection: string;
|
|
219
|
+
readonly currentConnection: string;
|
|
217
220
|
};
|
|
218
221
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAE5E;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAElE;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAE5E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,IACtE,iBAAiB,CAAC,CAAC,CAAC,GACpB,eAAe,CAAC,CAAC,CAAC,CAAC;AAEtB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA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;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,WAAW,EAAE,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,CAAC,GAAG;IAAE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype IEvent,\n\ttype IEventProvider,\n\ttype IFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\nimport { type ISharedObjectKind } from \"@fluidframework/shared-object-base\";\n\n/**\n * A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.\n * @internal\n */\nexport type LoadableObjectRecord = Record<string, IFluidLoadable>;\n\n/**\n * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`\n * or `SharedObject`.\n * @public\n */\nexport type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;\n\n/**\n * A class object of `DataObject` or `SharedObject`.\n *\n * @typeParam T - The class of the `DataObject` or `SharedObject`.\n * @public\n *\n * @privateRemarks\n * There are some edge cases in TypeScript where the order of the members in a union matter.\n * Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.\n * In this case, its better to have the desired match and/or the simpler type first.\n * 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.\n * This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].\n */\nexport type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =\n\t| ISharedObjectKind<T>\n\t| DataObjectClass<T>;\n\n/**\n * A class that has a factory that can create a `DataObject` and a\n * constructor that will return the type of the `DataObject`.\n *\n * @typeParam T - The class of the `DataObject`.\n * @public\n */\nexport type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {\n\treadonly factory: { IFluidDataStoreFactory: DataObjectClass<T>[\"factory\"] };\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n} & (new (...args: any[]) => T);\n\n/**\n * Represents properties that can be attached to a container.\n * @public\n */\nexport type ContainerAttachProps<T = unknown> = T;\n\n/**\n * Declares the Fluid objects that will be available in the {@link IFluidContainer | Container}.\n *\n * @remarks\n *\n * It includes both the instances of objects that are initially available upon `Container` creation, as well\n * as the types of objects that may be dynamically created throughout the lifetime of the `Container`.\n * @public\n */\nexport interface ContainerSchema {\n\t/**\n\t * Defines loadable objects that will be created when the {@link IFluidContainer | Container} is first created.\n\t *\n\t * @remarks It uses the key as the id and the value as the loadable object to create.\n\t *\n\t * @example\n\t *\n\t * In the example below two objects will be created when the `Container` is first\n\t * created. One with id \"map1\" that will return a `SharedMap` and the other with\n\t * id \"pair1\" that will return a `KeyValueDataObject`.\n\t *\n\t * ```typescript\n\t * {\n\t * map1: SharedMap,\n\t * pair1: KeyValueDataObject,\n\t * }\n\t * ```\n\t */\n\treadonly initialObjects: LoadableObjectClassRecord;\n\n\t/**\n\t * Loadable objects that can be created after the initial {@link IFluidContainer | Container} creation.\n\t *\n\t * @remarks\n\t *\n\t * Types defined in `initialObjects` will always be available and are not required to be provided here.\n\t *\n\t * For best practice it's recommended to define all the dynamic types you create even if they are\n\t * included via initialObjects.\n\t */\n\treadonly dynamicObjectTypes?: readonly LoadableObjectClass[];\n}\n\n/**\n * @internal\n */\nexport interface IProvideRootDataObject {\n\treadonly IRootDataObject: IRootDataObject;\n}\n\n/**\n * Holds the collection of objects that the container was initially created with, as well as provides the ability\n * to dynamically create further objects during usage.\n * @internal\n */\nexport interface IRootDataObject extends IProvideRootDataObject {\n\t/**\n\t * Provides a record of the initial objects defined on creation.\n\t */\n\treadonly initialObjects: LoadableObjectRecord;\n\n\t/**\n\t * Dynamically creates a new detached collaborative object (DDS/DataObject).\n\t *\n\t * @param objectClass - Type of the collaborative object to be created.\n\t *\n\t * @typeParam T - The class of the `DataObject` or `SharedObject`.\n\t */\n\tcreate<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;\n}\n\n/**\n * Signature for {@link IMember} change events.\n *\n * @param clientId - A unique identifier for the client.\n * @param member - The service-specific member object for the client.\n *\n * @see See {@link IServiceAudienceEvents} for usage details.\n * @public\n */\nexport type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;\n\n/**\n * Events that trigger when the roster of members in the Fluid session change.\n *\n * @remarks\n *\n * Only changes that would be reflected in the returned map of {@link IServiceAudience}'s\n * {@link IServiceAudience.getMembers} method will emit events.\n *\n * @typeParam M - A service-specific {@link IMember} implementation.\n * @public\n */\nexport interface IServiceAudienceEvents<M extends IMember> extends IEvent {\n\t/**\n\t * Emitted when a {@link IMember | member}(s) are either added or removed.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"membersChanged\", listener: () => void): void;\n\n\t/**\n\t * Emitted when a {@link IMember | member} joins the audience.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"memberAdded\", listener: MemberChangedListener<M>): void;\n\n\t/**\n\t * Emitted when a {@link IMember | member} leaves the audience.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"memberRemoved\", listener: MemberChangedListener<M>): void;\n}\n\n/**\n * Base interface to be implemented to fetch each service's audience.\n *\n * @remarks\n *\n * The type parameter `M` allows consumers to further extend the client object with service-specific\n * details about the connecting client, such as device information, environment, or a username.\n *\n * @typeParam M - A service-specific {@link IMember} type.\n * @public\n */\nexport interface IServiceAudience<M extends IMember>\n\textends IEventProvider<IServiceAudienceEvents<M>> {\n\t/**\n\t * Returns an map of all users currently in the Fluid session where key is the userId and the value is the\n\t * member object. The implementation may choose to exclude certain connections from the returned map.\n\t * E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.\n\t */\n\tgetMembers():
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype IEvent,\n\ttype IEventProvider,\n\ttype IFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\nimport { type ISharedObjectKind } from \"@fluidframework/shared-object-base\";\n\n/**\n * A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.\n * @internal\n */\nexport type LoadableObjectRecord = Record<string, IFluidLoadable>;\n\n/**\n * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`\n * or `SharedObject`.\n * @public\n */\nexport type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;\n\n/**\n * A class object of `DataObject` or `SharedObject`.\n *\n * @typeParam T - The class of the `DataObject` or `SharedObject`.\n * @public\n *\n * @privateRemarks\n * There are some edge cases in TypeScript where the order of the members in a union matter.\n * Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.\n * In this case, its better to have the desired match and/or the simpler type first.\n * 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.\n * This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].\n */\nexport type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =\n\t| ISharedObjectKind<T>\n\t| DataObjectClass<T>;\n\n/**\n * A class that has a factory that can create a `DataObject` and a\n * constructor that will return the type of the `DataObject`.\n *\n * @typeParam T - The class of the `DataObject`.\n * @privateRemarks\n * Having both `factory` and `LoadableObjectCtor` is redundant, and having `factory` not actually work as a factory is also strange.\n * This may need some refinement.\n * @public\n */\nexport type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {\n\treadonly factory: { readonly IFluidDataStoreFactory: DataObjectClass<T>[\"factory\"] };\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n} & (new (...args: any[]) => T);\n\n/**\n * Represents properties that can be attached to a container.\n * @public\n */\nexport type ContainerAttachProps<T = unknown> = T;\n\n/**\n * Declares the Fluid objects that will be available in the {@link IFluidContainer | Container}.\n *\n * @remarks\n *\n * It includes both the instances of objects that are initially available upon `Container` creation, as well\n * as the types of objects that may be dynamically created throughout the lifetime of the `Container`.\n * @public\n */\nexport interface ContainerSchema {\n\t/**\n\t * Defines loadable objects that will be created when the {@link IFluidContainer | Container} is first created.\n\t *\n\t * @remarks It uses the key as the id and the value as the loadable object to create.\n\t *\n\t * @example\n\t *\n\t * In the example below two objects will be created when the `Container` is first\n\t * created. One with id \"map1\" that will return a `SharedMap` and the other with\n\t * id \"pair1\" that will return a `KeyValueDataObject`.\n\t *\n\t * ```typescript\n\t * {\n\t * map1: SharedMap,\n\t * pair1: KeyValueDataObject,\n\t * }\n\t * ```\n\t */\n\treadonly initialObjects: LoadableObjectClassRecord;\n\n\t/**\n\t * Loadable objects that can be created after the initial {@link IFluidContainer | Container} creation.\n\t *\n\t * @remarks\n\t *\n\t * Types defined in `initialObjects` will always be available and are not required to be provided here.\n\t *\n\t * For best practice it's recommended to define all the dynamic types you create even if they are\n\t * included via initialObjects.\n\t */\n\treadonly dynamicObjectTypes?: readonly LoadableObjectClass[];\n}\n\n/**\n * @internal\n */\nexport interface IProvideRootDataObject {\n\treadonly IRootDataObject: IRootDataObject;\n}\n\n/**\n * Holds the collection of objects that the container was initially created with, as well as provides the ability\n * to dynamically create further objects during usage.\n * @internal\n */\nexport interface IRootDataObject extends IProvideRootDataObject {\n\t/**\n\t * Provides a record of the initial objects defined on creation.\n\t */\n\treadonly initialObjects: LoadableObjectRecord;\n\n\t/**\n\t * Dynamically creates a new detached collaborative object (DDS/DataObject).\n\t *\n\t * @param objectClass - Type of the collaborative object to be created.\n\t *\n\t * @typeParam T - The class of the `DataObject` or `SharedObject`.\n\t */\n\tcreate<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;\n}\n\n/**\n * Signature for {@link IMember} change events.\n *\n * @param clientId - A unique identifier for the client.\n * @param member - The service-specific member object for the client.\n *\n * @see See {@link IServiceAudienceEvents} for usage details.\n * @public\n */\nexport type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;\n\n/**\n * Events that trigger when the roster of members in the Fluid session change.\n *\n * @remarks\n *\n * Only changes that would be reflected in the returned map of {@link IServiceAudience}'s\n * {@link IServiceAudience.getMembers} method will emit events.\n *\n * @typeParam M - A service-specific {@link IMember} implementation.\n * @public\n */\nexport interface IServiceAudienceEvents<M extends IMember> extends IEvent {\n\t/**\n\t * Emitted when a {@link IMember | member}(s) are either added or removed.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"membersChanged\", listener: () => void): void;\n\n\t/**\n\t * Emitted when a {@link IMember | member} joins the audience.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"memberAdded\", listener: MemberChangedListener<M>): void;\n\n\t/**\n\t * Emitted when a {@link IMember | member} leaves the audience.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"memberRemoved\", listener: MemberChangedListener<M>): void;\n}\n\n/**\n * Base interface to be implemented to fetch each service's audience.\n *\n * @remarks\n *\n * The type parameter `M` allows consumers to further extend the client object with service-specific\n * details about the connecting client, such as device information, environment, or a username.\n *\n * @typeParam M - A service-specific {@link IMember} type.\n * @public\n */\nexport interface IServiceAudience<M extends IMember>\n\textends IEventProvider<IServiceAudienceEvents<M>> {\n\t/**\n\t * Returns an map of all users currently in the Fluid session where key is the userId and the value is the\n\t * member object. The implementation may choose to exclude certain connections from the returned map.\n\t * E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.\n\t */\n\tgetMembers(): ReadonlyMap<string, M>;\n\n\t/**\n\t * Returns the current active user on this client once they are connected. Otherwise, returns undefined.\n\t */\n\tgetMyself(): Myself<M> | undefined;\n}\n\n/**\n * Base interface for information for each connection made to the Fluid session.\n *\n * @remarks This interface can be extended to provide additional information specific to each service.\n * @public\n */\nexport interface IConnection {\n\t/**\n\t * A unique ID for the connection. A single user may have multiple connections, each with a different ID.\n\t */\n\treadonly id: string;\n\n\t/**\n\t * Whether the connection is in read or read/write mode.\n\t */\n\treadonly mode: \"write\" | \"read\";\n}\n\n/**\n * Base interface to be implemented to fetch each service's member.\n *\n * @remarks This interface can be extended by each service to provide additional service-specific user metadata.\n * @public\n */\nexport interface IMember {\n\t/**\n\t * An ID for the user, unique among each individual user connecting to the session.\n\t */\n\treadonly userId: string;\n\n\t/**\n\t * The set of connections the user has made, e.g. from multiple tabs or devices.\n\t */\n\treadonly connections: IConnection[];\n}\n\n/**\n * An extended member object that includes currentConnection\n * @public\n */\nexport type Myself<M extends IMember = IMember> = M & { readonly currentConnection: string };\n"]}
|
package/dist/utils.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
6
6
|
import { type IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
7
|
-
import { type IFluidDataStoreFactory, type NamedFluidDataStoreRegistryEntry } from "@fluidframework/runtime-definitions";
|
|
7
|
+
import { type IFluidDataStoreFactory, type NamedFluidDataStoreRegistryEntry } from "@fluidframework/runtime-definitions/internal";
|
|
8
8
|
import type { ISharedObjectKind } from "@fluidframework/shared-object-base";
|
|
9
9
|
import { type ContainerSchema, type DataObjectClass, type LoadableObjectClass } from "./types.js";
|
|
10
10
|
/**
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACN,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACN,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAG5E,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAElG;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,cAAc,IAAI,eAAe,CAAC,CAAC,CAAC,GACjF,MAAM,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;AAE3C;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,cAAc,EACzD,GAAG,EAAE,mBAAmB,CAAC,CAAC,CAAC,GACzB,GAAG,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC;AAErC;;GAEG;AACH,wBAAgB,iBAAiB,CAChC,GAAG,EAAE,mBAAmB,GACtB,GAAG,IAAI,uBAAuB,CAAC,cAAc,CAAC,CAAC;AAyBlD;;GAEG;AACH,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,mBAAmB,GACtB,GAAG,IAAI,iBAAiB,CAAC,cAAc,CAAC,CAE1C;AAED;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,WACrC,eAAe,KACrB,CAAC,gCAAgC,EAAE,EAAE,eAAe,EAAE,CA4BxD,CAAC"}
|
package/dist/utils.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.parseDataObjectsFromSharedObjects = exports.isSharedObjectKind = exports.isDataObjectClass = void 0;
|
|
8
|
-
const
|
|
8
|
+
const internal_1 = require("@fluidframework/telemetry-utils/internal");
|
|
9
9
|
/**
|
|
10
10
|
* Runtime check to determine if a class is a DataObject type.
|
|
11
11
|
*/
|
|
@@ -17,7 +17,7 @@ function isDataObjectClass(obj) {
|
|
|
17
17
|
(obj.getFactory !== undefined)) {
|
|
18
18
|
// 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.
|
|
19
19
|
// 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.
|
|
20
|
-
throw new
|
|
20
|
+
throw new internal_1.UsageError("Invalid LoadableObjectClass");
|
|
21
21
|
}
|
|
22
22
|
return isDataObject;
|
|
23
23
|
}
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,uEAAsE;AA2BtE;;GAEG;AACH,SAAgB,iBAAiB,CAChC,GAAwB;IAExB,MAAM,KAAK,GAAG,GAAmE,CAAC;IAClF,MAAM,YAAY,GACjB,KAAK,EAAE,OAAO,EAAE,sBAAsB,KAAK,SAAS;QACpD,KAAK,CAAC,OAAO,CAAC,sBAAsB,KAAK,KAAK,CAAC,OAAO,CAAC;IAExD,IACC,YAAY;QACZ,CAAE,GAAkD,CAAC,UAAU,KAAK,SAAS,CAAC,EAC7E;QACD,8KAA8K;QAC9K,+LAA+L;QAC/L,MAAM,IAAI,qBAAU,CAAC,6BAA6B,CAAC,CAAC;KACpD;IAED,OAAO,YAAY,CAAC;AACrB,CAAC;AAlBD,8CAkBC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CACjC,GAAwB;IAExB,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAA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Licensed under the MIT License.\n */\n\nimport { type IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { type IChannelFactory } from \"@fluidframework/datastore-definitions\";\nimport {\n\ttype IFluidDataStoreFactory,\n\ttype NamedFluidDataStoreRegistryEntry,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { ISharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { type ContainerSchema, type DataObjectClass, type LoadableObjectClass } from \"./types.js\";\n\n/**\n * An internal type used by the internal type guard isDataObjectClass to cast a\n * DataObjectClass to a type that is strongly coupled to IFluidDataStoreFactory.\n * Unlike the external and exported type DataObjectClass which is\n * weakly coupled to the IFluidDataStoreFactory to prevent leaking internals.\n */\nexport type InternalDataObjectClass<T extends IFluidLoadable> = DataObjectClass<T> &\n\tRecord<\"factory\", IFluidDataStoreFactory>;\n\n/**\n * Runtime check to determine if a class is a DataObject type.\n */\nexport function isDataObjectClass<T extends IFluidLoadable>(\n\tobj: LoadableObjectClass<T>,\n): obj is InternalDataObjectClass<T>;\n\n/**\n * Runtime check to determine if a class is a DataObject type.\n */\nexport function isDataObjectClass(\n\tobj: LoadableObjectClass,\n): obj is InternalDataObjectClass<IFluidLoadable>;\n\n/**\n * Runtime check to determine if a class is a DataObject type.\n */\nexport function isDataObjectClass(\n\tobj: LoadableObjectClass,\n): obj is InternalDataObjectClass<IFluidLoadable> {\n\tconst maybe = obj as Partial<InternalDataObjectClass<IFluidLoadable>> | undefined;\n\tconst isDataObject =\n\t\tmaybe?.factory?.IFluidDataStoreFactory !== undefined &&\n\t\tmaybe.factory.IFluidDataStoreFactory === maybe.factory;\n\n\tif (\n\t\tisDataObject ===\n\t\t((obj as Partial<ISharedObjectKind<IFluidLoadable>>).getFactory !== undefined)\n\t) {\n\t\t// 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.\n\t\t// 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.\n\t\tthrow new UsageError(\"Invalid LoadableObjectClass\");\n\t}\n\n\treturn isDataObject;\n}\n\n/**\n * Runtime check to determine if a class is a SharedObject type\n */\nexport function isSharedObjectKind(\n\tobj: LoadableObjectClass,\n): obj is ISharedObjectKind<IFluidLoadable> {\n\treturn !isDataObjectClass(obj);\n}\n\n/**\n * The ContainerSchema consists of initialObjects and dynamicObjectTypes. These types can be\n * of both SharedObject or DataObject. This function separates the two and returns a registry\n * of DataObject types and an array of SharedObjects.\n */\nexport const parseDataObjectsFromSharedObjects = (\n\tschema: ContainerSchema,\n): [NamedFluidDataStoreRegistryEntry[], IChannelFactory[]] => {\n\tconst registryEntries = new Set<NamedFluidDataStoreRegistryEntry>();\n\tconst sharedObjects = new Set<IChannelFactory>();\n\n\tconst tryAddObject = (obj: LoadableObjectClass): void => {\n\t\tif (isSharedObjectKind(obj)) {\n\t\t\tsharedObjects.add(obj.getFactory());\n\t\t} else if (isDataObjectClass(obj)) {\n\t\t\tregistryEntries.add([obj.factory.type, Promise.resolve(obj.factory)]);\n\t\t} else {\n\t\t\tthrow new Error(`Entry is neither a DataObject or a SharedObject`);\n\t\t}\n\t};\n\n\t// Add the object types that will be initialized\n\tconst dedupedObjects = new Set([\n\t\t...Object.values(schema.initialObjects),\n\t\t...(schema.dynamicObjectTypes ?? []),\n\t]);\n\tfor (const obj of dedupedObjects) {\n\t\ttryAddObject(obj);\n\t}\n\n\tif (registryEntries.size === 0 && sharedObjects.size === 0) {\n\t\tthrow new Error(\"Container cannot be initialized without any DataTypes\");\n\t}\n\n\treturn [[...registryEntries], [...sharedObjects]];\n};\n"]}
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
import { AttachState } from '@fluidframework/container-definitions';
|
|
8
8
|
import { ConnectionState } from '@fluidframework/container-definitions';
|
|
9
9
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
10
|
-
import { IContainer } from '@fluidframework/container-definitions';
|
|
10
|
+
import { IContainer } from '@fluidframework/container-definitions/internal';
|
|
11
11
|
import { ICriticalContainerError } from '@fluidframework/container-definitions';
|
|
12
12
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
13
13
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
14
14
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
15
|
-
import { IRuntimeFactory } from '@fluidframework/container-definitions';
|
|
15
|
+
import { IRuntimeFactory } from '@fluidframework/container-definitions/internal';
|
|
16
16
|
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -74,11 +74,14 @@ export declare interface ContainerSchema {
|
|
|
74
74
|
* constructor that will return the type of the `DataObject`.
|
|
75
75
|
*
|
|
76
76
|
* @typeParam T - The class of the `DataObject`.
|
|
77
|
+
* @privateRemarks
|
|
78
|
+
* Having both `factory` and `LoadableObjectCtor` is redundant, and having `factory` not actually work as a factory is also strange.
|
|
79
|
+
* This may need some refinement.
|
|
77
80
|
* @public
|
|
78
81
|
*/
|
|
79
82
|
export declare type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
80
83
|
readonly factory: {
|
|
81
|
-
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
84
|
+
readonly IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
82
85
|
};
|
|
83
86
|
} & (new (...args: any[]) => T);
|
|
84
87
|
|
|
@@ -92,11 +95,11 @@ export declare interface IConnection {
|
|
|
92
95
|
/**
|
|
93
96
|
* A unique ID for the connection. A single user may have multiple connections, each with a different ID.
|
|
94
97
|
*/
|
|
95
|
-
id: string;
|
|
98
|
+
readonly id: string;
|
|
96
99
|
/**
|
|
97
100
|
* Whether the connection is in read or read/write mode.
|
|
98
101
|
*/
|
|
99
|
-
mode: "write" | "read";
|
|
102
|
+
readonly mode: "write" | "read";
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
/**
|
|
@@ -282,11 +285,11 @@ export declare interface IMember {
|
|
|
282
285
|
/**
|
|
283
286
|
* An ID for the user, unique among each individual user connecting to the session.
|
|
284
287
|
*/
|
|
285
|
-
userId: string;
|
|
288
|
+
readonly userId: string;
|
|
286
289
|
/**
|
|
287
290
|
* The set of connections the user has made, e.g. from multiple tabs or devices.
|
|
288
291
|
*/
|
|
289
|
-
connections: IConnection[];
|
|
292
|
+
readonly connections: IConnection[];
|
|
290
293
|
}
|
|
291
294
|
|
|
292
295
|
/**
|
|
@@ -318,7 +321,7 @@ export declare interface IServiceAudience<M extends IMember> extends IEventProvi
|
|
|
318
321
|
* member object. The implementation may choose to exclude certain connections from the returned map.
|
|
319
322
|
* E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
|
|
320
323
|
*/
|
|
321
|
-
getMembers():
|
|
324
|
+
getMembers(): ReadonlyMap<string, M>;
|
|
322
325
|
/**
|
|
323
326
|
* Returns the current active user on this client once they are connected. Otherwise, returns undefined.
|
|
324
327
|
*/
|
|
@@ -397,7 +400,7 @@ export declare type MemberChangedListener<M extends IMember> = (clientId: string
|
|
|
397
400
|
* @public
|
|
398
401
|
*/
|
|
399
402
|
export declare type Myself<M extends IMember = IMember> = M & {
|
|
400
|
-
currentConnection: string;
|
|
403
|
+
readonly currentConnection: string;
|
|
401
404
|
};
|
|
402
405
|
|
|
403
406
|
export { }
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
import { AttachState } from '@fluidframework/container-definitions';
|
|
8
8
|
import { ConnectionState } from '@fluidframework/container-definitions';
|
|
9
9
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
10
|
-
import { IContainer } from '@fluidframework/container-definitions';
|
|
10
|
+
import { IContainer } from '@fluidframework/container-definitions/internal';
|
|
11
11
|
import { ICriticalContainerError } from '@fluidframework/container-definitions';
|
|
12
12
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
13
13
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
14
14
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
15
|
-
import { IRuntimeFactory } from '@fluidframework/container-definitions';
|
|
15
|
+
import { IRuntimeFactory } from '@fluidframework/container-definitions/internal';
|
|
16
16
|
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -74,11 +74,14 @@ export declare interface ContainerSchema {
|
|
|
74
74
|
* constructor that will return the type of the `DataObject`.
|
|
75
75
|
*
|
|
76
76
|
* @typeParam T - The class of the `DataObject`.
|
|
77
|
+
* @privateRemarks
|
|
78
|
+
* Having both `factory` and `LoadableObjectCtor` is redundant, and having `factory` not actually work as a factory is also strange.
|
|
79
|
+
* This may need some refinement.
|
|
77
80
|
* @public
|
|
78
81
|
*/
|
|
79
82
|
export declare type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
80
83
|
readonly factory: {
|
|
81
|
-
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
84
|
+
readonly IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
82
85
|
};
|
|
83
86
|
} & (new (...args: any[]) => T);
|
|
84
87
|
|
|
@@ -92,11 +95,11 @@ export declare interface IConnection {
|
|
|
92
95
|
/**
|
|
93
96
|
* A unique ID for the connection. A single user may have multiple connections, each with a different ID.
|
|
94
97
|
*/
|
|
95
|
-
id: string;
|
|
98
|
+
readonly id: string;
|
|
96
99
|
/**
|
|
97
100
|
* Whether the connection is in read or read/write mode.
|
|
98
101
|
*/
|
|
99
|
-
mode: "write" | "read";
|
|
102
|
+
readonly mode: "write" | "read";
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
/* Excluded from this release type: IContainer */
|
|
@@ -284,11 +287,11 @@ export declare interface IMember {
|
|
|
284
287
|
/**
|
|
285
288
|
* An ID for the user, unique among each individual user connecting to the session.
|
|
286
289
|
*/
|
|
287
|
-
userId: string;
|
|
290
|
+
readonly userId: string;
|
|
288
291
|
/**
|
|
289
292
|
* The set of connections the user has made, e.g. from multiple tabs or devices.
|
|
290
293
|
*/
|
|
291
|
-
connections: IConnection[];
|
|
294
|
+
readonly connections: IConnection[];
|
|
292
295
|
}
|
|
293
296
|
|
|
294
297
|
/**
|
|
@@ -322,7 +325,7 @@ export declare interface IServiceAudience<M extends IMember> extends IEventProvi
|
|
|
322
325
|
* member object. The implementation may choose to exclude certain connections from the returned map.
|
|
323
326
|
* E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
|
|
324
327
|
*/
|
|
325
|
-
getMembers():
|
|
328
|
+
getMembers(): ReadonlyMap<string, M>;
|
|
326
329
|
/**
|
|
327
330
|
* Returns the current active user on this client once they are connected. Otherwise, returns undefined.
|
|
328
331
|
*/
|
|
@@ -401,7 +404,7 @@ export declare type MemberChangedListener<M extends IMember> = (clientId: string
|
|
|
401
404
|
* @public
|
|
402
405
|
*/
|
|
403
406
|
export declare type Myself<M extends IMember = IMember> = M & {
|
|
404
|
-
currentConnection: string;
|
|
407
|
+
readonly currentConnection: string;
|
|
405
408
|
};
|
|
406
409
|
|
|
407
410
|
export { }
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
import { AttachState } from '@fluidframework/container-definitions';
|
|
8
8
|
import { ConnectionState } from '@fluidframework/container-definitions';
|
|
9
9
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
10
|
-
import { IContainer } from '@fluidframework/container-definitions';
|
|
10
|
+
import { IContainer } from '@fluidframework/container-definitions/internal';
|
|
11
11
|
import { ICriticalContainerError } from '@fluidframework/container-definitions';
|
|
12
12
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
13
13
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
14
14
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
15
|
-
import { IRuntimeFactory } from '@fluidframework/container-definitions';
|
|
15
|
+
import { IRuntimeFactory } from '@fluidframework/container-definitions/internal';
|
|
16
16
|
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -74,11 +74,14 @@ export declare interface ContainerSchema {
|
|
|
74
74
|
* constructor that will return the type of the `DataObject`.
|
|
75
75
|
*
|
|
76
76
|
* @typeParam T - The class of the `DataObject`.
|
|
77
|
+
* @privateRemarks
|
|
78
|
+
* Having both `factory` and `LoadableObjectCtor` is redundant, and having `factory` not actually work as a factory is also strange.
|
|
79
|
+
* This may need some refinement.
|
|
77
80
|
* @public
|
|
78
81
|
*/
|
|
79
82
|
export declare type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
80
83
|
readonly factory: {
|
|
81
|
-
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
84
|
+
readonly IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
82
85
|
};
|
|
83
86
|
} & (new (...args: any[]) => T);
|
|
84
87
|
|
|
@@ -92,11 +95,11 @@ export declare interface IConnection {
|
|
|
92
95
|
/**
|
|
93
96
|
* A unique ID for the connection. A single user may have multiple connections, each with a different ID.
|
|
94
97
|
*/
|
|
95
|
-
id: string;
|
|
98
|
+
readonly id: string;
|
|
96
99
|
/**
|
|
97
100
|
* Whether the connection is in read or read/write mode.
|
|
98
101
|
*/
|
|
99
|
-
mode: "write" | "read";
|
|
102
|
+
readonly mode: "write" | "read";
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
/* Excluded from this release type: IContainer */
|
|
@@ -284,11 +287,11 @@ export declare interface IMember {
|
|
|
284
287
|
/**
|
|
285
288
|
* An ID for the user, unique among each individual user connecting to the session.
|
|
286
289
|
*/
|
|
287
|
-
userId: string;
|
|
290
|
+
readonly userId: string;
|
|
288
291
|
/**
|
|
289
292
|
* The set of connections the user has made, e.g. from multiple tabs or devices.
|
|
290
293
|
*/
|
|
291
|
-
connections: IConnection[];
|
|
294
|
+
readonly connections: IConnection[];
|
|
292
295
|
}
|
|
293
296
|
|
|
294
297
|
/**
|
|
@@ -322,7 +325,7 @@ export declare interface IServiceAudience<M extends IMember> extends IEventProvi
|
|
|
322
325
|
* member object. The implementation may choose to exclude certain connections from the returned map.
|
|
323
326
|
* E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
|
|
324
327
|
*/
|
|
325
|
-
getMembers():
|
|
328
|
+
getMembers(): ReadonlyMap<string, M>;
|
|
326
329
|
/**
|
|
327
330
|
* Returns the current active user on this client once they are connected. Otherwise, returns undefined.
|
|
328
331
|
*/
|
|
@@ -401,7 +404,7 @@ export declare type MemberChangedListener<M extends IMember> = (clientId: string
|
|
|
401
404
|
* @public
|
|
402
405
|
*/
|
|
403
406
|
export declare type Myself<M extends IMember = IMember> = M & {
|
|
404
|
-
currentConnection: string;
|
|
407
|
+
readonly currentConnection: string;
|
|
405
408
|
};
|
|
406
409
|
|
|
407
410
|
export { }
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
import { AttachState } from '@fluidframework/container-definitions';
|
|
8
8
|
import { ConnectionState } from '@fluidframework/container-definitions';
|
|
9
9
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
10
|
-
import { IContainer } from '@fluidframework/container-definitions';
|
|
10
|
+
import { IContainer } from '@fluidframework/container-definitions/internal';
|
|
11
11
|
import { ICriticalContainerError } from '@fluidframework/container-definitions';
|
|
12
12
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
13
13
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
14
14
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
15
|
-
import { IRuntimeFactory } from '@fluidframework/container-definitions';
|
|
15
|
+
import { IRuntimeFactory } from '@fluidframework/container-definitions/internal';
|
|
16
16
|
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -103,11 +103,14 @@ export declare function createServiceAudience<TMember extends IMember = IMember>
|
|
|
103
103
|
* constructor that will return the type of the `DataObject`.
|
|
104
104
|
*
|
|
105
105
|
* @typeParam T - The class of the `DataObject`.
|
|
106
|
+
* @privateRemarks
|
|
107
|
+
* Having both `factory` and `LoadableObjectCtor` is redundant, and having `factory` not actually work as a factory is also strange.
|
|
108
|
+
* This may need some refinement.
|
|
106
109
|
* @public
|
|
107
110
|
*/
|
|
108
111
|
export declare type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
109
112
|
readonly factory: {
|
|
110
|
-
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
113
|
+
readonly IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
111
114
|
};
|
|
112
115
|
} & (new (...args: any[]) => T);
|
|
113
116
|
|
|
@@ -121,11 +124,11 @@ export declare interface IConnection {
|
|
|
121
124
|
/**
|
|
122
125
|
* A unique ID for the connection. A single user may have multiple connections, each with a different ID.
|
|
123
126
|
*/
|
|
124
|
-
id: string;
|
|
127
|
+
readonly id: string;
|
|
125
128
|
/**
|
|
126
129
|
* Whether the connection is in read or read/write mode.
|
|
127
130
|
*/
|
|
128
|
-
mode: "write" | "read";
|
|
131
|
+
readonly mode: "write" | "read";
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
/**
|
|
@@ -311,11 +314,11 @@ export declare interface IMember {
|
|
|
311
314
|
/**
|
|
312
315
|
* An ID for the user, unique among each individual user connecting to the session.
|
|
313
316
|
*/
|
|
314
|
-
userId: string;
|
|
317
|
+
readonly userId: string;
|
|
315
318
|
/**
|
|
316
319
|
* The set of connections the user has made, e.g. from multiple tabs or devices.
|
|
317
320
|
*/
|
|
318
|
-
connections: IConnection[];
|
|
321
|
+
readonly connections: IConnection[];
|
|
319
322
|
}
|
|
320
323
|
|
|
321
324
|
/**
|
|
@@ -370,7 +373,7 @@ export declare interface IServiceAudience<M extends IMember> extends IEventProvi
|
|
|
370
373
|
* member object. The implementation may choose to exclude certain connections from the returned map.
|
|
371
374
|
* E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
|
|
372
375
|
*/
|
|
373
|
-
getMembers():
|
|
376
|
+
getMembers(): ReadonlyMap<string, M>;
|
|
374
377
|
/**
|
|
375
378
|
* Returns the current active user on this client once they are connected. Otherwise, returns undefined.
|
|
376
379
|
*/
|
|
@@ -453,7 +456,7 @@ export declare type MemberChangedListener<M extends IMember> = (clientId: string
|
|
|
453
456
|
* @public
|
|
454
457
|
*/
|
|
455
458
|
export declare type Myself<M extends IMember = IMember> = M & {
|
|
456
|
-
currentConnection: string;
|
|
459
|
+
readonly currentConnection: string;
|
|
457
460
|
};
|
|
458
461
|
|
|
459
462
|
export { }
|
package/lib/fluidContainer.d.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { AttachState, type ConnectionState, type
|
|
5
|
+
import { AttachState, type ConnectionState, type ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
6
|
+
import { type IContainer } from "@fluidframework/container-definitions/internal";
|
|
6
7
|
import { type IEvent, type IEventProvider, type IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
7
8
|
import type { ContainerAttachProps, ContainerSchema, IRootDataObject, LoadableObjectClass } from "./types.js";
|
|
8
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidContainer.d.ts","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,
|
|
1
|
+
{"version":3,"file":"fluidContainer.d.ts","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EACN,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,MAAM,iCAAiC,CAAC;AAEzC,OAA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OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAE1D;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAElC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtD;;;;;;;;;;;OAWG;IACH,OAAO,IAAI,IAAI,CAAC;IAEhB;;;;;;;;;OASG;IACH,UAAU,IAAI,IAAI,CAAC;IAEnB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,CAAC,SAAS,cAAc,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAElF;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CACnC,gBAAgB,SAAS,eAAe,GAAG,eAAe,EACzD,KAAK,EAAE;IACR,SAAS,EAAE,UAAU,CAAC;IACtB,cAAc,EAAE,eAAe,CAAC;CAChC,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAEpC"}
|
package/lib/fluidContainer.js
CHANGED
|
@@ -93,6 +93,7 @@ class FluidContainer extends TypedEventEmitter {
|
|
|
93
93
|
* but internally this separation is not there.
|
|
94
94
|
*/
|
|
95
95
|
async attach(props) {
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison -- AB#7608
|
|
96
97
|
if (this.container.attachState !== AttachState.Detached) {
|
|
97
98
|
throw new Error("Cannot attach container. Container is not in detached state.");
|
|
98
99
|
}
|