@fluidframework/fluid-static 2.0.0-dev.1.3.0.96595 → 2.0.0-dev.1.4.6.106135
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/dist/fluidContainer.d.ts +66 -63
- package/dist/fluidContainer.d.ts.map +1 -1
- package/dist/fluidContainer.js +2 -7
- package/dist/fluidContainer.js.map +1 -1
- package/dist/rootDataObject.d.ts +10 -18
- package/dist/rootDataObject.d.ts.map +1 -1
- package/dist/rootDataObject.js +8 -15
- package/dist/rootDataObject.js.map +1 -1
- package/dist/serviceAudience.d.ts +13 -25
- package/dist/serviceAudience.d.ts.map +1 -1
- package/dist/serviceAudience.js +12 -23
- package/dist/serviceAudience.js.map +1 -1
- package/dist/types.d.ts +69 -75
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/lib/fluidContainer.d.ts +66 -63
- package/lib/fluidContainer.d.ts.map +1 -1
- package/lib/fluidContainer.js +2 -7
- package/lib/fluidContainer.js.map +1 -1
- package/lib/rootDataObject.d.ts +10 -18
- package/lib/rootDataObject.d.ts.map +1 -1
- package/lib/rootDataObject.js +8 -15
- package/lib/rootDataObject.js.map +1 -1
- package/lib/serviceAudience.d.ts +13 -25
- package/lib/serviceAudience.d.ts.map +1 -1
- package/lib/serviceAudience.js +12 -23
- package/lib/serviceAudience.js.map +1 -1
- package/lib/types.d.ts +69 -75
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/package.json +15 -35
- package/src/fluidContainer.ts +66 -70
- package/src/rootDataObject.ts +10 -18
- package/src/serviceAudience.ts +13 -25
- package/src/types.ts +69 -80
package/src/types.ts
CHANGED
|
@@ -9,69 +9,60 @@ import { IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
|
9
9
|
import { IFluidDataStoreFactory } from "@fluidframework/runtime-definitions";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* A mapping of string identifiers to instantiated
|
|
12
|
+
* A mapping of string identifiers to instantiated DataObjects or SharedObjects.
|
|
13
13
|
*/
|
|
14
14
|
export type LoadableObjectRecord = Record<string, IFluidLoadable>;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* A mapping of string identifiers to classes that will later be used to instantiate a corresponding
|
|
18
|
-
* or
|
|
17
|
+
* A mapping of string identifiers to classes that will later be used to instantiate a corresponding DataObject
|
|
18
|
+
* or SharedObject in a LoadableObjectRecord.
|
|
19
19
|
*/
|
|
20
20
|
export type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* A class object of
|
|
24
|
-
*
|
|
25
|
-
* @typeParam T - The class of the `DataObject` or `SharedObject`.
|
|
23
|
+
* A LoadableObjectClass is an class object of DataObject or SharedObject
|
|
24
|
+
* @typeParam T - The class of the DataObject or SharedObject
|
|
26
25
|
*/
|
|
27
26
|
export type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
|
|
28
27
|
|
|
29
28
|
/**
|
|
30
|
-
* A class that has a factory that can create a
|
|
31
|
-
* constructor that will return the type of the
|
|
32
|
-
*
|
|
33
|
-
* @typeParam T - The class of the `DataObject`.
|
|
29
|
+
* A DataObjectClass is a class that has a factory that can create a DataObject and a
|
|
30
|
+
* constructor that will return the type of the DataObject.
|
|
31
|
+
* @typeParam T - The class of the DataObject
|
|
34
32
|
*/
|
|
35
33
|
export type DataObjectClass<T extends IFluidLoadable>
|
|
36
34
|
= { readonly factory: IFluidDataStoreFactory; } & LoadableObjectCtor<T>;
|
|
37
35
|
|
|
38
36
|
/**
|
|
39
|
-
* A class that has a factory that can create a
|
|
40
|
-
* constructor that will return the type of the
|
|
41
|
-
*
|
|
42
|
-
* @typeParam T - The class of the `SharedObject`.
|
|
37
|
+
* A SharedObjectClass is a class that has a factory that can create a DDS (SharedObject) and a
|
|
38
|
+
* constructor that will return the type of the DataObject.
|
|
39
|
+
* @typeParam T - The class of the SharedObject
|
|
43
40
|
*/
|
|
44
41
|
export type SharedObjectClass<T extends IFluidLoadable>
|
|
45
42
|
= { readonly getFactory: () => IChannelFactory; } & LoadableObjectCtor<T>;
|
|
46
43
|
|
|
47
44
|
/**
|
|
48
|
-
* An object with a constructor that will return an
|
|
49
|
-
*
|
|
50
|
-
* @typeParam T - The class of the loadable object.
|
|
45
|
+
* An object with a constructor that will return an `IFluidLoadable`.
|
|
46
|
+
* @typeParam T - The class of the loadable object
|
|
51
47
|
*/
|
|
52
48
|
export type LoadableObjectCtor<T extends IFluidLoadable> = new(...args: any[]) => T;
|
|
53
49
|
|
|
54
50
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* It includes both the instances of objects that are initially available upon `Container` creation, as well
|
|
60
|
-
* as the types of objects that may be dynamically created throughout the lifetime of the `Container`.
|
|
51
|
+
* The ContainerSchema declares the Fluid objects that will be available in the container. It includes both the
|
|
52
|
+
* instances of objects that are initially available upon container creation, as well as the types of objects that may
|
|
53
|
+
* be dynamically created throughout the lifetime of the container.
|
|
61
54
|
*/
|
|
62
55
|
export interface ContainerSchema {
|
|
63
56
|
/**
|
|
64
|
-
* Defines loadable objects that will be created when the
|
|
65
|
-
*
|
|
66
|
-
* @remarks It uses the key as the id and the value as the loadable object to create.
|
|
57
|
+
* Defines loadable objects that will be created when the `Container` is first created.
|
|
58
|
+
* It uses the key as the id and the value as the loadable object to create.
|
|
67
59
|
*
|
|
68
60
|
* @example
|
|
69
|
-
*
|
|
70
|
-
* In the example below two objects will be created when the `Container` is first
|
|
61
|
+
* In the example below two objects will be created when the Container is first
|
|
71
62
|
* created. One with id "map1" that will return a `SharedMap` and the other with
|
|
72
63
|
* id "pair1" that will return a `KeyValueDataObject`.
|
|
73
64
|
*
|
|
74
|
-
* ```
|
|
65
|
+
* ```
|
|
75
66
|
* {
|
|
76
67
|
* map1: SharedMap,
|
|
77
68
|
* pair1: KeyValueDataObject,
|
|
@@ -81,9 +72,7 @@ export interface ContainerSchema {
|
|
|
81
72
|
initialObjects: LoadableObjectClassRecord;
|
|
82
73
|
|
|
83
74
|
/**
|
|
84
|
-
* Loadable objects that can be created after the initial
|
|
85
|
-
*
|
|
86
|
-
* @remarks
|
|
75
|
+
* Dynamic objects are Loadable objects that can be created after the initial Container creation.
|
|
87
76
|
*
|
|
88
77
|
* Types defined in `initialObjects` will always be available and are not required to be provided here.
|
|
89
78
|
*
|
|
@@ -93,60 +82,62 @@ export interface ContainerSchema {
|
|
|
93
82
|
dynamicObjectTypes?: LoadableObjectClass<any>[];
|
|
94
83
|
}
|
|
95
84
|
|
|
96
|
-
/**
|
|
97
|
-
* Signature for {@link IMember} change events.
|
|
98
|
-
*
|
|
99
|
-
* @param clientId - A unique identifier for the client.
|
|
100
|
-
* @param member - The service-specific member object for the client.
|
|
101
|
-
*
|
|
102
|
-
* @see See {@link IServiceAudienceEvents} for usage details.
|
|
103
|
-
*/
|
|
104
|
-
export type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
|
|
105
|
-
|
|
106
85
|
/**
|
|
107
86
|
* Events that trigger when the roster of members in the Fluid session change.
|
|
87
|
+
* Only changes that would be reflected in the returned map of {@link IServiceAudience}'s
|
|
88
|
+
* {@link IServiceAudience.getMembers} method will emit events.
|
|
108
89
|
*
|
|
109
90
|
* @remarks
|
|
110
91
|
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
92
|
+
* The following is the list of events emitted.
|
|
93
|
+
*
|
|
94
|
+
* ### "membersChanged"
|
|
95
|
+
*
|
|
96
|
+
* The "membersChanged" event is emitted when a member is either added or removed.
|
|
97
|
+
*
|
|
98
|
+
* #### Listener signature
|
|
99
|
+
*
|
|
100
|
+
* ```typescript
|
|
101
|
+
* () => void;
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* ### "memberAdded"
|
|
113
105
|
*
|
|
114
|
-
*
|
|
106
|
+
* The "memberAdded" event is emitted when a member joins the audience.
|
|
107
|
+
*
|
|
108
|
+
* #### Listener signature
|
|
109
|
+
*
|
|
110
|
+
* ```typescript
|
|
111
|
+
* (clientId: string, member: M) => void;
|
|
112
|
+
* ```
|
|
113
|
+
* - `clientId` - A unique identifier for the client
|
|
114
|
+
*
|
|
115
|
+
* - `member` - The service-specific member object for the client
|
|
116
|
+
*
|
|
117
|
+
* ### "memberRemoved"
|
|
118
|
+
*
|
|
119
|
+
* The "memberRemoved" event is emitted when a member leaves the audience.
|
|
120
|
+
*
|
|
121
|
+
* #### Listener signature
|
|
122
|
+
*
|
|
123
|
+
* ```typescript
|
|
124
|
+
* (clientId: string, member: M) => void;
|
|
125
|
+
* ```
|
|
126
|
+
* - `clientId` - A unique identifier for the client
|
|
127
|
+
*
|
|
128
|
+
* - `member` - The service-specific member object for the client
|
|
129
|
+
* @typeParam M - A service-specific member type.
|
|
115
130
|
*/
|
|
116
131
|
export interface IServiceAudienceEvents<M extends IMember> extends IEvent {
|
|
117
|
-
/* eslint-disable @typescript-eslint/unified-signatures */
|
|
118
|
-
/**
|
|
119
|
-
* Emitted when a {@link IMember | member}(s) are either added or removed.
|
|
120
|
-
*
|
|
121
|
-
* @eventProperty
|
|
122
|
-
*/
|
|
123
132
|
(event: "membersChanged", listener: () => void): void;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Emitted when a {@link IMember | member} joins the audience.
|
|
127
|
-
*
|
|
128
|
-
* @eventProperty
|
|
129
|
-
*/
|
|
130
|
-
(event: "memberAdded", listener: MemberChangedListener<M>): void;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Emitted when a {@link IMember | member} leaves the audience.
|
|
134
|
-
*
|
|
135
|
-
* @eventProperty
|
|
136
|
-
*/
|
|
137
|
-
(event: "memberRemoved", listener: MemberChangedListener<M>): void;
|
|
138
|
-
/* eslint-enable @typescript-eslint/unified-signatures */
|
|
133
|
+
(event: "memberAdded" | "memberRemoved", listener: (clientId: string, member: M) => void): void;
|
|
139
134
|
}
|
|
140
135
|
|
|
141
136
|
/**
|
|
142
|
-
* Base interface to be implemented to fetch each service's audience.
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* The type parameter `M` allows consumers to further extend the client object with service-specific
|
|
147
|
-
* details about the connecting client, such as device information, environment, or a username.
|
|
148
|
-
*
|
|
149
|
-
* @typeParam M - A service-specific {@link IMember} type.
|
|
137
|
+
* Base interface to be implemented to fetch each service's audience. The generic M allows consumers to further
|
|
138
|
+
* extend the client object with service-specific details about the connecting client, such as device information,
|
|
139
|
+
* environment, or a username.
|
|
140
|
+
* @typeParam M - A service-specific member type.
|
|
150
141
|
*/
|
|
151
142
|
export interface IServiceAudience<M extends IMember> extends IEventProvider<IServiceAudienceEvents<M>> {
|
|
152
143
|
/**
|
|
@@ -163,9 +154,8 @@ export interface IServiceAudience<M extends IMember> extends IEventProvider<ISer
|
|
|
163
154
|
}
|
|
164
155
|
|
|
165
156
|
/**
|
|
166
|
-
* Base interface for information for each connection made to the Fluid session.
|
|
167
|
-
*
|
|
168
|
-
* @remarks This interface can be extended to provide additional information specific to each service.
|
|
157
|
+
* Base interface for information for each connection made to the Fluid session. This interface can be extended
|
|
158
|
+
* to provide additional information specific to each service.
|
|
169
159
|
*/
|
|
170
160
|
export interface IConnection {
|
|
171
161
|
/**
|
|
@@ -180,9 +170,8 @@ export interface IConnection {
|
|
|
180
170
|
}
|
|
181
171
|
|
|
182
172
|
/**
|
|
183
|
-
* Base interface to be implemented to fetch each service's member.
|
|
184
|
-
*
|
|
185
|
-
* @remarks This interface can be extended by each service to provide additional service-specific user metadata.
|
|
173
|
+
* Base interface to be implemented to fetch each service's member. This interface can be extended by each service
|
|
174
|
+
* to provide additional service-specific user metadata.
|
|
186
175
|
*/
|
|
187
176
|
export interface IMember {
|
|
188
177
|
/**
|