@fluidframework/presence 2.42.0 → 2.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -32
- package/dist/alpha.d.ts +14 -5
- package/dist/beta.d.ts +14 -5
- package/dist/exposedInternalTypes.d.ts +12 -0
- package/dist/exposedInternalTypes.d.ts.map +1 -1
- package/dist/exposedInternalTypes.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/latestMapValueManager.d.ts +72 -14
- package/dist/latestMapValueManager.d.ts.map +1 -1
- package/dist/latestMapValueManager.js +15 -9
- package/dist/latestMapValueManager.js.map +1 -1
- package/dist/latestValueManager.d.ts +68 -13
- package/dist/latestValueManager.d.ts.map +1 -1
- package/dist/latestValueManager.js +7 -5
- package/dist/latestValueManager.js.map +1 -1
- package/dist/latestValueTypes.d.ts +60 -5
- package/dist/latestValueTypes.d.ts.map +1 -1
- package/dist/latestValueTypes.js.map +1 -1
- package/dist/presence.d.ts +20 -2
- package/dist/presence.d.ts.map +1 -1
- package/dist/presence.js.map +1 -1
- package/dist/stateFactory.d.ts +15 -10
- package/dist/stateFactory.d.ts.map +1 -1
- package/dist/stateFactory.js +12 -10
- package/dist/stateFactory.js.map +1 -1
- package/lib/alpha.d.ts +14 -5
- package/lib/beta.d.ts +14 -5
- package/lib/exposedInternalTypes.d.ts +12 -0
- package/lib/exposedInternalTypes.d.ts.map +1 -1
- package/lib/exposedInternalTypes.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/latestMapValueManager.d.ts +72 -14
- package/lib/latestMapValueManager.d.ts.map +1 -1
- package/lib/latestMapValueManager.js +15 -9
- package/lib/latestMapValueManager.js.map +1 -1
- package/lib/latestValueManager.d.ts +68 -13
- package/lib/latestValueManager.d.ts.map +1 -1
- package/lib/latestValueManager.js +7 -5
- package/lib/latestValueManager.js.map +1 -1
- package/lib/latestValueTypes.d.ts +60 -5
- package/lib/latestValueTypes.d.ts.map +1 -1
- package/lib/latestValueTypes.js.map +1 -1
- package/lib/presence.d.ts +20 -2
- package/lib/presence.d.ts.map +1 -1
- package/lib/presence.js.map +1 -1
- package/lib/stateFactory.d.ts +15 -10
- package/lib/stateFactory.d.ts.map +1 -1
- package/lib/stateFactory.js +11 -9
- package/lib/stateFactory.js.map +1 -1
- package/package.json +19 -19
package/dist/presence.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presence.d.ts","sourceRoot":"","sources":["../src/presence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EACX,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAA;CAAE,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,cAAc;IAC1B;;OAEG;;IAGH;;OAEG;;CAEM,CAAC;AAEX;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAElF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,QAAQ,CAAC,kBAAkB,SAAS,UAAU,GAAG,UAAU;IAC3E;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,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G;QACH,YAAY,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC;QAEtC;;;;WAIG;QACH,WAAW,CAAC,QAAQ,EAAE,kBAAkB,GAAG,UAAU,GAAG,QAAQ,CAAC;QAEjE;;;;WAIG;QACH,SAAS,IAAI,QAAQ,CAAC;KACtB,CAAC;IAEF;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE;QAChB;;;;;;;WAOG;QACH,YAAY,CAAC,YAAY,SAAS,qBAAqB,EACtD,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,YAAY,EAC7B,QAAQ,CAAC,EAAE,wBAAwB,GACjC,eAAe,CAAC,YAAY,CAAC,CAAC;KACjC,CAAC;CACF;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,yBAA0B,SAAQ,QAAQ;IAC1D,QAAQ,CAAC,aAAa,EAAE;QACvB;;;;;;WAMG;QACH,YAAY,CAAC,mBAAmB,SAAS,4BAA4B,EACpE,eAAe,EAAE,gBAAgB,EACjC,sBAAsB,EAAE,mBAAmB,GACzC,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;KAC/C,CAAC;CACF"}
|
package/dist/presence.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presence.js","sourceRoot":"","sources":["../src/presence.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6BH;;;;GAIG;AACU,QAAA,cAAc,GAAG;IAC7B;;OAEG;IACH,SAAS,EAAE,WAAW;IAEtB;;OAEG;IACH,YAAY,EAAE,cAAc;CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport type { SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { ClientConnectionId } from \"./baseTypes.js\";\nimport type { BroadcastControlSettings } from \"./broadcastControls.js\";\nimport type {\n\tNotificationsWorkspace,\n\tNotificationsWorkspaceSchema,\n\tStatesWorkspace,\n\tStatesWorkspaceSchema,\n\tWorkspaceAddress,\n} from \"./types.js\";\n\n/**\n * A Fluid client session identifier.\n *\n * @remarks\n * Each client once connected to a session is given a unique identifier for the\n * duration of the session. If a client disconnects and reconnects, it will\n * retain its identifier. Prefer use of {@link Attendee} as a way to\n * identify clients in a session. {@link Attendee.attendeeId} will provide\n * the session ID.\n *\n * @beta\n */\nexport type AttendeeId = SessionId & { readonly AttendeeId: \"AttendeeId\" };\n\n/**\n * The connection status of the {@link Attendee}.\n *\n * @beta\n */\nexport const AttendeeStatus = {\n\t/**\n\t * The {@link Attendee} is connected to the Fluid service.\n\t */\n\tConnected: \"Connected\",\n\n\t/**\n\t * The {@link Attendee} is not connected to the Fluid service.\n\t */\n\tDisconnected: \"Disconnected\",\n} as const;\n\n/**\n * Represents the connection status of an {@link Attendee}.\n *\n * This type can be either `'Connected'` or `'Disconnected'`, indicating whether\n * the attendee is currently connected to the Fluid service.\n *\n * When `'Disconnected'`:\n * - State changes are kept locally and communicated to others upon reconnect.\n * - Notification requests are discarded (silently).\n *\n * @beta\n */\nexport type AttendeeStatus = (typeof AttendeeStatus)[keyof typeof AttendeeStatus];\n\n/**\n * A client within a Fluid session (period of container connectivity to service).\n *\n * @remarks\n * Note: This is very preliminary attendee representation.\n *\n * {@link Attendee} should be used as key to distinguish between different\n * clients as they join, rejoin, and disconnect from a session. While a\n * client's {@link ClientConnectionId} from {@link Attendee.getConnectionStatus}\n * may change over time, `Attendee` will be fixed.\n *\n * @privateRemarks\n * As this is evolved, pay attention to how this relates to Audience, Service\n * Audience, and Quorum representations of clients and users.\n *\n * @sealed\n * @beta\n */\nexport interface Attendee<SpecificAttendeeId extends AttendeeId = AttendeeId> {\n\t/**\n\t * The session ID of the client that is stable over all connections.\n\t */\n\treadonly attendeeId: SpecificAttendeeId;\n\n\t/**\n\t * Get current client connection ID.\n\t *\n\t * @returns Current client connection ID.\n\t *\n\t * @remarks\n\t * Connection ID will change on reconnect.\n\t *\n\t * If {@link Attendee.getConnectionStatus} is {@link (AttendeeStatus:variable).Disconnected}, this will represent the last known connection ID.\n\t */\n\tgetConnectionId(): ClientConnectionId;\n\n\t/**\n\t * Get connection status of attendee.\n\t *\n\t * @returns Connection status of attendee.\n\t *\n\t */\n\tgetConnectionStatus(): AttendeeStatus;\n}\n\n/**\n * Utility type limiting to a specific attendee. (A attendee with\n * a specific session ID - not just any session ID.)\n */\nexport type SpecificAttendee<SpecificAttendeeId extends AttendeeId> =\n\tstring extends SpecificAttendeeId ? never : Attendee<SpecificAttendeeId>;\n\n/**\n * Events from {@link Presence.attendees}.\n *\n * @sealed\n * @beta\n */\nexport interface AttendeesEvents {\n\t/**\n\t * Raised when new client joins session.\n\t *\n\t * @eventProperty\n\t */\n\tattendeeConnected: (attendee: Attendee) => void;\n\n\t/**\n\t * Raised when client appears disconnected from session.\n\t *\n\t * @eventProperty\n\t */\n\tattendeeDisconnected: (attendee: Attendee) => void;\n}\n\n/**\n * Events from {@link Presence}.\n *\n * @sealed\n * @beta\n */\nexport interface PresenceEvents {\n\t/**\n\t * Raised when a workspace is activated within the session.\n\t *\n\t * \"Activated\" means that a workspace is being used by a client and this\n\t * client is seeing information for the first time.\n\t *\n\t * @remarks\n\t * Local workspaces may be passively acquired/registered when this event\n\t * is raised. For a notifications workspace, that lazy registration must\n\t * be done before the event handler returns to ensure no notifications\n\t * are missed.\n\t */\n\tworkspaceActivated: (\n\t\tworkspaceAddress: WorkspaceAddress,\n\t\ttype: \"States\" | \"Notifications\" | \"Unknown\",\n\t) => void;\n}\n\n/**\n * Presence
|
|
1
|
+
{"version":3,"file":"presence.js","sourceRoot":"","sources":["../src/presence.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6BH;;;;GAIG;AACU,QAAA,cAAc,GAAG;IAC7B;;OAEG;IACH,SAAS,EAAE,WAAW;IAEtB;;OAEG;IACH,YAAY,EAAE,cAAc;CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport type { SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { ClientConnectionId } from \"./baseTypes.js\";\nimport type { BroadcastControlSettings } from \"./broadcastControls.js\";\nimport type {\n\tNotificationsWorkspace,\n\tNotificationsWorkspaceSchema,\n\tStatesWorkspace,\n\tStatesWorkspaceSchema,\n\tWorkspaceAddress,\n} from \"./types.js\";\n\n/**\n * A Fluid client session identifier.\n *\n * @remarks\n * Each client once connected to a session is given a unique identifier for the\n * duration of the session. If a client disconnects and reconnects, it will\n * retain its identifier. Prefer use of {@link Attendee} as a way to\n * identify clients in a session. {@link Attendee.attendeeId} will provide\n * the session ID.\n *\n * @beta\n */\nexport type AttendeeId = SessionId & { readonly AttendeeId: \"AttendeeId\" };\n\n/**\n * The connection status of the {@link Attendee}.\n *\n * @beta\n */\nexport const AttendeeStatus = {\n\t/**\n\t * The {@link Attendee} is connected to the Fluid service.\n\t */\n\tConnected: \"Connected\",\n\n\t/**\n\t * The {@link Attendee} is not connected to the Fluid service.\n\t */\n\tDisconnected: \"Disconnected\",\n} as const;\n\n/**\n * Represents the connection status of an {@link Attendee}.\n *\n * This type can be either `'Connected'` or `'Disconnected'`, indicating whether\n * the attendee is currently connected to the Fluid service.\n *\n * When `'Disconnected'`:\n * - State changes are kept locally and communicated to others upon reconnect.\n * - Notification requests are discarded (silently).\n *\n * @beta\n */\nexport type AttendeeStatus = (typeof AttendeeStatus)[keyof typeof AttendeeStatus];\n\n/**\n * A client within a Fluid session (period of container connectivity to service).\n *\n * @remarks\n * Note: This is very preliminary attendee representation.\n *\n * {@link Attendee} should be used as key to distinguish between different\n * clients as they join, rejoin, and disconnect from a session. While a\n * client's {@link ClientConnectionId} from {@link Attendee.getConnectionStatus}\n * may change over time, `Attendee` will be fixed.\n *\n * @privateRemarks\n * As this is evolved, pay attention to how this relates to Audience, Service\n * Audience, and Quorum representations of clients and users.\n *\n * @sealed\n * @beta\n */\nexport interface Attendee<SpecificAttendeeId extends AttendeeId = AttendeeId> {\n\t/**\n\t * The session ID of the client that is stable over all connections.\n\t */\n\treadonly attendeeId: SpecificAttendeeId;\n\n\t/**\n\t * Get current client connection ID.\n\t *\n\t * @returns Current client connection ID.\n\t *\n\t * @remarks\n\t * Connection ID will change on reconnect.\n\t *\n\t * If {@link Attendee.getConnectionStatus} is {@link (AttendeeStatus:variable).Disconnected}, this will represent the last known connection ID.\n\t */\n\tgetConnectionId(): ClientConnectionId;\n\n\t/**\n\t * Get connection status of attendee.\n\t *\n\t * @returns Connection status of attendee.\n\t *\n\t */\n\tgetConnectionStatus(): AttendeeStatus;\n}\n\n/**\n * Utility type limiting to a specific attendee. (A attendee with\n * a specific session ID - not just any session ID.)\n */\nexport type SpecificAttendee<SpecificAttendeeId extends AttendeeId> =\n\tstring extends SpecificAttendeeId ? never : Attendee<SpecificAttendeeId>;\n\n/**\n * Events from {@link Presence.attendees}.\n *\n * @sealed\n * @beta\n */\nexport interface AttendeesEvents {\n\t/**\n\t * Raised when new client joins session.\n\t *\n\t * @eventProperty\n\t */\n\tattendeeConnected: (attendee: Attendee) => void;\n\n\t/**\n\t * Raised when client appears disconnected from session.\n\t *\n\t * @eventProperty\n\t */\n\tattendeeDisconnected: (attendee: Attendee) => void;\n}\n\n/**\n * Events from {@link Presence}.\n *\n * @sealed\n * @beta\n */\nexport interface PresenceEvents {\n\t/**\n\t * Raised when a workspace is activated within the session.\n\t *\n\t * \"Activated\" means that a workspace is being used by a client and this\n\t * client is seeing information for the first time.\n\t *\n\t * @remarks\n\t * Local workspaces may be passively acquired/registered when this event\n\t * is raised. For a notifications workspace, that lazy registration must\n\t * be done before the event handler returns to ensure no notifications\n\t * are missed.\n\t */\n\tworkspaceActivated: (\n\t\tworkspaceAddress: WorkspaceAddress,\n\t\ttype: \"States\" | \"Notifications\" | \"Unknown\",\n\t) => void;\n}\n\n/**\n * Provides top-level access to Presence feature set including known\n * {@link Attendee}s within a session and their custom states kept\n * under {@link StatesWorkspace}s.\n *\n * @sealed\n * @beta\n */\nexport interface Presence {\n\t/**\n\t * Events for Presence.\n\t */\n\treadonly events: Listenable<PresenceEvents>;\n\n\t/**\n\t * Container-wide {@link Attendee} information and event provider.\n\t *\n\t * @remarks\n\t * This provides access to all {@link Attendee}s in the session, including\n\t * the current client. As {@link StatesWorkspace} aren't required to be\n\t * uniform across an application, some {@link Attendee}s may be enumerated\n\t * here while not being present in any particular {@link StatesWorkspace}.\n\t */\n\treadonly attendees: {\n\t\t/**\n\t\t * Events for {@link Attendee}s.\n\t\t */\n\t\treadonly events: Listenable<AttendeesEvents>;\n\n\t\t/**\n\t\t * Get all {@link Attendee}s in the session.\n\t\t *\n\t\t * @remarks\n\t\t * Attendee states are dynamic and will change as clients join and leave\n\t\t * the session.\n\t\t */\n\t\tgetAttendees(): ReadonlySet<Attendee>;\n\n\t\t/**\n\t\t * Lookup a specific {@link Attendee} in the session.\n\t\t *\n\t\t * @param clientId - Client connection or session ID\n\t\t */\n\t\tgetAttendee(clientId: ClientConnectionId | AttendeeId): Attendee;\n\n\t\t/**\n\t\t * Get this client's {@link Attendee}.\n\t\t *\n\t\t * @returns This client's attendee.\n\t\t */\n\t\tgetMyself(): Attendee;\n\t};\n\n\t/**\n\t * Provides access to {@link StatesWorkspace}s that allow clients to\n\t * manage custom states.\n\t */\n\treadonly states: {\n\t\t/**\n\t\t * Acquires a {@link StatesWorkspace} from store or adds new one.\n\t\t *\n\t\t * @param workspaceAddress - Address of the requested {@link StatesWorkspace}\n\t\t * @param requestedStates - Requested states for the workspace\n\t\t * @param controls - Optional settings for default broadcast controls\n\t\t * @returns A {@link StatesWorkspace}\n\t\t */\n\t\tgetWorkspace<StatesSchema extends StatesWorkspaceSchema>(\n\t\t\tworkspaceAddress: WorkspaceAddress,\n\t\t\trequestedStates: StatesSchema,\n\t\t\tcontrols?: BroadcastControlSettings,\n\t\t): StatesWorkspace<StatesSchema>;\n\t};\n}\n\n/**\n * Provides top-level access to Presence feature set including known\n * {@link Attendee}s within a session and their custom states and\n * notifications kept under {@link StatesWorkspace}s and\n * {@link NotificationsWorkspace}s.\n *\n * @remarks\n * To access this alpha API, cast any `{@link Presence}` to `PresenceWithNotifications`.\n *\n * @sealed\n * @alpha\n */\nexport interface PresenceWithNotifications extends Presence {\n\treadonly notifications: {\n\t\t/**\n\t\t * Acquires a Notifications workspace from store or adds new one.\n\t\t *\n\t\t * @param workspaceAddress - Address of the requested Notifications Workspace\n\t\t * @param requestedNotifications - Requested notifications for the workspace\n\t\t * @returns A Notifications workspace\n\t\t */\n\t\tgetWorkspace<NotificationsSchema extends NotificationsWorkspaceSchema>(\n\t\t\tnotificationsId: WorkspaceAddress,\n\t\t\trequestedNotifications: NotificationsSchema,\n\t\t): NotificationsWorkspace<NotificationsSchema>;\n\t};\n}\n"]}
|
package/dist/stateFactory.d.ts
CHANGED
|
@@ -2,21 +2,26 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import type { LatestMapFactory } from "./latestMapValueManager.js";
|
|
6
|
+
import type { LatestFactory } from "./latestValueManager.js";
|
|
7
7
|
/**
|
|
8
8
|
* Factory for creating presence State objects.
|
|
9
|
+
*/
|
|
10
|
+
export declare const StateFactoryInternal: {
|
|
11
|
+
latest: import("./latestValueManager.js").LatestFactoryInternal;
|
|
12
|
+
latestMap: import("./latestMapValueManager.js").LatestMapFactoryInternal;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Factory for creating presence State objects.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Use `latest` to create a {@link LatestRaw} State object.
|
|
19
|
+
* Use `latestMap` to create a {@link LatestMapRaw} State object.
|
|
9
20
|
*
|
|
10
21
|
* @beta
|
|
11
22
|
*/
|
|
12
23
|
export declare const StateFactory: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*/
|
|
16
|
-
latest: typeof latest;
|
|
17
|
-
/**
|
|
18
|
-
* {@inheritdoc latestMap}
|
|
19
|
-
*/
|
|
20
|
-
latestMap: typeof latestMap;
|
|
24
|
+
latest: LatestFactory;
|
|
25
|
+
latestMap: LatestMapFactory;
|
|
21
26
|
};
|
|
22
27
|
//# sourceMappingURL=stateFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateFactory.d.ts","sourceRoot":"","sources":["../src/stateFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"stateFactory.d.ts","sourceRoot":"","sources":["../src/stateFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;CAGhC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,EAAE;IAC1B,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,gBAAgB,CAAC;CACL,CAAC"}
|
package/dist/stateFactory.js
CHANGED
|
@@ -4,22 +4,24 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.StateFactory = void 0;
|
|
7
|
+
exports.StateFactory = exports.StateFactoryInternal = void 0;
|
|
8
8
|
const latestMapValueManager_js_1 = require("./latestMapValueManager.js");
|
|
9
9
|
const latestValueManager_js_1 = require("./latestValueManager.js");
|
|
10
10
|
/**
|
|
11
11
|
* Factory for creating presence State objects.
|
|
12
|
-
*
|
|
13
|
-
* @beta
|
|
14
12
|
*/
|
|
15
|
-
exports.
|
|
16
|
-
/**
|
|
17
|
-
* {@inheritdoc latest}
|
|
18
|
-
*/
|
|
13
|
+
exports.StateFactoryInternal = {
|
|
19
14
|
latest: latestValueManager_js_1.latest,
|
|
20
|
-
/**
|
|
21
|
-
* {@inheritdoc latestMap}
|
|
22
|
-
*/
|
|
23
15
|
latestMap: latestMapValueManager_js_1.latestMap,
|
|
24
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Factory for creating presence State objects.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Use `latest` to create a {@link LatestRaw} State object.
|
|
22
|
+
* Use `latestMap` to create a {@link LatestMapRaw} State object.
|
|
23
|
+
*
|
|
24
|
+
* @beta
|
|
25
|
+
*/
|
|
26
|
+
exports.StateFactory = exports.StateFactoryInternal;
|
|
25
27
|
//# sourceMappingURL=stateFactory.js.map
|
package/dist/stateFactory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateFactory.js","sourceRoot":"","sources":["../src/stateFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"stateFactory.js","sourceRoot":"","sources":["../src/stateFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAAuD;AAEvD,mEAAiD;AAEjD;;GAEG;AACU,QAAA,oBAAoB,GAAG;IACnC,MAAM,EAAN,8BAAM;IACN,SAAS,EAAT,oCAAS;CACT,CAAC;AAEF;;;;;;;;GAQG;AACU,QAAA,YAAY,GAGrB,4BAAoB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { LatestMapFactory } from \"./latestMapValueManager.js\";\nimport { latestMap } from \"./latestMapValueManager.js\";\nimport type { LatestFactory } from \"./latestValueManager.js\";\nimport { latest } from \"./latestValueManager.js\";\n\n/**\n * Factory for creating presence State objects.\n */\nexport const StateFactoryInternal = {\n\tlatest,\n\tlatestMap,\n};\n\n/**\n * Factory for creating presence State objects.\n *\n * @remarks\n * Use `latest` to create a {@link LatestRaw} State object.\n * Use `latestMap` to create a {@link LatestMapRaw} State object.\n *\n * @beta\n */\nexport const StateFactory: {\n\tlatest: LatestFactory;\n\tlatestMap: LatestMapFactory;\n} = StateFactoryInternal;\n"]}
|
package/lib/alpha.d.ts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
export {
|
|
20
20
|
// @beta APIs
|
|
21
|
+
Accessor,
|
|
21
22
|
Attendee,
|
|
22
23
|
AttendeeId,
|
|
23
24
|
AttendeeStatus,
|
|
@@ -26,11 +27,17 @@ export {
|
|
|
26
27
|
BroadcastControls,
|
|
27
28
|
ClientConnectionId,
|
|
28
29
|
InternalTypes,
|
|
29
|
-
|
|
30
|
+
Latest,
|
|
31
|
+
LatestArgumentsRaw,
|
|
30
32
|
LatestClientData,
|
|
31
33
|
LatestData,
|
|
32
|
-
|
|
34
|
+
LatestEvents,
|
|
35
|
+
LatestFactory,
|
|
36
|
+
LatestMap,
|
|
37
|
+
LatestMapArgumentsRaw,
|
|
33
38
|
LatestMapClientData,
|
|
39
|
+
LatestMapEvents,
|
|
40
|
+
LatestMapFactory,
|
|
34
41
|
LatestMapItemRemovedClientData,
|
|
35
42
|
LatestMapItemUpdatedClientData,
|
|
36
43
|
LatestMapRaw,
|
|
@@ -40,16 +47,18 @@ export {
|
|
|
40
47
|
LatestRawEvents,
|
|
41
48
|
Presence,
|
|
42
49
|
PresenceEvents,
|
|
50
|
+
ProxiedValueAccessor,
|
|
51
|
+
RawValueAccessor,
|
|
43
52
|
StateFactory,
|
|
44
53
|
StateMap,
|
|
54
|
+
StateSchemaValidator,
|
|
45
55
|
StatesWorkspace,
|
|
46
56
|
StatesWorkspaceEntries,
|
|
47
57
|
StatesWorkspaceEntry,
|
|
48
58
|
StatesWorkspaceSchema,
|
|
59
|
+
ValueAccessor,
|
|
49
60
|
WorkspaceAddress,
|
|
50
|
-
getPresence,
|
|
51
|
-
latest,
|
|
52
|
-
latestMap,
|
|
61
|
+
getPresence,
|
|
53
62
|
|
|
54
63
|
// @alpha APIs
|
|
55
64
|
ExperimentalPresenceDO,
|
package/lib/beta.d.ts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
export {
|
|
20
20
|
// @beta APIs
|
|
21
|
+
Accessor,
|
|
21
22
|
Attendee,
|
|
22
23
|
AttendeeId,
|
|
23
24
|
AttendeeStatus,
|
|
@@ -26,11 +27,17 @@ export {
|
|
|
26
27
|
BroadcastControls,
|
|
27
28
|
ClientConnectionId,
|
|
28
29
|
InternalTypes,
|
|
29
|
-
|
|
30
|
+
Latest,
|
|
31
|
+
LatestArgumentsRaw,
|
|
30
32
|
LatestClientData,
|
|
31
33
|
LatestData,
|
|
32
|
-
|
|
34
|
+
LatestEvents,
|
|
35
|
+
LatestFactory,
|
|
36
|
+
LatestMap,
|
|
37
|
+
LatestMapArgumentsRaw,
|
|
33
38
|
LatestMapClientData,
|
|
39
|
+
LatestMapEvents,
|
|
40
|
+
LatestMapFactory,
|
|
34
41
|
LatestMapItemRemovedClientData,
|
|
35
42
|
LatestMapItemUpdatedClientData,
|
|
36
43
|
LatestMapRaw,
|
|
@@ -40,14 +47,16 @@ export {
|
|
|
40
47
|
LatestRawEvents,
|
|
41
48
|
Presence,
|
|
42
49
|
PresenceEvents,
|
|
50
|
+
ProxiedValueAccessor,
|
|
51
|
+
RawValueAccessor,
|
|
43
52
|
StateFactory,
|
|
44
53
|
StateMap,
|
|
54
|
+
StateSchemaValidator,
|
|
45
55
|
StatesWorkspace,
|
|
46
56
|
StatesWorkspaceEntries,
|
|
47
57
|
StatesWorkspaceEntry,
|
|
48
58
|
StatesWorkspaceSchema,
|
|
59
|
+
ValueAccessor,
|
|
49
60
|
WorkspaceAddress,
|
|
50
|
-
getPresence
|
|
51
|
-
latest,
|
|
52
|
-
latestMap
|
|
61
|
+
getPresence
|
|
53
62
|
} from "./index.js";
|
|
@@ -12,6 +12,8 @@ import type { OpaqueJsonDeserialized } from "@fluidframework/core-interfaces/int
|
|
|
12
12
|
*/
|
|
13
13
|
export declare namespace InternalTypes {
|
|
14
14
|
/**
|
|
15
|
+
* Metadata for a value state.
|
|
16
|
+
*
|
|
15
17
|
* @system
|
|
16
18
|
*/
|
|
17
19
|
interface ValueStateMetadata {
|
|
@@ -49,6 +51,8 @@ export declare namespace InternalTypes {
|
|
|
49
51
|
value: OpaqueJsonDeserialized<TValue>;
|
|
50
52
|
}
|
|
51
53
|
/**
|
|
54
|
+
* A directory of values, where each value may be an optional state or another directory.
|
|
55
|
+
*
|
|
52
56
|
* @system
|
|
53
57
|
*/
|
|
54
58
|
interface ValueDirectory<T> {
|
|
@@ -58,10 +62,14 @@ export declare namespace InternalTypes {
|
|
|
58
62
|
};
|
|
59
63
|
}
|
|
60
64
|
/**
|
|
65
|
+
* Convenience type for a required state or a directory of values.
|
|
66
|
+
*
|
|
61
67
|
* @system
|
|
62
68
|
*/
|
|
63
69
|
type ValueDirectoryOrState<T> = ValueRequiredState<T> | ValueDirectory<T>;
|
|
64
70
|
/**
|
|
71
|
+
* Collection of optional values in a "map" structure.
|
|
72
|
+
*
|
|
65
73
|
* @system
|
|
66
74
|
*/
|
|
67
75
|
interface MapValueState<T, Keys extends string | number> {
|
|
@@ -71,6 +79,8 @@ export declare namespace InternalTypes {
|
|
|
71
79
|
};
|
|
72
80
|
}
|
|
73
81
|
/**
|
|
82
|
+
* Opaque type representing internal state datastore.
|
|
83
|
+
*
|
|
74
84
|
* @system
|
|
75
85
|
*/
|
|
76
86
|
class StateDatastoreHandle<TKey, TValue extends ValueDirectoryOrState<any>> {
|
|
@@ -111,6 +121,8 @@ export declare namespace InternalTypes {
|
|
|
111
121
|
manager: StateValue<TManager>;
|
|
112
122
|
});
|
|
113
123
|
/**
|
|
124
|
+
* Structure of a generic notification "value".
|
|
125
|
+
*
|
|
114
126
|
* @system
|
|
115
127
|
*/
|
|
116
128
|
interface NotificationType {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exposedInternalTypes.d.ts","sourceRoot":"","sources":["../src/exposedInternalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAE3G;;;;;;GAMG;AAEH,yBAAiB,aAAa,CAAC;IAC9B
|
|
1
|
+
{"version":3,"file":"exposedInternalTypes.d.ts","sourceRoot":"","sources":["../src/exposedInternalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAE3G;;;;;;GAMG;AAEH,yBAAiB,aAAa,CAAC;IAC9B;;;;OAIG;IACH,UAAiB,kBAAkB;QAClC,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;KAClB;IAED;;;;;;;;OAQG;IACH,UAAiB,kBAAkB,CAAC,MAAM,CAAE,SAAQ,kBAAkB;QACrE,KAAK,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;KACvC;IAED;;;;;;;;;;;;;;OAcG;IACH,UAAiB,kBAAkB,CAAC,MAAM,CAAE,SAAQ,kBAAkB;QACrE,KAAK,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;KACtC;IAED;;;;OAIG;IACH,UAAiB,cAAc,CAAC,CAAC;QAChC,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE;YAIN,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;SACnE,CAAC;KACF;IAED;;;;OAIG;IACH,KAAY,qBAAqB,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IAEjF;;;;OAIG;IACH,UAAiB,aAAa,CAAC,CAAC,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM;QAC7D,GAA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|
+
{"version":3,"file":"exposedInternalTypes.js","sourceRoot":"","sources":["../src/exposedInternalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;GAMG;AACH,2DAA2D;AAC3D,MAAM,KAAW,aAAa,CAyI7B;AAzID,WAAiB,aAAa;AAyI9B,CAAC,EAzIgB,aAAa,KAAb,aAAa,QAyI7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { OpaqueJsonDeserialized } from \"@fluidframework/core-interfaces/internal/exposedUtilityTypes\";\n\n/**\n * Collection of value types that are not intended to be used/imported\n * directly outside of this package.\n *\n * @beta\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InternalTypes {\n\t/**\n\t * Metadata for a value state.\n\t *\n\t * @system\n\t */\n\texport interface ValueStateMetadata {\n\t\trev: number;\n\t\ttimestamp: number;\n\t}\n\n\t/**\n\t * Represents a state that may have a value.\n\t * And it includes standard metadata.\n\t *\n\t * @remarks\n\t * See {@link InternalTypes.ValueRequiredState}.\n\t *\n\t * @system\n\t */\n\texport interface ValueOptionalState<TValue> extends ValueStateMetadata {\n\t\tvalue?: OpaqueJsonDeserialized<TValue>;\n\t}\n\n\t/**\n\t * Represents a state that must have a value.\n\t * And it includes standard metadata.\n\t *\n\t * @remarks\n\t * The value is wrapped in `OpaqueJsonDeserialized` as uses are expected\n\t * to involve generic or unknown types that will be filtered. It is here\n\t * mostly as a convenience to the many such uses that would otherwise\n\t * need to specify some wrapper themselves.\n\t *\n\t * For known cases, construct a custom interface that extends\n\t * {@link InternalTypes.ValueStateMetadata}.\n\t *\n\t * @system\n\t */\n\texport interface ValueRequiredState<TValue> extends ValueStateMetadata {\n\t\tvalue: OpaqueJsonDeserialized<TValue>;\n\t}\n\n\t/**\n\t * A directory of values, where each value may be an optional state or another directory.\n\t *\n\t * @system\n\t */\n\texport interface ValueDirectory<T> {\n\t\trev: number;\n\t\titems: {\n\t\t\t// Caution: any particular item may or may not exist\n\t\t\t// Typescript does not support absent keys without forcing type to also be undefined.\n\t\t\t// See https://github.com/microsoft/TypeScript/issues/42810.\n\t\t\t[name: string | number]: ValueOptionalState<T> | ValueDirectory<T>;\n\t\t};\n\t}\n\n\t/**\n\t * Convenience type for a required state or a directory of values.\n\t *\n\t * @system\n\t */\n\texport type ValueDirectoryOrState<T> = ValueRequiredState<T> | ValueDirectory<T>;\n\n\t/**\n\t * Collection of optional values in a \"map\" structure.\n\t *\n\t * @system\n\t */\n\texport interface MapValueState<T, Keys extends string | number> {\n\t\trev: number;\n\t\titems: {\n\t\t\t// Caution: any particular item may or may not exist\n\t\t\t// Typescript does not support absent keys without forcing type to also be undefined.\n\t\t\t// See https://github.com/microsoft/TypeScript/issues/42810.\n\t\t\t[name in Keys]: ValueOptionalState<T>;\n\t\t};\n\t}\n\n\t/**\n\t * Opaque type representing internal state datastore.\n\t *\n\t * @system\n\t */\n\texport declare class StateDatastoreHandle<TKey, TValue extends ValueDirectoryOrState<any>> {\n\t\tprivate readonly StateDatastoreHandle: StateDatastoreHandle<TKey, TValue>;\n\t}\n\n\t/**\n\t * Brand to ensure state values internal type safety without revealing\n\t * internals that are subject to change.\n\t *\n\t * @system\n\t */\n\texport declare class StateValueBrand<T> {\n\t\tprivate readonly StateValue: StateValue<T>;\n\t}\n\n\t/**\n\t * This type provides no additional functionality over the type it wraps.\n\t * It is used to ensure type safety within package.\n\t * Users may find it convenient to just use the type it wraps directly.\n\t *\n\t * @privateRemarks\n\t * Checkout filtering omitting unknown from T (`Omit<T,unknown> &`).\n\t *\n\t * @system\n\t */\n\texport type StateValue<T> = T & StateValueBrand<T>;\n\n\t/**\n\t * Package internal function declaration for state and notification instantiation.\n\t *\n\t * @system\n\t */\n\texport type ManagerFactory<\n\t\tTKey extends string,\n\t\tTValue extends ValueDirectoryOrState<any>,\n\t\tTManager,\n\t> = { instanceBase: new (...args: any[]) => any } & ((\n\t\tkey: TKey,\n\t\tdatastoreHandle: StateDatastoreHandle<TKey, TValue>,\n\t) => {\n\t\tinitialData?: { value: TValue; allowableUpdateLatencyMs: number | undefined };\n\t\tmanager: StateValue<TManager>;\n\t});\n\n\t/**\n\t * Structure of a generic notification \"value\".\n\t *\n\t * @system\n\t */\n\texport interface NotificationType {\n\t\tname: string;\n\t\targs: unknown[];\n\t}\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -15,9 +15,9 @@ export { type Attendee, type AttendeesEvents, type AttendeeId, AttendeeStatus, t
|
|
|
15
15
|
export type { BroadcastControls, BroadcastControlSettings, } from "./broadcastControls.js";
|
|
16
16
|
export { getPresence, getPresenceAlpha } from "./experimentalAccess.js";
|
|
17
17
|
export { getPresenceViaDataObject, type ExperimentalPresenceDO, ExperimentalPresenceManager, } from "./datastorePresenceManagerFactory.js";
|
|
18
|
-
export type {
|
|
19
|
-
export type {
|
|
20
|
-
export type { LatestClientData, LatestData, LatestMetadata, } from "./latestValueTypes.js";
|
|
18
|
+
export type { LatestMap, LatestMapArgumentsRaw, LatestMapClientData, LatestMapEvents, LatestMapFactory, LatestMapItemRemovedClientData, LatestMapItemUpdatedClientData, LatestMapRaw, LatestMapRawEvents, StateMap, } from "./latestMapValueManager.js";
|
|
19
|
+
export type { Latest, LatestArgumentsRaw, LatestEvents, LatestFactory, LatestRaw, LatestRawEvents, } from "./latestValueManager.js";
|
|
20
|
+
export type { Accessor, LatestClientData, LatestData, LatestMetadata, ProxiedValueAccessor, RawValueAccessor, StateSchemaValidator, ValueAccessor, } from "./latestValueTypes.js";
|
|
21
21
|
export { type NotificationEmitter, type NotificationListenable, type NotificationSubscriptions, Notifications, type NotificationsManager, type NotificationsManagerEvents, } from "./notificationsManager.js";
|
|
22
22
|
export { StateFactory } from "./stateFactory.js";
|
|
23
23
|
export type { InternalTypes } from "./exposedInternalTypes.js";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,YAAY,EACX,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,cAAc,EACd,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,yBAAyB,GAC9B,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,iBAAiB,EACjB,wBAAwB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,EACN,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,2BAA2B,GAC3B,MAAM,sCAAsC,CAAC;AAE9C,YAAY,EACX,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,YAAY,EACX,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,cAAc,EACd,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,yBAAyB,GAC9B,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,iBAAiB,EACjB,wBAAwB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,EACN,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,2BAA2B,GAC3B,MAAM,sCAAsC,CAAC;AAE9C,YAAY,EACX,SAAS,EAET,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,8BAA8B,EAC9B,8BAA8B,EAC9B,YAAY,EACZ,kBAAkB,EAClB,QAAQ,GACR,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACX,MAAM,EAEN,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,eAAe,GACf,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GACb,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,GAC/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,OAAO,EAIN,cAAc,GAId,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,EACN,wBAAwB,EAExB,2BAA2B,GAC3B,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,OAAO,EAIN,cAAc,GAId,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,EACN,wBAAwB,EAExB,2BAA2B,GAC3B,MAAM,sCAAsC,CAAC;AAmC9C,OAAO,EAIN,aAAa,GAGb,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Package for client presence within a connected session.\n *\n * See {@link https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme | README.md } for an overview of the package.\n *\n * @packageDocumentation\n */\n\nexport type { ClientConnectionId } from \"./baseTypes.js\";\n\nexport type {\n\tNotificationsWorkspace,\n\tNotificationsWorkspaceSchema,\n\tStatesWorkspace,\n\tStatesWorkspaceEntries,\n\tStatesWorkspaceSchema,\n\tStatesWorkspaceEntry,\n\tWorkspaceAddress,\n} from \"./types.js\";\n\nexport {\n\ttype Attendee,\n\ttype AttendeesEvents,\n\ttype AttendeeId,\n\tAttendeeStatus,\n\ttype Presence,\n\ttype PresenceEvents,\n\ttype PresenceWithNotifications,\n} from \"./presence.js\";\n\nexport type {\n\tBroadcastControls,\n\tBroadcastControlSettings,\n} from \"./broadcastControls.js\";\n\nexport { getPresence, getPresenceAlpha } from \"./experimentalAccess.js\";\n\nexport {\n\tgetPresenceViaDataObject,\n\ttype ExperimentalPresenceDO,\n\tExperimentalPresenceManager,\n} from \"./datastorePresenceManagerFactory.js\";\n\nexport type {\n\tLatestMap,\n\t// LatestMapArguments,\n\tLatestMapArgumentsRaw,\n\tLatestMapClientData,\n\tLatestMapEvents,\n\tLatestMapFactory,\n\tLatestMapItemRemovedClientData,\n\tLatestMapItemUpdatedClientData,\n\tLatestMapRaw,\n\tLatestMapRawEvents,\n\tStateMap,\n} from \"./latestMapValueManager.js\";\nexport type {\n\tLatest,\n\t// LatestArguments,\n\tLatestArgumentsRaw,\n\tLatestEvents,\n\tLatestFactory,\n\tLatestRaw,\n\tLatestRawEvents,\n} from \"./latestValueManager.js\";\nexport type {\n\tAccessor,\n\tLatestClientData,\n\tLatestData,\n\tLatestMetadata,\n\tProxiedValueAccessor,\n\tRawValueAccessor,\n\tStateSchemaValidator,\n\tValueAccessor,\n} from \"./latestValueTypes.js\";\n\nexport {\n\ttype NotificationEmitter,\n\ttype NotificationListenable,\n\ttype NotificationSubscriptions,\n\tNotifications,\n\ttype NotificationsManager,\n\ttype NotificationsManagerEvents,\n} from \"./notificationsManager.js\";\n\nexport { StateFactory } from \"./stateFactory.js\";\n\nexport type { InternalTypes } from \"./exposedInternalTypes.js\";\nexport type { InternalUtilityTypes } from \"./exposedUtilityTypes.js\";\n"]}
|
|
@@ -6,7 +6,7 @@ import type { Listenable } from "@fluidframework/core-interfaces";
|
|
|
6
6
|
import type { DeepReadonly, JsonDeserialized, JsonSerializable } from "@fluidframework/core-interfaces/internal/exposedUtilityTypes";
|
|
7
7
|
import type { BroadcastControls, BroadcastControlSettings } from "./broadcastControls.js";
|
|
8
8
|
import type { InternalTypes } from "./exposedInternalTypes.js";
|
|
9
|
-
import type { LatestClientData, LatestData, LatestMetadata } from "./latestValueTypes.js";
|
|
9
|
+
import type { LatestClientData, LatestData, LatestMetadata, ProxiedValueAccessor, RawValueAccessor, StateSchemaValidator, ValueAccessor } from "./latestValueTypes.js";
|
|
10
10
|
import type { AttendeeId, Attendee, Presence } from "./presence.js";
|
|
11
11
|
/**
|
|
12
12
|
* Collection of latest known values for a specific {@link Attendee}.
|
|
@@ -14,7 +14,7 @@ import type { AttendeeId, Attendee, Presence } from "./presence.js";
|
|
|
14
14
|
* @sealed
|
|
15
15
|
* @beta
|
|
16
16
|
*/
|
|
17
|
-
export interface LatestMapClientData<T, Keys extends string | number, SpecificAttendeeId extends AttendeeId = AttendeeId> {
|
|
17
|
+
export interface LatestMapClientData<T, Keys extends string | number, TValueAccessor extends ValueAccessor<T>, SpecificAttendeeId extends AttendeeId = AttendeeId> {
|
|
18
18
|
/**
|
|
19
19
|
* Associated {@link Attendee}.
|
|
20
20
|
*/
|
|
@@ -25,7 +25,7 @@ export interface LatestMapClientData<T, Keys extends string | number, SpecificAt
|
|
|
25
25
|
* @privateRemarks This could be regular map currently as no Map is
|
|
26
26
|
* stored internally and a new instance is created for every request.
|
|
27
27
|
*/
|
|
28
|
-
items: ReadonlyMap<Keys, LatestData<T>>;
|
|
28
|
+
items: ReadonlyMap<Keys, LatestData<T, TValueAccessor>>;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* State of a single item value, its key, and its metadata.
|
|
@@ -33,7 +33,7 @@ export interface LatestMapClientData<T, Keys extends string | number, SpecificAt
|
|
|
33
33
|
* @sealed
|
|
34
34
|
* @beta
|
|
35
35
|
*/
|
|
36
|
-
export interface LatestMapItemUpdatedClientData<T, K extends string | number
|
|
36
|
+
export interface LatestMapItemUpdatedClientData<T, K extends string | number, TValueAccessor extends ValueAccessor<T>> extends LatestClientData<T, TValueAccessor> {
|
|
37
37
|
/**
|
|
38
38
|
* Key of the updated item.
|
|
39
39
|
*/
|
|
@@ -65,7 +65,7 @@ export interface LatestMapItemRemovedClientData<K extends string | number> {
|
|
|
65
65
|
* @sealed
|
|
66
66
|
* @beta
|
|
67
67
|
*/
|
|
68
|
-
export interface
|
|
68
|
+
export interface LatestMapEvents<T, K extends string | number, TRemoteValueAccessor extends ValueAccessor<T> = ProxiedValueAccessor<T>> {
|
|
69
69
|
/**
|
|
70
70
|
* Raised when any item's value for remote client is updated.
|
|
71
71
|
* @param updates - Map of one or more values updated.
|
|
@@ -74,14 +74,14 @@ export interface LatestMapRawEvents<T, K extends string | number> {
|
|
|
74
74
|
*
|
|
75
75
|
* @eventProperty
|
|
76
76
|
*/
|
|
77
|
-
remoteUpdated: (updates: LatestMapClientData<T, K>) => void;
|
|
77
|
+
remoteUpdated: (updates: LatestMapClientData<T, K, TRemoteValueAccessor>) => void;
|
|
78
78
|
/**
|
|
79
79
|
* Raised when specific item's value of remote client is updated.
|
|
80
80
|
* @param updatedItem - Updated item value.
|
|
81
81
|
*
|
|
82
82
|
* @eventProperty
|
|
83
83
|
*/
|
|
84
|
-
remoteItemUpdated: (updatedItem: LatestMapItemUpdatedClientData<T, K>) => void;
|
|
84
|
+
remoteItemUpdated: (updatedItem: LatestMapItemUpdatedClientData<T, K, TRemoteValueAccessor>) => void;
|
|
85
85
|
/**
|
|
86
86
|
* Raised when specific item of remote client is removed.
|
|
87
87
|
* @param removedItem - Removed item.
|
|
@@ -109,6 +109,13 @@ export interface LatestMapRawEvents<T, K extends string | number> {
|
|
|
109
109
|
key: K;
|
|
110
110
|
}) => void;
|
|
111
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Events from {@link LatestMapRaw}.
|
|
114
|
+
*
|
|
115
|
+
* @sealed
|
|
116
|
+
* @beta
|
|
117
|
+
*/
|
|
118
|
+
export type LatestMapRawEvents<T, K extends string | number> = LatestMapEvents<T, K, RawValueAccessor<T>>;
|
|
112
119
|
/**
|
|
113
120
|
* Map of local client's values. Modifications are transmitted to all other connected clients.
|
|
114
121
|
*
|
|
@@ -183,15 +190,15 @@ export interface StateMap<K extends string | number, V> {
|
|
|
183
190
|
* @sealed
|
|
184
191
|
* @beta
|
|
185
192
|
*/
|
|
186
|
-
export interface
|
|
193
|
+
export interface LatestMap<T, Keys extends string | number = string | number, TRemoteAccessor extends ValueAccessor<T> = ProxiedValueAccessor<T>> {
|
|
187
194
|
/**
|
|
188
195
|
* Containing {@link Presence}
|
|
189
196
|
*/
|
|
190
197
|
readonly presence: Presence;
|
|
191
198
|
/**
|
|
192
|
-
* Events for
|
|
199
|
+
* Events for LatestMap.
|
|
193
200
|
*/
|
|
194
|
-
readonly events: Listenable<
|
|
201
|
+
readonly events: Listenable<LatestMapEvents<T, Keys, TRemoteAccessor>>;
|
|
195
202
|
/**
|
|
196
203
|
* Controls for management of sending updates.
|
|
197
204
|
*/
|
|
@@ -203,7 +210,7 @@ export interface LatestMapRaw<T, Keys extends string | number = string | number>
|
|
|
203
210
|
/**
|
|
204
211
|
* Iterable access to remote clients' map of values.
|
|
205
212
|
*/
|
|
206
|
-
getRemotes(): IterableIterator<LatestMapClientData<T, Keys>>;
|
|
213
|
+
getRemotes(): IterableIterator<LatestMapClientData<T, Keys, TRemoteAccessor>>;
|
|
207
214
|
/**
|
|
208
215
|
* Array of {@link Attendee}s that have provided states.
|
|
209
216
|
*/
|
|
@@ -211,15 +218,27 @@ export interface LatestMapRaw<T, Keys extends string | number = string | number>
|
|
|
211
218
|
/**
|
|
212
219
|
* Access to a specific client's map of values.
|
|
213
220
|
*/
|
|
214
|
-
getRemote(attendee: Attendee): ReadonlyMap<Keys, LatestData<T>>;
|
|
221
|
+
getRemote(attendee: Attendee): ReadonlyMap<Keys, LatestData<T, TRemoteAccessor>>;
|
|
215
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* State that provides a `Map` of latest known values from this client to
|
|
225
|
+
* others and read access to their values.
|
|
226
|
+
* Entries in the map may vary over time and by client, but all values are expected to
|
|
227
|
+
* be of the same type, which may be a union type.
|
|
228
|
+
*
|
|
229
|
+
* @remarks Create using {@link StateFactory.latestMap} registered to {@link StatesWorkspace}.
|
|
230
|
+
*
|
|
231
|
+
* @sealed
|
|
232
|
+
* @beta
|
|
233
|
+
*/
|
|
234
|
+
export type LatestMapRaw<T, Keys extends string | number = string | number> = LatestMap<T, Keys, RawValueAccessor<T>>;
|
|
216
235
|
/**
|
|
217
236
|
* Arguments that are passed to the {@link StateFactory.latestMap} function.
|
|
218
237
|
*
|
|
219
238
|
* @input
|
|
220
239
|
* @beta
|
|
221
240
|
*/
|
|
222
|
-
export interface
|
|
241
|
+
export interface LatestMapArgumentsRaw<T, Keys extends string | number = string | number> {
|
|
223
242
|
/**
|
|
224
243
|
* The initial value of the local state.
|
|
225
244
|
*/
|
|
@@ -231,10 +250,49 @@ export interface LatestMapArguments<T, Keys extends string | number = string | n
|
|
|
231
250
|
*/
|
|
232
251
|
settings?: BroadcastControlSettings | undefined;
|
|
233
252
|
}
|
|
253
|
+
/**
|
|
254
|
+
* Arguments that are passed to the {@link StateFactory.latestMap} function.
|
|
255
|
+
*
|
|
256
|
+
* @input
|
|
257
|
+
* @beta
|
|
258
|
+
*/
|
|
259
|
+
export interface LatestMapArguments<T, Keys extends string | number = string | number> extends LatestMapArgumentsRaw<T, Keys> {
|
|
260
|
+
/**
|
|
261
|
+
* A validator function that will be called to do runtime validation of the custom data stored in a presence state
|
|
262
|
+
* workspace.
|
|
263
|
+
*/
|
|
264
|
+
validator: StateSchemaValidator<T>;
|
|
265
|
+
}
|
|
234
266
|
/**
|
|
235
267
|
* Factory for creating a {@link LatestMapRaw} State object.
|
|
236
268
|
*
|
|
237
269
|
* @beta
|
|
270
|
+
* @sealed
|
|
271
|
+
*/
|
|
272
|
+
export interface LatestMapFactory {
|
|
273
|
+
/**
|
|
274
|
+
* Factory for creating a {@link LatestMapRaw} State object.
|
|
275
|
+
*
|
|
276
|
+
* @privateRemarks (change to `remarks` when adding signature overload)
|
|
277
|
+
* This overload is used when called with {@link LatestMapArgumentsRaw}.
|
|
278
|
+
* That is, if a validator function is _not_ provided.
|
|
279
|
+
*/
|
|
280
|
+
<T, Keys extends string | number = string | number, RegistrationKey extends string = string>(args?: LatestMapArgumentsRaw<T, Keys>): InternalTypes.ManagerFactory<RegistrationKey, InternalTypes.MapValueState<T, Keys>, LatestMapRaw<T, Keys>>;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Factory for creating a {@link LatestMap} or {@link LatestMapRaw} State object.
|
|
284
|
+
*/
|
|
285
|
+
export interface LatestMapFactoryInternal extends LatestMapFactory {
|
|
286
|
+
/**
|
|
287
|
+
* Factory for creating a {@link LatestMap} State object.
|
|
288
|
+
*
|
|
289
|
+
* @remarks
|
|
290
|
+
* This overload is used when called with {@link LatestMapArguments}. That is, if a validator function is provided.
|
|
291
|
+
*/
|
|
292
|
+
<T, Keys extends string | number = string | number, RegistrationKey extends string = string>(args: LatestMapArguments<T, Keys>): InternalTypes.ManagerFactory<RegistrationKey, InternalTypes.MapValueState<T, Keys>, LatestMap<T, Keys>>;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Factory for creating a {@link LatestMap} or {@link LatestMapRaw} State object.
|
|
238
296
|
*/
|
|
239
|
-
export declare
|
|
297
|
+
export declare const latestMap: LatestMapFactoryInternal;
|
|
240
298
|
//# sourceMappingURL=latestMapValueManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"latestMapValueManager.d.ts","sourceRoot":"","sources":["../src/latestMapValueManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,8DAA8D,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAS/D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"latestMapValueManager.d.ts","sourceRoot":"","sources":["../src/latestMapValueManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,8DAA8D,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAS/D,OAAO,KAAK,EACX,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EA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AAC,CAAC,EAAE,IAAI,CAAC,GAC/B,aAAa,CAAC,cAAc,CAC9B,eAAe,EACf,aAAa,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,EACpC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAClB,CAAC;CACF;AAID;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,wBA4DvB,CAAC"}
|
|
@@ -84,7 +84,7 @@ class ValueMapImpl {
|
|
|
84
84
|
return keys[Symbol.iterator]();
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
class
|
|
87
|
+
class LatestMapValueManagerImpl {
|
|
88
88
|
constructor(key, datastore, value, controlSettings) {
|
|
89
89
|
this.key = key;
|
|
90
90
|
this.datastore = datastore;
|
|
@@ -170,7 +170,10 @@ class LatestMapRawValueManagerImpl {
|
|
|
170
170
|
const item = value.items[key];
|
|
171
171
|
const hadPriorValue = currentState.items[key]?.value;
|
|
172
172
|
currentState.items[key] = item;
|
|
173
|
-
const metadata = {
|
|
173
|
+
const metadata = {
|
|
174
|
+
revision: item.rev,
|
|
175
|
+
timestamp: item.timestamp,
|
|
176
|
+
};
|
|
174
177
|
if (item.value !== undefined) {
|
|
175
178
|
const itemValue = asDeeplyReadonlyDeserializedJson(item.value);
|
|
176
179
|
const updatedItem = {
|
|
@@ -195,14 +198,17 @@ class LatestMapRawValueManagerImpl {
|
|
|
195
198
|
return postUpdateActions;
|
|
196
199
|
}
|
|
197
200
|
}
|
|
201
|
+
// #endregion
|
|
198
202
|
/**
|
|
199
|
-
* Factory for creating a {@link LatestMapRaw} State object.
|
|
200
|
-
*
|
|
201
|
-
* @beta
|
|
203
|
+
* Factory for creating a {@link LatestMap} or {@link LatestMapRaw} State object.
|
|
202
204
|
*/
|
|
203
|
-
export
|
|
205
|
+
export const latestMap = (args) => {
|
|
204
206
|
const settings = args?.settings;
|
|
205
207
|
const initialValues = args?.local;
|
|
208
|
+
const validator = args?.validator;
|
|
209
|
+
if (validator !== undefined) {
|
|
210
|
+
throw new Error(`Validators are not yet implemented.`);
|
|
211
|
+
}
|
|
206
212
|
const timestamp = Date.now();
|
|
207
213
|
const value = { rev: 0, items: {} };
|
|
208
214
|
// LatestMapRaw takes ownership of values within initialValues.
|
|
@@ -217,8 +223,8 @@ export function latestMap(args) {
|
|
|
217
223
|
}
|
|
218
224
|
const factory = (key, datastoreHandle) => ({
|
|
219
225
|
initialData: { value, allowableUpdateLatencyMs: settings?.allowableUpdateLatencyMs },
|
|
220
|
-
manager: brandIVM(new
|
|
226
|
+
manager: brandIVM(new LatestMapValueManagerImpl(key, datastoreFromHandle(datastoreHandle), value, settings)),
|
|
221
227
|
});
|
|
222
|
-
return Object.assign(factory, { instanceBase:
|
|
223
|
-
}
|
|
228
|
+
return Object.assign(factory, { instanceBase: LatestMapValueManagerImpl });
|
|
229
|
+
};
|
|
224
230
|
//# sourceMappingURL=latestMapValueManager.js.map
|