@fluidframework/datastore-definitions 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.224419

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.
Files changed (40) hide show
  1. package/.eslintrc.cjs +11 -0
  2. package/CHANGELOG.md +215 -0
  3. package/README.md +45 -7
  4. package/api-extractor-lint.json +4 -0
  5. package/api-extractor.json +2 -2
  6. package/api-report/datastore-definitions.api.md +156 -0
  7. package/dist/channel.d.ts +71 -16
  8. package/dist/channel.d.ts.map +1 -1
  9. package/dist/channel.js.map +1 -1
  10. package/dist/dataStoreRuntime.d.ts +28 -7
  11. package/dist/dataStoreRuntime.d.ts.map +1 -1
  12. package/dist/dataStoreRuntime.js.map +1 -1
  13. package/dist/datastore-definitions-alpha.d.ts +480 -0
  14. package/dist/datastore-definitions-beta.d.ts +395 -0
  15. package/dist/datastore-definitions-public.d.ts +395 -0
  16. package/dist/datastore-definitions-untrimmed.d.ts +480 -0
  17. package/dist/index.d.ts +10 -10
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +0 -21
  20. package/dist/index.js.map +1 -1
  21. package/dist/jsonable.d.ts +46 -14
  22. package/dist/jsonable.d.ts.map +1 -1
  23. package/dist/jsonable.js.map +1 -1
  24. package/dist/serializable.d.ts +5 -4
  25. package/dist/serializable.d.ts.map +1 -1
  26. package/dist/serializable.js.map +1 -1
  27. package/dist/storage.d.ts +1 -0
  28. package/dist/storage.d.ts.map +1 -1
  29. package/dist/storage.js.map +1 -1
  30. package/dist/tsdoc-metadata.json +11 -0
  31. package/package.json +64 -41
  32. package/prettier.config.cjs +8 -0
  33. package/src/channel.ts +256 -200
  34. package/src/dataStoreRuntime.ts +117 -96
  35. package/src/index.ts +17 -10
  36. package/src/jsonable.ts +80 -23
  37. package/src/serializable.ts +5 -4
  38. package/src/storage.ts +14 -13
  39. package/tsconfig.json +10 -12
  40. package/.eslintrc.js +0 -13
package/.eslintrc.cjs ADDED
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ module.exports = {
7
+ parserOptions: {
8
+ project: ["./tsconfig.json", "./src/test/tsconfig.json"],
9
+ },
10
+ extends: ["@fluidframework/eslint-config-fluid/minimal", "prettier"],
11
+ };
package/CHANGELOG.md ADDED
@@ -0,0 +1,215 @@
1
+ # @fluidframework/datastore-definitions
2
+
3
+ ## 2.0.0-internal.8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - datastore-definitions: Removed request and IFluidRouter from IFluidDataStoreRuntime [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
8
+
9
+ The `request` method and `IFluidRouter` property have been removed from `IFluidDataStoreRuntime`. Please migrate all
10
+ usage to the `IFluidDataStoreRuntime.entryPoint` API.
11
+
12
+ See
13
+ [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md)
14
+ for more details.
15
+
16
+ - datastore-definitions: Jsonable and Serializable now require a generic parameter [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
17
+
18
+ The `Jsonable` and `Serializable` types from @fluidframework/datastore-definitions now require a generic parameter and
19
+ if that type is `any` or `unknown`will return a new result `JsonableTypeWith<>` that more accurately represents the
20
+ limitation of serialization.
21
+
22
+ Additional modifications:
23
+
24
+ - `Jsonable`'s `TReplacement` parameter default has also been changed from `void` to `never`, which now disallows
25
+ `void`.
26
+ - Unrecognized primitive types like `symbol` are now filtered to `never` instead of `{}`.
27
+ - Recursive types with arrays (`[]`) are now supported.
28
+
29
+ `Serializable` is commonly used for DDS values and now requires more precision when using them. For example SharedMatrix
30
+ (unqualified) has an `any` default that meant values were `Serializable<any>` (i.e. `any`), but now `Serializable<any>`
31
+ is `JsonableTypeWith<IFluidHandle>` which may be problematic for reading or writing. Preferred correction is to specify
32
+ the value type but casting through `any` may provide a quick fix.
33
+
34
+ ## 2.0.0-internal.7.4.0
35
+
36
+ Dependency updates only.
37
+
38
+ ## 2.0.0-internal.7.3.0
39
+
40
+ Dependency updates only.
41
+
42
+ ## 2.0.0-internal.7.2.0
43
+
44
+ Dependency updates only.
45
+
46
+ ## 2.0.0-internal.7.1.0
47
+
48
+ Dependency updates only.
49
+
50
+ ## 2.0.0-internal.7.0.0
51
+
52
+ ### Major Changes
53
+
54
+ - Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
55
+
56
+ This included the following changes from the protocol-definitions release:
57
+
58
+ - Updating signal interfaces for some planned improvements. The intention is split the interface between signals
59
+ submitted by clients to the server and the resulting signals sent from the server to clients.
60
+ - A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
61
+ been added, which will be the typing for signals sent from the client to the server. Both extend a new
62
+ ISignalMessageBase interface that contains common members.
63
+ - The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
64
+
65
+ - Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
66
+
67
+ Dependencies on the following Fluid server package have been updated to version 2.0.1:
68
+
69
+ - @fluidframework/gitresources: 2.0.1
70
+ - @fluidframework/server-kafka-orderer: 2.0.1
71
+ - @fluidframework/server-lambdas: 2.0.1
72
+ - @fluidframework/server-lambdas-driver: 2.0.1
73
+ - @fluidframework/server-local-server: 2.0.1
74
+ - @fluidframework/server-memory-orderer: 2.0.1
75
+ - @fluidframework/protocol-base: 2.0.1
76
+ - @fluidframework/server-routerlicious: 2.0.1
77
+ - @fluidframework/server-routerlicious-base: 2.0.1
78
+ - @fluidframework/server-services: 2.0.1
79
+ - @fluidframework/server-services-client: 2.0.1
80
+ - @fluidframework/server-services-core: 2.0.1
81
+ - @fluidframework/server-services-ordering-kafkanode: 2.0.1
82
+ - @fluidframework/server-services-ordering-rdkafka: 2.0.1
83
+ - @fluidframework/server-services-ordering-zookeeper: 2.0.1
84
+ - @fluidframework/server-services-shared: 2.0.1
85
+ - @fluidframework/server-services-telemetry: 2.0.1
86
+ - @fluidframework/server-services-utils: 2.0.1
87
+ - @fluidframework/server-test-utils: 2.0.1
88
+ - tinylicious: 2.0.1
89
+
90
+ - test-utils: provideEntryPoint is required [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
91
+
92
+ The optional `provideEntryPoint` method has become required on a number of constructors. A value will need to be provided to the following classes:
93
+
94
+ - `BaseContainerRuntimeFactory`
95
+ - `RuntimeFactory`
96
+ - `ContainerRuntime` (constructor and `loadRuntime`)
97
+ - `FluidDataStoreRuntime`
98
+
99
+ See [testContainerRuntimeFactoryWithDefaultDataStore.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/test/test-utils/src/testContainerRuntimeFactoryWithDefaultDataStore.ts) for an example implemtation of `provideEntryPoint` for ContainerRuntime.
100
+ See [pureDataObjectFactory.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts#L83) for an example implementation of `provideEntryPoint` for DataStoreRuntime.
101
+
102
+ Subsequently, various `entryPoint` and `getEntryPoint()` endpoints have become required. Please see [containerRuntime.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/runtime/container-runtime/src/containerRuntime.ts) for example implementations of these APIs.
103
+
104
+ For more details, see [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md)
105
+
106
+ - Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
107
+
108
+ The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
109
+
110
+ ## 2.0.0-internal.6.4.0
111
+
112
+ Dependency updates only.
113
+
114
+ ## 2.0.0-internal.6.3.0
115
+
116
+ Dependency updates only.
117
+
118
+ ## 2.0.0-internal.6.2.0
119
+
120
+ ### Minor Changes
121
+
122
+ - Remove use of @fluidframework/common-definitions ([#16638](https://github.com/microsoft/FluidFramework/issues/16638)) [a8c81509c9](https://github.com/microsoft/FluidFramework/commits/a8c81509c9bf09cfb2092ebcf7265205f9eb6dbf)
123
+
124
+ The **@fluidframework/common-definitions** package is being deprecated, so the following interfaces and types are now
125
+ imported from the **@fluidframework/core-interfaces** package:
126
+
127
+ - interface IDisposable
128
+ - interface IErrorEvent
129
+ - interface IErrorEvent
130
+ - interface IEvent
131
+ - interface IEventProvider
132
+ - interface ILoggingError
133
+ - interface ITaggedTelemetryPropertyType
134
+ - interface ITelemetryBaseEvent
135
+ - interface ITelemetryBaseLogger
136
+ - interface ITelemetryErrorEvent
137
+ - interface ITelemetryGenericEvent
138
+ - interface ITelemetryLogger
139
+ - interface ITelemetryPerformanceEvent
140
+ - interface ITelemetryProperties
141
+ - type ExtendEventProvider
142
+ - type IEventThisPlaceHolder
143
+ - type IEventTransformer
144
+ - type ReplaceIEventThisPlaceHolder
145
+ - type ReplaceIEventThisPlaceHolder
146
+ - type TelemetryEventCategory
147
+ - type TelemetryEventPropertyType
148
+
149
+ ## 2.0.0-internal.6.1.0
150
+
151
+ Dependency updates only.
152
+
153
+ ## 2.0.0-internal.6.0.0
154
+
155
+ ### Major Changes
156
+
157
+ - Request APIs deprecated from many places [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
158
+
159
+ The `request` API (associated with the `IFluidRouter` interface) has been deprecated on a number of classes and interfaces. The following are impacted:
160
+
161
+ - `IRuntime` and `ContainerRuntime`
162
+ - `IFluidDataStoreRuntime` and `FluidDataStoreRuntime`
163
+ - `IFluidDataStoreChannel`
164
+ - `MockFluidDataStoreRuntime`
165
+ - `TestFluidObject`
166
+
167
+ Please migrate usage to the corresponding `entryPoint` or `getEntryPoint()` of the object. The value for these "entryPoint" related APIs is determined from factories (for `IRuntime` and `IFluidDataStoreRuntime`) via the `initializeEntryPoint` method. If no method is passed to the factory, the corresponding `entryPoint` and `getEntryPoint()` will be undefined.
168
+
169
+ For an example implementation of `initializeEntryPoint`, see [pureDataObjectFactory.ts](https://github.com/microsoft/FluidFramework/blob/next/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts#L84).
170
+
171
+ More information of the migration off the request pattern, and current status of its removal, is documented in [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md).
172
+
173
+ - IChannel.owner removed [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
174
+
175
+ The owner property on IChannel was deprecated in 2.0.0-internal.5.1.0 and has now been removed.
176
+
177
+ - Upgraded typescript transpilation target to ES2020 [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
178
+
179
+ Upgraded typescript transpilation target to ES2020. This is done in order to decrease the bundle sizes of Fluid Framework packages. This has provided size improvements across the board for ex. Loader, Driver, Runtime etc. Reduced bundle sizes helps to load lesser code in apps and hence also helps to improve the perf.If any app wants to target any older versions of browsers with which this target version is not compatible, then they can use packages like babel to transpile to a older target.
180
+
181
+ - IDeltaManager members disposed and dispose() removed [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
182
+
183
+ IDeltaManager members disposed and dispose() were deprecated in 2.0.0-internal.5.3.0 and have now been removed.
184
+
185
+ ## 2.0.0-internal.5.4.0
186
+
187
+ Dependency updates only.
188
+
189
+ ## 2.0.0-internal.5.3.0
190
+
191
+ Dependency updates only.
192
+
193
+ ## 2.0.0-internal.5.2.0
194
+
195
+ Dependency updates only.
196
+
197
+ ## 2.0.0-internal.5.1.0
198
+
199
+ ### Minor Changes
200
+
201
+ - IChannel.owner deprecated ([#16024](https://github.com/microsoft/FluidFramework/issues/16024)) [92997468e7](https://github.com/microsoft/FluidFramework/commits/92997468e72c48ff39afb9e15fcdca4e87ac8dca)
202
+
203
+ The owner property on IChannel has been deprecated and will be removed in an upcoming release. This property does nothing.
204
+
205
+ ## 2.0.0-internal.5.0.0
206
+
207
+ Dependency updates only.
208
+
209
+ ## 2.0.0-internal.4.4.0
210
+
211
+ Dependency updates only.
212
+
213
+ ## 2.0.0-internal.4.1.0
214
+
215
+ Dependency updates only.
package/README.md CHANGED
@@ -2,17 +2,38 @@
2
2
 
3
3
  Interface `IFluidDataStoreRuntime` specifies the data store developer API.
4
4
 
5
+ <!-- AUTO-GENERATED-CONTENT:START (README_DEPENDENCY_GUIDELINES_SECTION:includeHeading=TRUE) -->
6
+
7
+ <!-- prettier-ignore-start -->
8
+ <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
9
+
10
+ ## Using Fluid Framework libraries
11
+
12
+ When taking a dependency on a Fluid Framework library, we recommend using a `^` (caret) version range, such as `^1.3.4`.
13
+ While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
14
+ library consumers should always prefer `^`.
15
+
16
+ Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
17
+ you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
18
+ Standard `^` and `~` ranges will not work as expected.
19
+ See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
20
+ package for more information including tools to convert between version schemes.
21
+
22
+ <!-- prettier-ignore-end -->
23
+
24
+ <!-- AUTO-GENERATED-CONTENT:END -->
25
+
5
26
  ## Capabilities exposed on `IFluidDataStoreRuntime`
6
27
 
7
28
  _TODO: The full set of functionality is under review_
8
29
 
9
- - DDS creation and management APIs
10
- - Container info and states (connection state, documentId, quorum, audience, etc.)
11
- - Loader
12
- - Op/Signal submission
13
- - Snapshotting
14
- - DeltaManager
15
- - Blob Management API.
30
+ - DDS creation and management APIs
31
+ - Container info and states (connection state, documentId, quorum, audience, etc.)
32
+ - Loader
33
+ - Op/Signal submission
34
+ - Snapshotting
35
+ - DeltaManager
36
+ - Blob Management API.
16
37
 
17
38
  ### Signals
18
39
 
@@ -25,3 +46,20 @@ For this reason people usually stick the currentSeq on the signal, so other clie
25
46
 
26
47
  You can send a signal via the container or data store runtime. The container will emit the signal event on all signals,
27
48
  but a data store will emit the signal event only on signals emitted on that data store runtime.
49
+
50
+ <!-- AUTO-GENERATED-CONTENT:START (README_TRADEMARK_SECTION:includeHeading=TRUE) -->
51
+
52
+ <!-- prettier-ignore-start -->
53
+ <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
54
+
55
+ ## Trademark
56
+
57
+ This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
58
+
59
+ Use of these trademarks or logos must follow Microsoft's [Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
60
+
61
+ Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
62
+
63
+ <!-- prettier-ignore-end -->
64
+
65
+ <!-- AUTO-GENERATED-CONTENT:END -->
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.json"
4
+ }
@@ -1,4 +1,4 @@
1
1
  {
2
- "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "@fluidframework/build-common/api-extractor-common-report.json"
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-base.json"
4
4
  }
@@ -0,0 +1,156 @@
1
+ ## API Report File for "@fluidframework/datastore-definitions"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { AttachState } from '@fluidframework/container-definitions';
8
+ import { FluidObject } from '@fluidframework/core-interfaces';
9
+ import { IAudience } from '@fluidframework/container-definitions';
10
+ import { IDeltaManager } from '@fluidframework/container-definitions';
11
+ import { IDisposable } from '@fluidframework/core-interfaces';
12
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
13
+ import { IEvent } from '@fluidframework/core-interfaces';
14
+ import { IEventProvider } from '@fluidframework/core-interfaces';
15
+ import { IExperimentalIncrementalSummaryContext } from '@fluidframework/runtime-definitions';
16
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
17
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
18
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
19
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
20
+ import { IIdCompressor } from '@fluidframework/id-compressor';
21
+ import { IInboundSignalMessage } from '@fluidframework/runtime-definitions';
22
+ import { ILoaderOptions } from '@fluidframework/container-definitions';
23
+ import { IQuorumClients } from '@fluidframework/protocol-definitions';
24
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
25
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
26
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
27
+ import { ITelemetryLogger } from '@fluidframework/core-interfaces';
28
+
29
+ // @public (undocumented)
30
+ export interface IChannel extends IFluidLoadable {
31
+ // (undocumented)
32
+ readonly attributes: IChannelAttributes;
33
+ connect(services: IChannelServices): void;
34
+ getAttachSummary(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
35
+ getGCData(fullGC?: boolean): IGarbageCollectionData;
36
+ readonly id: string;
37
+ isAttached(): boolean;
38
+ summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): Promise<ISummaryTreeWithStats>;
39
+ }
40
+
41
+ // @public
42
+ export interface IChannelAttributes {
43
+ readonly packageVersion?: string;
44
+ readonly snapshotFormatVersion: string;
45
+ readonly type: string;
46
+ }
47
+
48
+ // @public
49
+ export interface IChannelFactory {
50
+ readonly attributes: IChannelAttributes;
51
+ create(runtime: IFluidDataStoreRuntime, id: string): IChannel;
52
+ load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, channelAttributes: Readonly<IChannelAttributes>): Promise<IChannel>;
53
+ readonly type: string;
54
+ }
55
+
56
+ // @public
57
+ export interface IChannelServices {
58
+ // (undocumented)
59
+ deltaConnection: IDeltaConnection;
60
+ // (undocumented)
61
+ objectStorage: IChannelStorageService;
62
+ }
63
+
64
+ // @public
65
+ export interface IChannelStorageService {
66
+ contains(path: string): Promise<boolean>;
67
+ list(path: string): Promise<string[]>;
68
+ readBlob(path: string): Promise<ArrayBufferLike>;
69
+ }
70
+
71
+ // @public
72
+ export interface IDeltaConnection {
73
+ addedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;
74
+ attach(handler: IDeltaHandler): void;
75
+ // (undocumented)
76
+ connected: boolean;
77
+ dirty(): void;
78
+ submit(messageContent: any, localOpMetadata: unknown): void;
79
+ }
80
+
81
+ // @public
82
+ export interface IDeltaHandler {
83
+ applyStashedOp(message: any): unknown;
84
+ process: (message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) => void;
85
+ reSubmit(message: any, localOpMetadata: unknown): void;
86
+ rollback?(message: any, localOpMetadata: unknown): void;
87
+ setConnectionState(connected: boolean): void;
88
+ }
89
+
90
+ // @public
91
+ export interface IFluidDataStoreRuntime extends IEventProvider<IFluidDataStoreRuntimeEvents>, IDisposable {
92
+ readonly attachState: AttachState;
93
+ bindChannel(channel: IChannel): void;
94
+ // (undocumented)
95
+ readonly channelsRoutingContext: IFluidHandleContext;
96
+ // (undocumented)
97
+ readonly clientId: string | undefined;
98
+ // (undocumented)
99
+ readonly connected: boolean;
100
+ createChannel(id: string | undefined, type: string): IChannel;
101
+ // (undocumented)
102
+ readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
103
+ ensureNoDataModelChanges<T>(callback: () => T): T;
104
+ readonly entryPoint: IFluidHandle<FluidObject>;
105
+ getAudience(): IAudience;
106
+ getChannel(id: string): Promise<IChannel>;
107
+ getQuorum(): IQuorumClients;
108
+ // (undocumented)
109
+ readonly id: string;
110
+ // (undocumented)
111
+ readonly idCompressor?: IIdCompressor;
112
+ // (undocumented)
113
+ readonly IFluidHandleContext: IFluidHandleContext;
114
+ // (undocumented)
115
+ readonly logger: ITelemetryLogger;
116
+ // (undocumented)
117
+ readonly objectsRoutingContext: IFluidHandleContext;
118
+ // (undocumented)
119
+ readonly options: ILoaderOptions;
120
+ // (undocumented)
121
+ readonly rootRoutingContext: IFluidHandleContext;
122
+ submitSignal(type: string, content: any, targetClientId?: string): void;
123
+ uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
124
+ waitAttached(): Promise<void>;
125
+ }
126
+
127
+ // @public
128
+ export interface IFluidDataStoreRuntimeEvents extends IEvent {
129
+ // (undocumented)
130
+ (event: "disconnected" | "dispose" | "attaching" | "attached", listener: () => void): any;
131
+ // (undocumented)
132
+ (event: "op", listener: (message: ISequencedDocumentMessage) => void): any;
133
+ // (undocumented)
134
+ (event: "signal", listener: (message: IInboundSignalMessage, local: boolean) => void): any;
135
+ // (undocumented)
136
+ (event: "connected", listener: (clientId: string) => void): any;
137
+ }
138
+
139
+ // @alpha (undocumented)
140
+ export interface Internal_InterfaceOfJsonableTypesWith<T> {
141
+ // (undocumented)
142
+ [index: string | number]: JsonableTypeWith<T>;
143
+ }
144
+
145
+ // @alpha
146
+ export type Jsonable<T, TReplaced = never> = boolean extends (T extends never ? true : false) ? JsonableTypeWith<TReplaced> : unknown extends T ? JsonableTypeWith<TReplaced> : T extends undefined | null | boolean | number | string | TReplaced ? T : Extract<T, Function> extends never ? T extends object ? T extends (infer U)[] ? Jsonable<U, TReplaced>[] : {
147
+ [K in keyof T]: Extract<K, symbol> extends never ? Jsonable<T[K], TReplaced> : never;
148
+ } : never : never;
149
+
150
+ // @alpha
151
+ export type JsonableTypeWith<T> = undefined | null | boolean | number | string | T | Internal_InterfaceOfJsonableTypesWith<T> | ArrayLike<JsonableTypeWith<T>>;
152
+
153
+ // @alpha
154
+ export type Serializable<T> = Jsonable<T, IFluidHandle>;
155
+
156
+ ```
package/dist/channel.d.ts CHANGED
@@ -4,45 +4,78 @@
4
4
  */
5
5
  import { IFluidHandle, IFluidLoadable } from "@fluidframework/core-interfaces";
6
6
  import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
7
- import { IGarbageCollectionData, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
7
+ import { IGarbageCollectionData, IExperimentalIncrementalSummaryContext, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
8
8
  import { IChannelAttributes } from "./storage";
9
9
  import { IFluidDataStoreRuntime } from "./dataStoreRuntime";
10
+ /**
11
+ * @public
12
+ */
10
13
  export interface IChannel extends IFluidLoadable {
11
14
  /**
12
15
  * A readonly identifier for the channel
13
16
  */
14
17
  readonly id: string;
15
- readonly owner?: string;
16
18
  readonly attributes: IChannelAttributes;
17
19
  /**
18
20
  * Generates summary of the channel synchronously. It is called when an `attach message`
19
21
  * for a local channel is generated. In other words, when the channel is being attached
20
22
  * to make it visible to other clients.
21
- * Note: Since Attach Summary is generated for local channels when making them visible to
23
+ *
24
+ * @remarks
25
+ *
26
+ * Note: Since the Attach Summary is generated for local channels when making them visible to
22
27
  * remote clients, they don't have any previous summaries to compare against. For this reason,
23
- * The attach summary cannot contain summary handles (paths to sub-trees or blobs).
24
- * It can, however, contain ISummaryAttachment (handles to blobs uploaded async via the blob manager).
25
- * @param fullTree - flag indicating whether the attempt should generate a full
28
+ * the attach summary cannot contain summary handles (paths to sub-trees or blobs).
29
+ * It can, however, contain {@link @fluidframework/protocol-definitions#ISummaryAttachment}
30
+ * (handles to blobs uploaded async via the blob manager).
31
+ *
32
+ * @param fullTree - A flag indicating whether the attempt should generate a full
26
33
  * summary tree without any handles for unchanged subtrees.
27
- * @param trackState - optimization for tracking state of objects across summaries. If the state
28
- * of an object did not change since last successful summary, an ISummaryHandle can be used
29
- * instead of re-summarizing it. If this is false, the expectation is that you should never
30
- * send an ISummaryHandle since you are not expected to track state.
34
+ *
35
+ * Default: `false`
36
+ *
37
+ * @param trackState - An optimization for tracking state of objects across summaries. If the state
38
+ * of an object did not change since last successful summary, an
39
+ * {@link @fluidframework/protocol-definitions#ISummaryHandle} can be used
40
+ * instead of re-summarizing it. If this is `false`, the expectation is that you should never
41
+ * send an `ISummaryHandle`, since you are not expected to track state.
42
+ *
31
43
  * Note: The goal is to remove the trackState and automatically decided whether the
32
- * handles will be used or not: https://github.com/microsoft/FluidFramework/issues/10455
44
+ * handles will be used or not: {@link https://github.com/microsoft/FluidFramework/issues/10455}
45
+ *
46
+ * Default: `false`
47
+ *
48
+ * @param telemetryContext - See {@link @fluidframework/runtime-definitions#ITelemetryContext}.
49
+ *
33
50
  * @returns A summary capturing the current state of the channel.
34
51
  */
35
52
  getAttachSummary(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
36
53
  /**
37
54
  * Generates summary of the channel asynchronously.
38
55
  * This should not be called where the channel can be modified while summarization is in progress.
56
+ *
39
57
  * @param fullTree - flag indicating whether the attempt should generate a full
40
- * summary tree without any handles for unchanged subtrees. It is only set to true when generating
58
+ * summary tree without any handles for unchanged subtrees. It should only be set to true when generating
41
59
  * a summary from the entire container.
42
- * @param trackState - This tells whether we should track state from this summary.
60
+ *
61
+ * Default: `false`
62
+ *
63
+ * @param trackState - An optimization for tracking state of objects across summaries. If the state
64
+ * of an object did not change since last successful summary, an
65
+ * {@link @fluidframework/protocol-definitions#ISummaryHandle} can be used
66
+ * instead of re-summarizing it. If this is `false`, the expectation is that you should never
67
+ * send an `ISummaryHandle`, since you are not expected to track state.
68
+ *
69
+ * Default: `false`
70
+ *
71
+ * Note: The goal is to remove the trackState and automatically decided whether the
72
+ * handles will be used or not: {@link https://github.com/microsoft/FluidFramework/issues/10455}
73
+ *
74
+ * @param telemetryContext - See {@link @fluidframework/runtime-definitions#ITelemetryContext}.
75
+ *
43
76
  * @returns A summary capturing the current state of the channel.
44
77
  */
45
- summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
78
+ summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): Promise<ISummaryTreeWithStats>;
46
79
  /**
47
80
  * Checks if the channel is attached to storage.
48
81
  * @returns True iff the channel is attached.
@@ -50,7 +83,7 @@ export interface IChannel extends IFluidLoadable {
50
83
  isAttached(): boolean;
51
84
  /**
52
85
  * Enables the channel to send and receive ops.
53
- * @param services - Services to connect to
86
+ * @param services - The services to connect to.
54
87
  */
55
88
  connect(services: IChannelServices): void;
56
89
  /**
@@ -62,6 +95,7 @@ export interface IChannel extends IFluidLoadable {
62
95
  }
63
96
  /**
64
97
  * Handler provided by shared data structure to process requests from the runtime.
98
+ * @public
65
99
  */
66
100
  export interface IDeltaHandler {
67
101
  /**
@@ -104,6 +138,7 @@ export interface IDeltaHandler {
104
138
  }
105
139
  /**
106
140
  * Interface to represent a connection to a delta notification stream.
141
+ * @public
107
142
  */
108
143
  export interface IDeltaConnection {
109
144
  connected: boolean;
@@ -134,6 +169,7 @@ export interface IDeltaConnection {
134
169
  }
135
170
  /**
136
171
  * Storage services to read the objects at a given path.
172
+ * @public
137
173
  */
138
174
  export interface IChannelStorageService {
139
175
  /**
@@ -151,13 +187,32 @@ export interface IChannelStorageService {
151
187
  }
152
188
  /**
153
189
  * Storage services to read the objects at a given path using the given delta connection.
190
+ * @public
154
191
  */
155
192
  export interface IChannelServices {
156
193
  deltaConnection: IDeltaConnection;
157
194
  objectStorage: IChannelStorageService;
158
195
  }
159
196
  /**
160
- * Definitions of a channel factory. Factories follow a common model but enable custom behavior.
197
+ * Definitions of a channel factory.
198
+ *
199
+ * @remarks
200
+ *
201
+ * The runtime must be able to produce "channels" of the correct in-memory object type for the collaborative session.
202
+ * Here "channels" are typically distributed data structures (DDSs).
203
+ *
204
+ * The runtime will consult with a registry of such factories during
205
+ * {@link https://fluidframework.com/docs/build/containers/ | Container} load and when receiving "attach" operations
206
+ * (ops), which indicate a new instance of a channel being introduced to the collaboration session, to produce the
207
+ * appropriate in-memory object.
208
+ *
209
+ * Factories follow a common model but enable custom behavior.
210
+ *
211
+ * @example
212
+ *
213
+ * If a collaboration includes a {@link https://fluidframework.com/docs/data-structures/map/ | SharedMap},
214
+ * the collaborating clients will need to have access to a factory that can produce the `SharedMap` object.
215
+ * @public
161
216
  */
162
217
  export interface IChannelFactory {
163
218
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACH,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,QAAS,SAAQ,cAAc;IAC5C;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IAExC;;;;;;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