@fluidframework/core-interfaces 2.33.2 → 2.40.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @fluidframework/core-interfaces
2
2
 
3
+ ## 2.40.0
4
+
5
+ ### Minor Changes
6
+
7
+ - IFluidHandleInternal.bind has been deprecated ([#24553](https://github.com/microsoft/FluidFramework/pull/24553)) [8a4362a7ed](https://github.com/microsoft/FluidFramework/commit/8a4362a7edef3a97fee13c9d23bea49448ba2a6a)
8
+
9
+ Handle binding is an internal concept used to make sure objects attach to the Container graph when their handle is stored in a DDS which is itself attached.
10
+ The source of the "bind" operation has been assumed to be any handle, but only one implementation is actually supported (`SharedObjectHandle`, not exported itself).
11
+
12
+ So the `bind` function is now deprecated on the `IFluidHandleInterface`, moving instead to internal types supporting the one valid implementation.
13
+ It's also deprecated on the various exported handle implementations that don't support it (each is either no-op, pass-through, or throwing).
14
+
15
+ No replacement is offered, this API was never meant to be called from outside of the Fluid Framework.
16
+
3
17
  ## 2.33.0
4
18
 
5
19
  Dependency updates only.
@@ -246,7 +246,6 @@ export const IFluidLoadable: keyof IProvideFluidLoadable;
246
246
 
247
247
  // @public @sealed
248
248
  export interface IFluidLoadable extends IProvideFluidLoadable {
249
- // (undocumented)
250
249
  readonly handle: IFluidHandle;
251
250
  }
252
251
 
@@ -266,22 +266,44 @@ export interface IFluidHandleContext extends IProvideFluidHandleContext {
266
266
  export interface IFluidHandleErased<T> extends ErasedType<readonly ["IFluidHandle", T]> {
267
267
  }
268
268
 
269
+ // @alpha @legacy
270
+ export interface IFluidHandleEvents {
271
+ payloadShared: () => void;
272
+ }
273
+
269
274
  // @alpha @legacy
270
275
  export interface IFluidHandleInternal<out T = unknown> extends IFluidHandle<T>, IProvideFluidHandle {
271
276
  readonly absolutePath: string;
272
277
  attachGraph(): void;
278
+ // @deprecated
273
279
  bind(handle: IFluidHandleInternal): void;
274
280
  }
275
281
 
282
+ // @alpha @legacy
283
+ export interface IFluidHandlePayloadPending<T> extends IFluidHandle<T> {
284
+ readonly events: Listenable<IFluidHandleEvents>;
285
+ readonly payloadState: PayloadState;
286
+ }
287
+
276
288
  // @public (undocumented)
277
289
  export const IFluidLoadable: keyof IProvideFluidLoadable;
278
290
 
279
291
  // @public @sealed
280
292
  export interface IFluidLoadable extends IProvideFluidLoadable {
281
- // (undocumented)
282
293
  readonly handle: IFluidHandle;
283
294
  }
284
295
 
296
+ // @alpha @legacy
297
+ export interface ILocalFluidHandle<T> extends IFluidHandlePayloadPending<T> {
298
+ readonly events: Listenable<IFluidHandleEvents & ILocalFluidHandleEvents>;
299
+ readonly payloadShareError: unknown;
300
+ }
301
+
302
+ // @alpha @legacy
303
+ export interface ILocalFluidHandleEvents extends IFluidHandleEvents {
304
+ payloadShareFailed: (error: unknown) => void;
305
+ }
306
+
285
307
  // @alpha @legacy
286
308
  export interface ILoggingError extends Error {
287
309
  getTelemetryProperties(): ITelemetryBaseProperties;
@@ -388,6 +410,9 @@ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
388
410
  // @public
389
411
  export type Off = () => void;
390
412
 
413
+ // @alpha @legacy
414
+ export type PayloadState = "pending" | "shared";
415
+
391
416
  // @public
392
417
  export type ReplaceIEventThisPlaceHolder<L extends any[], TThis> = L extends any[] ? {
393
418
  [K in keyof L]: L[K] extends IEventThisPlaceHolder ? TThis : L[K];
@@ -246,7 +246,6 @@ export const IFluidLoadable: keyof IProvideFluidLoadable;
246
246
 
247
247
  // @public @sealed
248
248
  export interface IFluidLoadable extends IProvideFluidLoadable {
249
- // (undocumented)
250
249
  readonly handle: IFluidHandle;
251
250
  }
252
251
 
@@ -246,7 +246,6 @@ export const IFluidLoadable: keyof IProvideFluidLoadable;
246
246
 
247
247
  // @public @sealed
248
248
  export interface IFluidLoadable extends IProvideFluidLoadable {
249
- // (undocumented)
250
249
  readonly handle: IFluidHandle;
251
250
  }
252
251
 
@@ -14,10 +14,16 @@ export interface IProvideFluidLoadable {
14
14
  readonly IFluidLoadable: IFluidLoadable;
15
15
  }
16
16
  /**
17
- * A shared FluidObject has a URL from which it can be referenced
17
+ * A shared {@link FluidObject} with a handle that can be used to retrieve it.
18
+ * @remarks
19
+ * In this context, "shared" means that the object might be shared via a {@link https://fluidframework.com/docs/concepts/architecture#fluid-service|Fluid service} and
20
+ * thus could be viewed and edited by other clients.
18
21
  * @sealed @public
19
22
  */
20
23
  export interface IFluidLoadable extends IProvideFluidLoadable {
24
+ /**
25
+ * Handle to this loadable {@link FluidObject}.
26
+ */
21
27
  readonly handle: IFluidHandle;
22
28
  }
23
29
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"fluidLoadable.d.ts","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAE5D,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;GAEG;AACH,MAAM,WAAW,cAAc;IAG9B,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
1
+ {"version":3,"file":"fluidLoadable.d.ts","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;;;;;GAMG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAC5D;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;GAEG;AACH,MAAM,WAAW,cAAc;IAG9B,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"fluidLoadable.js","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACU,QAAA,cAAc,GAAgC,gBAAgB,CAAC;AAiB5E;;GAEG;AACU,QAAA,cAAc,GAAgC,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"./handles.js\";\n\n/**\n * @public\n */\nexport const IFluidLoadable: keyof IProvideFluidLoadable = \"IFluidLoadable\";\n\n/**\n * @public\n */\nexport interface IProvideFluidLoadable {\n\treadonly IFluidLoadable: IFluidLoadable;\n}\n/**\n * A shared FluidObject has a URL from which it can be referenced\n * @sealed @public\n */\nexport interface IFluidLoadable extends IProvideFluidLoadable {\n\t// Handle to the loadable FluidObject\n\treadonly handle: IFluidHandle;\n}\n\n/**\n * @internal\n */\nexport const IFluidRunnable: keyof IProvideFluidRunnable = \"IFluidRunnable\";\n\n/**\n * @internal\n */\nexport interface IProvideFluidRunnable {\n\treadonly IFluidRunnable: IFluidRunnable;\n}\n/**\n * @internal\n */\nexport interface IFluidRunnable {\n\t// TODO: Use `unknown` instead (API-Breaking)\n\n\trun(...args: any[]): Promise<void>;\n\tstop(reason?: string): void;\n}\n"]}
1
+ {"version":3,"file":"fluidLoadable.js","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACU,QAAA,cAAc,GAAgC,gBAAgB,CAAC;AAsB5E;;GAEG;AACU,QAAA,cAAc,GAAgC,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"./handles.js\";\n\n/**\n * @public\n */\nexport const IFluidLoadable: keyof IProvideFluidLoadable = \"IFluidLoadable\";\n\n/**\n * @public\n */\nexport interface IProvideFluidLoadable {\n\treadonly IFluidLoadable: IFluidLoadable;\n}\n/**\n * A shared {@link FluidObject} with a handle that can be used to retrieve it.\n * @remarks\n * In this context, \"shared\" means that the object might be shared via a {@link https://fluidframework.com/docs/concepts/architecture#fluid-service|Fluid service} and\n * thus could be viewed and edited by other clients.\n * @sealed @public\n */\nexport interface IFluidLoadable extends IProvideFluidLoadable {\n\t/**\n\t * Handle to this loadable {@link FluidObject}.\n\t */\n\treadonly handle: IFluidHandle;\n}\n\n/**\n * @internal\n */\nexport const IFluidRunnable: keyof IProvideFluidRunnable = \"IFluidRunnable\";\n\n/**\n * @internal\n */\nexport interface IProvideFluidRunnable {\n\treadonly IFluidRunnable: IFluidRunnable;\n}\n/**\n * @internal\n */\nexport interface IFluidRunnable {\n\t// TODO: Use `unknown` instead (API-Breaking)\n\n\trun(...args: any[]): Promise<void>;\n\tstop(reason?: string): void;\n}\n"]}
package/dist/handles.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import type { ErasedType } from "./erasedType.js";
6
6
  import type { IRequest, IResponse } from "./fluidRouter.js";
7
+ import type { Listenable } from "./internal.js";
7
8
  /**
8
9
  * @legacy
9
10
  * @alpha
@@ -80,6 +81,8 @@ export interface IFluidHandleInternal<out T = unknown> extends IFluidHandle<T>,
80
81
  /**
81
82
  * Binds the given handle to this one or attach the given handle if this handle is attached.
82
83
  * A bound handle will also be attached once this handle is attached.
84
+ *
85
+ * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.
83
86
  */
84
87
  bind(handle: IFluidHandleInternal): void;
85
88
  }
@@ -95,6 +98,72 @@ export interface IFluidHandleInternalPayloadPending<out T = unknown> extends IFl
95
98
  */
96
99
  readonly payloadPending: boolean;
97
100
  }
101
+ /**
102
+ * The state of the handle's payload.
103
+ * - "pending" - The payload is not shared to all collaborators
104
+ * - "shared" - The payload is available to both the local client and remote collaborators
105
+ *
106
+ * @remarks
107
+ * Clients will see a transition of "pending" to "shared" when the payload has been shared to all collaborators.
108
+ * @legacy
109
+ * @alpha
110
+ */
111
+ export type PayloadState = "pending" | "shared";
112
+ /**
113
+ * Events which fire from an IFluidHandle.
114
+ * @legacy
115
+ * @alpha
116
+ */
117
+ export interface IFluidHandleEvents {
118
+ /**
119
+ * Emitted when the payload becomes available to remote collaborators.
120
+ */
121
+ payloadShared: () => void;
122
+ }
123
+ /**
124
+ * Observable state on the handle regarding its payload sharing state.
125
+ *
126
+ * @privateRemarks
127
+ * Contents to be merged to IFluidHandle, and then this separate interface should be removed.
128
+ * @legacy
129
+ * @alpha
130
+ */
131
+ export interface IFluidHandlePayloadPending<T> extends IFluidHandle<T> {
132
+ /**
133
+ * The current state of the handle's payload.
134
+ */
135
+ readonly payloadState: PayloadState;
136
+ /**
137
+ * Event emitter, with events that emit as the payload state transitions.
138
+ */
139
+ readonly events: Listenable<IFluidHandleEvents>;
140
+ }
141
+ /**
142
+ * Additional events which fire as a local handle's payload state transitions.
143
+ * @legacy
144
+ * @alpha
145
+ */
146
+ export interface ILocalFluidHandleEvents extends IFluidHandleEvents {
147
+ /**
148
+ * Emitted for locally created handles when the payload fails sharing to remote collaborators.
149
+ */
150
+ payloadShareFailed: (error: unknown) => void;
151
+ }
152
+ /**
153
+ * Additional observable state on a local handle regarding its payload sharing state.
154
+ * @legacy
155
+ * @alpha
156
+ */
157
+ export interface ILocalFluidHandle<T> extends IFluidHandlePayloadPending<T> {
158
+ /**
159
+ * The error encountered by the handle while sharing the payload, if one has occurred. Undefined if no error has occurred.
160
+ */
161
+ readonly payloadShareError: unknown;
162
+ /**
163
+ * Event emitter, with events that emit as the payload state transitions.
164
+ */
165
+ readonly events: Listenable<IFluidHandleEvents & ILocalFluidHandleEvents>;
166
+ }
98
167
  /**
99
168
  * Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.
100
169
  *
@@ -1 +1 @@
1
- {"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,0BAAkD,CAAC;AAE3F;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CAClD;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IACtE;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE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AE,OAAO,CAAC;IAE7B;;OAEG;IACH,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAElB;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CACpD;AAED;;;;;;GAMG;AAEH,MAAM,WAAW,kBAAkB,CAAC,CAAC,CAAE,SAAQ,UAAU,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;CAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH;;;GAGG;AACU,QAAA,mBAAmB,GAAqC,qBAAqB,CAAC;AAwC3F;;;;;GAKG;AACU,QAAA,YAAY,GAAG,cAAc,CAAC;AA6D3C;;;;;;;;;;;;;GAaG;AACU,QAAA,iBAAiB,GAAkB,MAAM,CAAC,GAAG,CACzD,kDAAkD,CAClD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"./erasedType.js\";\nimport type { IRequest, IResponse } from \"./fluidRouter.js\";\n\n/**\n * @legacy\n * @alpha\n */\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidHandleContext {\n\treadonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * Describes a routing context from which other `IFluidHandleContext`s are defined.\n * @legacy\n * @alpha\n */\nexport interface IFluidHandleContext extends IProvideFluidHandleContext {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * The parent IFluidHandleContext that has provided a route path to this IFluidHandleContext or undefined\n\t * at the root.\n\t */\n\treadonly routeContext?: IFluidHandleContext;\n\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\tresolveHandle(request: IRequest): Promise<IResponse>;\n}\n\n/**\n * @public\n * @privateRemarks\n * This really should be deprecated and alpha, but since its a merged export with the public interface,\n * it can't have its own docs or different tags.\n */\nexport const IFluidHandle = \"IFluidHandle\";\n\n/**\n * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidHandle {\n\t/**\n\t * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n\t * @privateRemarks\n\t * This field must be kept so that code from before 2.0.0-rc.4.0.0 (When fluidHandleSymbol was added) still detects handles.\n\t * This is required due to some use-cases mixing package versions.\n\t * More details in packages/runtime/runtime-utils/src/handles.ts and on {@link fluidHandleSymbol}.\n\t */\n\treadonly [IFluidHandle]: IFluidHandleInternal;\n}\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @legacy\n * @alpha\n */\nexport interface IFluidHandleInternal<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandle<T>,\n\t\tIProvideFluidHandle {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\t/**\n\t * Binds the given handle to this one or attach the given handle if this handle is attached.\n\t * A bound handle will also be attached once this handle is attached.\n\t */\n\tbind(handle: IFluidHandleInternal): void;\n}\n\n/**\n * @privateRemarks\n * To be merged onto IFluidHandleInternal in accordance with breaking change policy\n * @internal\n */\nexport interface IFluidHandleInternalPayloadPending<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandleInternal<T> {\n\t/**\n\t * Whether the handle has a pending payload, meaning that it may exist before its payload is retrievable.\n\t * For instance, the BlobManager can generate handles before completing the blob upload/attach.\n\t */\n\treadonly payloadPending: boolean;\n}\n\n/**\n * Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.\n *\n * @remarks\n * To narrow arbitrary objects to handles do not simply check for this symbol:\n * instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility\n * with older implementations of handles that may exist due to dynamic code loading of older packages.\n *\n * @privateRemarks\n * Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.\n * In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.\n * Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:\n * @public\n */\nexport const fluidHandleSymbol: unique symbol = Symbol.for(\n\t\"FluidHandle-3978c7cf-4675-49ba-a20c-bf35efbf43da\",\n);\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @sealed @public\n */\nexport interface IFluidHandle<out T = unknown> {\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Returns a promise to the Fluid Object referenced by the handle.\n\t */\n\tget(): Promise<T>;\n\n\t/**\n\t * Symbol used to mark an object as a {@link (IFluidHandle:interface)}\n\t * and to recover the underlying handle implementation.\n\t *\n\t * @privateRemarks\n\t * Used to recover {@link IFluidHandleInternal}, see {@link toFluidHandleInternal}.\n\t */\n\treadonly [fluidHandleSymbol]: IFluidHandleErased<T>;\n}\n\n/**\n * A type erased Fluid Handle.\n * These can only be produced by the Fluid Framework and provide the implementation details needed to power {@link (IFluidHandle:interface)}.\n * @privateRemarks\n * Created from {@link IFluidHandleInternal} using {@link toFluidHandleErased}.\n * @sealed @public\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IFluidHandleErased<T> extends ErasedType<readonly [\"IFluidHandle\", T]> {}\n"]}
1
+ {"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH;;;GAGG;AACU,QAAA,mBAAmB,GAAqC,qBAAqB,CAAC;AAwC3F;;;;;GAKG;AACU,QAAA,YAAY,GAAG,cAAc,CAAC;AAsI3C;;;;;;;;;;;;;GAaG;AACU,QAAA,iBAAiB,GAAkB,MAAM,CAAC,GAAG,CACzD,kDAAkD,CAClD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"./erasedType.js\";\nimport type { IRequest, IResponse } from \"./fluidRouter.js\";\nimport type { Listenable } from \"./internal.js\";\n\n/**\n * @legacy\n * @alpha\n */\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidHandleContext {\n\treadonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * Describes a routing context from which other `IFluidHandleContext`s are defined.\n * @legacy\n * @alpha\n */\nexport interface IFluidHandleContext extends IProvideFluidHandleContext {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * The parent IFluidHandleContext that has provided a route path to this IFluidHandleContext or undefined\n\t * at the root.\n\t */\n\treadonly routeContext?: IFluidHandleContext;\n\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\tresolveHandle(request: IRequest): Promise<IResponse>;\n}\n\n/**\n * @public\n * @privateRemarks\n * This really should be deprecated and alpha, but since its a merged export with the public interface,\n * it can't have its own docs or different tags.\n */\nexport const IFluidHandle = \"IFluidHandle\";\n\n/**\n * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidHandle {\n\t/**\n\t * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n\t * @privateRemarks\n\t * This field must be kept so that code from before 2.0.0-rc.4.0.0 (When fluidHandleSymbol was added) still detects handles.\n\t * This is required due to some use-cases mixing package versions.\n\t * More details in packages/runtime/runtime-utils/src/handles.ts and on {@link fluidHandleSymbol}.\n\t */\n\treadonly [IFluidHandle]: IFluidHandleInternal;\n}\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @legacy\n * @alpha\n */\nexport interface IFluidHandleInternal<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandle<T>,\n\t\tIProvideFluidHandle {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\t/**\n\t * Binds the given handle to this one or attach the given handle if this handle is attached.\n\t * A bound handle will also be attached once this handle is attached.\n\t *\n\t * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.\n\t */\n\tbind(handle: IFluidHandleInternal): void;\n}\n\n/**\n * @privateRemarks\n * To be merged onto IFluidHandleInternal in accordance with breaking change policy\n * @internal\n */\nexport interface IFluidHandleInternalPayloadPending<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandleInternal<T> {\n\t/**\n\t * Whether the handle has a pending payload, meaning that it may exist before its payload is retrievable.\n\t * For instance, the BlobManager can generate handles before completing the blob upload/attach.\n\t */\n\treadonly payloadPending: boolean;\n}\n\n/**\n * The state of the handle's payload.\n * - \"pending\" - The payload is not shared to all collaborators\n * - \"shared\" - The payload is available to both the local client and remote collaborators\n *\n * @remarks\n * Clients will see a transition of \"pending\" to \"shared\" when the payload has been shared to all collaborators.\n * @legacy\n * @alpha\n */\nexport type PayloadState = \"pending\" | \"shared\";\n\n/**\n * Events which fire from an IFluidHandle.\n * @legacy\n * @alpha\n */\nexport interface IFluidHandleEvents {\n\t/**\n\t * Emitted when the payload becomes available to remote collaborators.\n\t */\n\tpayloadShared: () => void;\n}\n\n/**\n * Observable state on the handle regarding its payload sharing state.\n *\n * @privateRemarks\n * Contents to be merged to IFluidHandle, and then this separate interface should be removed.\n * @legacy\n * @alpha\n */\nexport interface IFluidHandlePayloadPending<T> extends IFluidHandle<T> {\n\t/**\n\t * The current state of the handle's payload.\n\t */\n\treadonly payloadState: PayloadState;\n\t/**\n\t * Event emitter, with events that emit as the payload state transitions.\n\t */\n\treadonly events: Listenable<IFluidHandleEvents>;\n}\n\n/**\n * Additional events which fire as a local handle's payload state transitions.\n * @legacy\n * @alpha\n */\nexport interface ILocalFluidHandleEvents extends IFluidHandleEvents {\n\t/**\n\t * Emitted for locally created handles when the payload fails sharing to remote collaborators.\n\t */\n\tpayloadShareFailed: (error: unknown) => void;\n}\n\n/**\n * Additional observable state on a local handle regarding its payload sharing state.\n * @legacy\n * @alpha\n */\nexport interface ILocalFluidHandle<T> extends IFluidHandlePayloadPending<T> {\n\t/**\n\t * The error encountered by the handle while sharing the payload, if one has occurred. Undefined if no error has occurred.\n\t */\n\treadonly payloadShareError: unknown;\n\t/**\n\t * Event emitter, with events that emit as the payload state transitions.\n\t */\n\treadonly events: Listenable<IFluidHandleEvents & ILocalFluidHandleEvents>;\n}\n\n/**\n * Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.\n *\n * @remarks\n * To narrow arbitrary objects to handles do not simply check for this symbol:\n * instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility\n * with older implementations of handles that may exist due to dynamic code loading of older packages.\n *\n * @privateRemarks\n * Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.\n * In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.\n * Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:\n * @public\n */\nexport const fluidHandleSymbol: unique symbol = Symbol.for(\n\t\"FluidHandle-3978c7cf-4675-49ba-a20c-bf35efbf43da\",\n);\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @sealed @public\n */\nexport interface IFluidHandle<out T = unknown> {\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Returns a promise to the Fluid Object referenced by the handle.\n\t */\n\tget(): Promise<T>;\n\n\t/**\n\t * Symbol used to mark an object as a {@link (IFluidHandle:interface)}\n\t * and to recover the underlying handle implementation.\n\t *\n\t * @privateRemarks\n\t * Used to recover {@link IFluidHandleInternal}, see {@link toFluidHandleInternal}.\n\t */\n\treadonly [fluidHandleSymbol]: IFluidHandleErased<T>;\n}\n\n/**\n * A type erased Fluid Handle.\n * These can only be produced by the Fluid Framework and provide the implementation details needed to power {@link (IFluidHandle:interface)}.\n * @privateRemarks\n * Created from {@link IFluidHandleInternal} using {@link toFluidHandleErased}.\n * @sealed @public\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IFluidHandleErased<T> extends ErasedType<readonly [\"IFluidHandle\", T]> {}\n"]}
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export type { ExtendEventProvider, IErrorEvent, IEvent, IEventProvider, IEventTh
9
9
  export type { IProvideFluidLoadable, IProvideFluidRunnable } from "./fluidLoadable.js";
10
10
  export { IFluidLoadable, IFluidRunnable } from "./fluidLoadable.js";
11
11
  export type { IRequest, IRequestHeader, IResponse } from "./fluidRouter.js";
12
- export type { IProvideFluidHandleContext, IProvideFluidHandle, IFluidHandleInternal, IFluidHandleInternalPayloadPending, IFluidHandleErased, } from "./handles.js";
12
+ export type { IFluidHandleErased, IFluidHandleEvents, IFluidHandleInternal, IFluidHandleInternalPayloadPending, IFluidHandlePayloadPending, ILocalFluidHandle, ILocalFluidHandleEvents, IProvideFluidHandle, IProvideFluidHandleContext, PayloadState, } from "./handles.js";
13
13
  export { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from "./handles.js";
14
14
  export type { ILoggingError, ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryBaseProperties, Tagged, TelemetryBaseEventPropertyType, } from "./logger.js";
15
15
  export { LogLevel } from "./logger.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,YAAY,EACX,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,EACpB,kCAAkC,EAClC,kBAAkB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEpF,YAAY,EACX,aAAa,EACb,mBAAmB,EACnB,oBAAo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ACnB,0BAA0B,EAC1B,YAAY,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEpF,YAAY,EACX,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,MAAM,EACN,8BAA8B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC3F,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,YAAY,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,GAAG,GACH,MAAM,mBAAmB,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,uCAA6C;AAApC,2GAAA,eAAe,OAAA;AAcxB,uDAAoE;AAA3D,kHAAA,cAAc,OAAA;AAAE,kHAAA,cAAc,OAAA;AAcvC,2CAAoF;AAA3E,iHAAA,mBAAmB,OAAA;AAAE,0GAAA,YAAY,OAAA;AAAE,+GAAA,iBAAiB,OAAA;AAU7D,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type { IErrorBase, IGenericError, IUsageError, IThrottlingWarning } from \"./error.js\";\nexport { FluidErrorTypes } from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable, IProvideFluidRunnable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable, IFluidRunnable } from \"./fluidLoadable.js\";\n\n// TypeScript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type {\n\tIProvideFluidHandleContext,\n\tIProvideFluidHandle,\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandleErased,\n} from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope } from \"./messages.js\";\nexport type { ErasedType } from \"./erasedType.js\";\n\nexport type {\n\tHasListeners,\n\tIEmitter,\n\tIsListener,\n\tListeners,\n\tListenable,\n\tMapGetSet,\n\tNoListenersCallback,\n\tOff,\n} from \"./events/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,uCAA6C;AAApC,2GAAA,eAAe,OAAA;AAcxB,uDAAoE;AAA3D,kHAAA,cAAc,OAAA;AAAE,kHAAA,cAAc,OAAA;AAmBvC,2CAAoF;AAA3E,iHAAA,mBAAmB,OAAA;AAAE,0GAAA,YAAY,OAAA;AAAE,+GAAA,iBAAiB,OAAA;AAU7D,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type { IErrorBase, IGenericError, IUsageError, IThrottlingWarning } from \"./error.js\";\nexport { FluidErrorTypes } from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable, IProvideFluidRunnable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable, IFluidRunnable } from \"./fluidLoadable.js\";\n\n// TypeScript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type {\n\tIFluidHandleErased,\n\tIFluidHandleEvents,\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n\tILocalFluidHandleEvents,\n\tIProvideFluidHandle,\n\tIProvideFluidHandleContext,\n\tPayloadState,\n} from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope } from \"./messages.js\";\nexport type { ErasedType } from \"./erasedType.js\";\n\nexport type {\n\tHasListeners,\n\tIEmitter,\n\tIsListener,\n\tListeners,\n\tListenable,\n\tMapGetSet,\n\tNoListenersCallback,\n\tOff,\n} from \"./events/index.js\";\n"]}
package/dist/legacy.d.ts CHANGED
@@ -48,9 +48,14 @@ export {
48
48
  // @legacy APIs
49
49
  FluidErrorTypes,
50
50
  IFluidHandleContext,
51
+ IFluidHandleEvents,
51
52
  IFluidHandleInternal,
53
+ IFluidHandlePayloadPending,
54
+ ILocalFluidHandle,
55
+ ILocalFluidHandleEvents,
52
56
  ILoggingError,
53
57
  IProvideFluidHandle,
54
58
  IProvideFluidHandleContext,
55
- IThrottlingWarning
59
+ IThrottlingWarning,
60
+ PayloadState
56
61
  } from "./index.js";
@@ -14,10 +14,16 @@ export interface IProvideFluidLoadable {
14
14
  readonly IFluidLoadable: IFluidLoadable;
15
15
  }
16
16
  /**
17
- * A shared FluidObject has a URL from which it can be referenced
17
+ * A shared {@link FluidObject} with a handle that can be used to retrieve it.
18
+ * @remarks
19
+ * In this context, "shared" means that the object might be shared via a {@link https://fluidframework.com/docs/concepts/architecture#fluid-service|Fluid service} and
20
+ * thus could be viewed and edited by other clients.
18
21
  * @sealed @public
19
22
  */
20
23
  export interface IFluidLoadable extends IProvideFluidLoadable {
24
+ /**
25
+ * Handle to this loadable {@link FluidObject}.
26
+ */
21
27
  readonly handle: IFluidHandle;
22
28
  }
23
29
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"fluidLoadable.d.ts","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAE5D,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;GAEG;AACH,MAAM,WAAW,cAAc;IAG9B,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
1
+ {"version":3,"file":"fluidLoadable.d.ts","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;;;;;GAMG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAC5D;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;GAEG;AACH,MAAM,WAAW,cAAc;IAG9B,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"fluidLoadable.js","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgC,gBAAgB,CAAC;AAiB5E;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgC,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"./handles.js\";\n\n/**\n * @public\n */\nexport const IFluidLoadable: keyof IProvideFluidLoadable = \"IFluidLoadable\";\n\n/**\n * @public\n */\nexport interface IProvideFluidLoadable {\n\treadonly IFluidLoadable: IFluidLoadable;\n}\n/**\n * A shared FluidObject has a URL from which it can be referenced\n * @sealed @public\n */\nexport interface IFluidLoadable extends IProvideFluidLoadable {\n\t// Handle to the loadable FluidObject\n\treadonly handle: IFluidHandle;\n}\n\n/**\n * @internal\n */\nexport const IFluidRunnable: keyof IProvideFluidRunnable = \"IFluidRunnable\";\n\n/**\n * @internal\n */\nexport interface IProvideFluidRunnable {\n\treadonly IFluidRunnable: IFluidRunnable;\n}\n/**\n * @internal\n */\nexport interface IFluidRunnable {\n\t// TODO: Use `unknown` instead (API-Breaking)\n\n\trun(...args: any[]): Promise<void>;\n\tstop(reason?: string): void;\n}\n"]}
1
+ {"version":3,"file":"fluidLoadable.js","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgC,gBAAgB,CAAC;AAsB5E;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgC,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"./handles.js\";\n\n/**\n * @public\n */\nexport const IFluidLoadable: keyof IProvideFluidLoadable = \"IFluidLoadable\";\n\n/**\n * @public\n */\nexport interface IProvideFluidLoadable {\n\treadonly IFluidLoadable: IFluidLoadable;\n}\n/**\n * A shared {@link FluidObject} with a handle that can be used to retrieve it.\n * @remarks\n * In this context, \"shared\" means that the object might be shared via a {@link https://fluidframework.com/docs/concepts/architecture#fluid-service|Fluid service} and\n * thus could be viewed and edited by other clients.\n * @sealed @public\n */\nexport interface IFluidLoadable extends IProvideFluidLoadable {\n\t/**\n\t * Handle to this loadable {@link FluidObject}.\n\t */\n\treadonly handle: IFluidHandle;\n}\n\n/**\n * @internal\n */\nexport const IFluidRunnable: keyof IProvideFluidRunnable = \"IFluidRunnable\";\n\n/**\n * @internal\n */\nexport interface IProvideFluidRunnable {\n\treadonly IFluidRunnable: IFluidRunnable;\n}\n/**\n * @internal\n */\nexport interface IFluidRunnable {\n\t// TODO: Use `unknown` instead (API-Breaking)\n\n\trun(...args: any[]): Promise<void>;\n\tstop(reason?: string): void;\n}\n"]}
package/lib/handles.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import type { ErasedType } from "./erasedType.js";
6
6
  import type { IRequest, IResponse } from "./fluidRouter.js";
7
+ import type { Listenable } from "./internal.js";
7
8
  /**
8
9
  * @legacy
9
10
  * @alpha
@@ -80,6 +81,8 @@ export interface IFluidHandleInternal<out T = unknown> extends IFluidHandle<T>,
80
81
  /**
81
82
  * Binds the given handle to this one or attach the given handle if this handle is attached.
82
83
  * A bound handle will also be attached once this handle is attached.
84
+ *
85
+ * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.
83
86
  */
84
87
  bind(handle: IFluidHandleInternal): void;
85
88
  }
@@ -95,6 +98,72 @@ export interface IFluidHandleInternalPayloadPending<out T = unknown> extends IFl
95
98
  */
96
99
  readonly payloadPending: boolean;
97
100
  }
101
+ /**
102
+ * The state of the handle's payload.
103
+ * - "pending" - The payload is not shared to all collaborators
104
+ * - "shared" - The payload is available to both the local client and remote collaborators
105
+ *
106
+ * @remarks
107
+ * Clients will see a transition of "pending" to "shared" when the payload has been shared to all collaborators.
108
+ * @legacy
109
+ * @alpha
110
+ */
111
+ export type PayloadState = "pending" | "shared";
112
+ /**
113
+ * Events which fire from an IFluidHandle.
114
+ * @legacy
115
+ * @alpha
116
+ */
117
+ export interface IFluidHandleEvents {
118
+ /**
119
+ * Emitted when the payload becomes available to remote collaborators.
120
+ */
121
+ payloadShared: () => void;
122
+ }
123
+ /**
124
+ * Observable state on the handle regarding its payload sharing state.
125
+ *
126
+ * @privateRemarks
127
+ * Contents to be merged to IFluidHandle, and then this separate interface should be removed.
128
+ * @legacy
129
+ * @alpha
130
+ */
131
+ export interface IFluidHandlePayloadPending<T> extends IFluidHandle<T> {
132
+ /**
133
+ * The current state of the handle's payload.
134
+ */
135
+ readonly payloadState: PayloadState;
136
+ /**
137
+ * Event emitter, with events that emit as the payload state transitions.
138
+ */
139
+ readonly events: Listenable<IFluidHandleEvents>;
140
+ }
141
+ /**
142
+ * Additional events which fire as a local handle's payload state transitions.
143
+ * @legacy
144
+ * @alpha
145
+ */
146
+ export interface ILocalFluidHandleEvents extends IFluidHandleEvents {
147
+ /**
148
+ * Emitted for locally created handles when the payload fails sharing to remote collaborators.
149
+ */
150
+ payloadShareFailed: (error: unknown) => void;
151
+ }
152
+ /**
153
+ * Additional observable state on a local handle regarding its payload sharing state.
154
+ * @legacy
155
+ * @alpha
156
+ */
157
+ export interface ILocalFluidHandle<T> extends IFluidHandlePayloadPending<T> {
158
+ /**
159
+ * The error encountered by the handle while sharing the payload, if one has occurred. Undefined if no error has occurred.
160
+ */
161
+ readonly payloadShareError: unknown;
162
+ /**
163
+ * Event emitter, with events that emit as the payload state transitions.
164
+ */
165
+ readonly events: Listenable<IFluidHandleEvents & ILocalFluidHandleEvents>;
166
+ }
98
167
  /**
99
168
  * Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.
100
169
  *
@@ -1 +1 @@
1
- {"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAA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AEG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC7C;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,CAAE,SAAQ,0BAA0B,CAAC,CAAC,CAAC;IAC1E;;OAEG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,kBAAkB,GAAG,uBAAuB,CAAC,CAAC;CAC1E;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAO,MAEtC,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO;IAC5C;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAElB;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CACpD;AAED;;;;;;GAMG;AAEH,MAAM,WAAW,kBAAkB,CAAC,CAAC,CAAE,SAAQ,UAAU,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;CAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqC,qBAAqB,CAAC;AAwC3F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AA6D3C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAkB,MAAM,CAAC,GAAG,CACzD,kDAAkD,CAClD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"./erasedType.js\";\nimport type { IRequest, IResponse } from \"./fluidRouter.js\";\n\n/**\n * @legacy\n * @alpha\n */\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidHandleContext {\n\treadonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * Describes a routing context from which other `IFluidHandleContext`s are defined.\n * @legacy\n * @alpha\n */\nexport interface IFluidHandleContext extends IProvideFluidHandleContext {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * The parent IFluidHandleContext that has provided a route path to this IFluidHandleContext or undefined\n\t * at the root.\n\t */\n\treadonly routeContext?: IFluidHandleContext;\n\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\tresolveHandle(request: IRequest): Promise<IResponse>;\n}\n\n/**\n * @public\n * @privateRemarks\n * This really should be deprecated and alpha, but since its a merged export with the public interface,\n * it can't have its own docs or different tags.\n */\nexport const IFluidHandle = \"IFluidHandle\";\n\n/**\n * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidHandle {\n\t/**\n\t * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n\t * @privateRemarks\n\t * This field must be kept so that code from before 2.0.0-rc.4.0.0 (When fluidHandleSymbol was added) still detects handles.\n\t * This is required due to some use-cases mixing package versions.\n\t * More details in packages/runtime/runtime-utils/src/handles.ts and on {@link fluidHandleSymbol}.\n\t */\n\treadonly [IFluidHandle]: IFluidHandleInternal;\n}\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @legacy\n * @alpha\n */\nexport interface IFluidHandleInternal<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandle<T>,\n\t\tIProvideFluidHandle {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\t/**\n\t * Binds the given handle to this one or attach the given handle if this handle is attached.\n\t * A bound handle will also be attached once this handle is attached.\n\t */\n\tbind(handle: IFluidHandleInternal): void;\n}\n\n/**\n * @privateRemarks\n * To be merged onto IFluidHandleInternal in accordance with breaking change policy\n * @internal\n */\nexport interface IFluidHandleInternalPayloadPending<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandleInternal<T> {\n\t/**\n\t * Whether the handle has a pending payload, meaning that it may exist before its payload is retrievable.\n\t * For instance, the BlobManager can generate handles before completing the blob upload/attach.\n\t */\n\treadonly payloadPending: boolean;\n}\n\n/**\n * Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.\n *\n * @remarks\n * To narrow arbitrary objects to handles do not simply check for this symbol:\n * instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility\n * with older implementations of handles that may exist due to dynamic code loading of older packages.\n *\n * @privateRemarks\n * Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.\n * In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.\n * Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:\n * @public\n */\nexport const fluidHandleSymbol: unique symbol = Symbol.for(\n\t\"FluidHandle-3978c7cf-4675-49ba-a20c-bf35efbf43da\",\n);\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @sealed @public\n */\nexport interface IFluidHandle<out T = unknown> {\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Returns a promise to the Fluid Object referenced by the handle.\n\t */\n\tget(): Promise<T>;\n\n\t/**\n\t * Symbol used to mark an object as a {@link (IFluidHandle:interface)}\n\t * and to recover the underlying handle implementation.\n\t *\n\t * @privateRemarks\n\t * Used to recover {@link IFluidHandleInternal}, see {@link toFluidHandleInternal}.\n\t */\n\treadonly [fluidHandleSymbol]: IFluidHandleErased<T>;\n}\n\n/**\n * A type erased Fluid Handle.\n * These can only be produced by the Fluid Framework and provide the implementation details needed to power {@link (IFluidHandle:interface)}.\n * @privateRemarks\n * Created from {@link IFluidHandleInternal} using {@link toFluidHandleErased}.\n * @sealed @public\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IFluidHandleErased<T> extends ErasedType<readonly [\"IFluidHandle\", T]> {}\n"]}
1
+ {"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqC,qBAAqB,CAAC;AAwC3F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAsI3C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAkB,MAAM,CAAC,GAAG,CACzD,kDAAkD,CAClD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"./erasedType.js\";\nimport type { IRequest, IResponse } from \"./fluidRouter.js\";\nimport type { Listenable } from \"./internal.js\";\n\n/**\n * @legacy\n * @alpha\n */\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidHandleContext {\n\treadonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * Describes a routing context from which other `IFluidHandleContext`s are defined.\n * @legacy\n * @alpha\n */\nexport interface IFluidHandleContext extends IProvideFluidHandleContext {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * The parent IFluidHandleContext that has provided a route path to this IFluidHandleContext or undefined\n\t * at the root.\n\t */\n\treadonly routeContext?: IFluidHandleContext;\n\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\tresolveHandle(request: IRequest): Promise<IResponse>;\n}\n\n/**\n * @public\n * @privateRemarks\n * This really should be deprecated and alpha, but since its a merged export with the public interface,\n * it can't have its own docs or different tags.\n */\nexport const IFluidHandle = \"IFluidHandle\";\n\n/**\n * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidHandle {\n\t/**\n\t * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n\t * @privateRemarks\n\t * This field must be kept so that code from before 2.0.0-rc.4.0.0 (When fluidHandleSymbol was added) still detects handles.\n\t * This is required due to some use-cases mixing package versions.\n\t * More details in packages/runtime/runtime-utils/src/handles.ts and on {@link fluidHandleSymbol}.\n\t */\n\treadonly [IFluidHandle]: IFluidHandleInternal;\n}\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @legacy\n * @alpha\n */\nexport interface IFluidHandleInternal<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandle<T>,\n\t\tIProvideFluidHandle {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\t/**\n\t * Binds the given handle to this one or attach the given handle if this handle is attached.\n\t * A bound handle will also be attached once this handle is attached.\n\t *\n\t * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.\n\t */\n\tbind(handle: IFluidHandleInternal): void;\n}\n\n/**\n * @privateRemarks\n * To be merged onto IFluidHandleInternal in accordance with breaking change policy\n * @internal\n */\nexport interface IFluidHandleInternalPayloadPending<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandleInternal<T> {\n\t/**\n\t * Whether the handle has a pending payload, meaning that it may exist before its payload is retrievable.\n\t * For instance, the BlobManager can generate handles before completing the blob upload/attach.\n\t */\n\treadonly payloadPending: boolean;\n}\n\n/**\n * The state of the handle's payload.\n * - \"pending\" - The payload is not shared to all collaborators\n * - \"shared\" - The payload is available to both the local client and remote collaborators\n *\n * @remarks\n * Clients will see a transition of \"pending\" to \"shared\" when the payload has been shared to all collaborators.\n * @legacy\n * @alpha\n */\nexport type PayloadState = \"pending\" | \"shared\";\n\n/**\n * Events which fire from an IFluidHandle.\n * @legacy\n * @alpha\n */\nexport interface IFluidHandleEvents {\n\t/**\n\t * Emitted when the payload becomes available to remote collaborators.\n\t */\n\tpayloadShared: () => void;\n}\n\n/**\n * Observable state on the handle regarding its payload sharing state.\n *\n * @privateRemarks\n * Contents to be merged to IFluidHandle, and then this separate interface should be removed.\n * @legacy\n * @alpha\n */\nexport interface IFluidHandlePayloadPending<T> extends IFluidHandle<T> {\n\t/**\n\t * The current state of the handle's payload.\n\t */\n\treadonly payloadState: PayloadState;\n\t/**\n\t * Event emitter, with events that emit as the payload state transitions.\n\t */\n\treadonly events: Listenable<IFluidHandleEvents>;\n}\n\n/**\n * Additional events which fire as a local handle's payload state transitions.\n * @legacy\n * @alpha\n */\nexport interface ILocalFluidHandleEvents extends IFluidHandleEvents {\n\t/**\n\t * Emitted for locally created handles when the payload fails sharing to remote collaborators.\n\t */\n\tpayloadShareFailed: (error: unknown) => void;\n}\n\n/**\n * Additional observable state on a local handle regarding its payload sharing state.\n * @legacy\n * @alpha\n */\nexport interface ILocalFluidHandle<T> extends IFluidHandlePayloadPending<T> {\n\t/**\n\t * The error encountered by the handle while sharing the payload, if one has occurred. Undefined if no error has occurred.\n\t */\n\treadonly payloadShareError: unknown;\n\t/**\n\t * Event emitter, with events that emit as the payload state transitions.\n\t */\n\treadonly events: Listenable<IFluidHandleEvents & ILocalFluidHandleEvents>;\n}\n\n/**\n * Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.\n *\n * @remarks\n * To narrow arbitrary objects to handles do not simply check for this symbol:\n * instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility\n * with older implementations of handles that may exist due to dynamic code loading of older packages.\n *\n * @privateRemarks\n * Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.\n * In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.\n * Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:\n * @public\n */\nexport const fluidHandleSymbol: unique symbol = Symbol.for(\n\t\"FluidHandle-3978c7cf-4675-49ba-a20c-bf35efbf43da\",\n);\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @sealed @public\n */\nexport interface IFluidHandle<out T = unknown> {\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Returns a promise to the Fluid Object referenced by the handle.\n\t */\n\tget(): Promise<T>;\n\n\t/**\n\t * Symbol used to mark an object as a {@link (IFluidHandle:interface)}\n\t * and to recover the underlying handle implementation.\n\t *\n\t * @privateRemarks\n\t * Used to recover {@link IFluidHandleInternal}, see {@link toFluidHandleInternal}.\n\t */\n\treadonly [fluidHandleSymbol]: IFluidHandleErased<T>;\n}\n\n/**\n * A type erased Fluid Handle.\n * These can only be produced by the Fluid Framework and provide the implementation details needed to power {@link (IFluidHandle:interface)}.\n * @privateRemarks\n * Created from {@link IFluidHandleInternal} using {@link toFluidHandleErased}.\n * @sealed @public\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IFluidHandleErased<T> extends ErasedType<readonly [\"IFluidHandle\", T]> {}\n"]}
package/lib/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export type { ExtendEventProvider, IErrorEvent, IEvent, IEventProvider, IEventTh
9
9
  export type { IProvideFluidLoadable, IProvideFluidRunnable } from "./fluidLoadable.js";
10
10
  export { IFluidLoadable, IFluidRunnable } from "./fluidLoadable.js";
11
11
  export type { IRequest, IRequestHeader, IResponse } from "./fluidRouter.js";
12
- export type { IProvideFluidHandleContext, IProvideFluidHandle, IFluidHandleInternal, IFluidHandleInternalPayloadPending, IFluidHandleErased, } from "./handles.js";
12
+ export type { IFluidHandleErased, IFluidHandleEvents, IFluidHandleInternal, IFluidHandleInternalPayloadPending, IFluidHandlePayloadPending, ILocalFluidHandle, ILocalFluidHandleEvents, IProvideFluidHandle, IProvideFluidHandleContext, PayloadState, } from "./handles.js";
13
13
  export { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from "./handles.js";
14
14
  export type { ILoggingError, ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryBaseProperties, Tagged, TelemetryBaseEventPropertyType, } from "./logger.js";
15
15
  export { LogLevel } from "./logger.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C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,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAc7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAcpE,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAUpF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type { IErrorBase, IGenericError, IUsageError, IThrottlingWarning } from \"./error.js\";\nexport { FluidErrorTypes } from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable, IProvideFluidRunnable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable, IFluidRunnable } from \"./fluidLoadable.js\";\n\n// TypeScript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type {\n\tIProvideFluidHandleContext,\n\tIProvideFluidHandle,\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandleErased,\n} from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope } from \"./messages.js\";\nexport type { ErasedType } from \"./erasedType.js\";\n\nexport type {\n\tHasListeners,\n\tIEmitter,\n\tIsListener,\n\tListeners,\n\tListenable,\n\tMapGetSet,\n\tNoListenersCallback,\n\tOff,\n} from \"./events/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAc7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAmBpE,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAUpF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type { IErrorBase, IGenericError, IUsageError, IThrottlingWarning } from \"./error.js\";\nexport { FluidErrorTypes } from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable, IProvideFluidRunnable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable, IFluidRunnable } from \"./fluidLoadable.js\";\n\n// TypeScript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type {\n\tIFluidHandleErased,\n\tIFluidHandleEvents,\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n\tILocalFluidHandleEvents,\n\tIProvideFluidHandle,\n\tIProvideFluidHandleContext,\n\tPayloadState,\n} from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope } from \"./messages.js\";\nexport type { ErasedType } from \"./erasedType.js\";\n\nexport type {\n\tHasListeners,\n\tIEmitter,\n\tIsListener,\n\tListeners,\n\tListenable,\n\tMapGetSet,\n\tNoListenersCallback,\n\tOff,\n} from \"./events/index.js\";\n"]}
package/lib/legacy.d.ts CHANGED
@@ -48,9 +48,14 @@ export {
48
48
  // @legacy APIs
49
49
  FluidErrorTypes,
50
50
  IFluidHandleContext,
51
+ IFluidHandleEvents,
51
52
  IFluidHandleInternal,
53
+ IFluidHandlePayloadPending,
54
+ ILocalFluidHandle,
55
+ ILocalFluidHandleEvents,
52
56
  ILoggingError,
53
57
  IProvideFluidHandle,
54
58
  IProvideFluidHandleContext,
55
- IThrottlingWarning
59
+ IThrottlingWarning,
60
+ PayloadState
56
61
  } from "./index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/core-interfaces",
3
- "version": "2.33.2",
3
+ "version": "2.40.0",
4
4
  "description": "Fluid object interfaces",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -17,11 +17,16 @@ export interface IProvideFluidLoadable {
17
17
  readonly IFluidLoadable: IFluidLoadable;
18
18
  }
19
19
  /**
20
- * A shared FluidObject has a URL from which it can be referenced
20
+ * A shared {@link FluidObject} with a handle that can be used to retrieve it.
21
+ * @remarks
22
+ * In this context, "shared" means that the object might be shared via a {@link https://fluidframework.com/docs/concepts/architecture#fluid-service|Fluid service} and
23
+ * thus could be viewed and edited by other clients.
21
24
  * @sealed @public
22
25
  */
23
26
  export interface IFluidLoadable extends IProvideFluidLoadable {
24
- // Handle to the loadable FluidObject
27
+ /**
28
+ * Handle to this loadable {@link FluidObject}.
29
+ */
25
30
  readonly handle: IFluidHandle;
26
31
  }
27
32
 
package/src/handles.ts CHANGED
@@ -5,6 +5,7 @@
5
5
 
6
6
  import type { ErasedType } from "./erasedType.js";
7
7
  import type { IRequest, IResponse } from "./fluidRouter.js";
8
+ import type { Listenable } from "./internal.js";
8
9
 
9
10
  /**
10
11
  * @legacy
@@ -97,6 +98,8 @@ export interface IFluidHandleInternal<
97
98
  /**
98
99
  * Binds the given handle to this one or attach the given handle if this handle is attached.
99
100
  * A bound handle will also be attached once this handle is attached.
101
+ *
102
+ * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.
100
103
  */
101
104
  bind(handle: IFluidHandleInternal): void;
102
105
  }
@@ -117,6 +120,77 @@ export interface IFluidHandleInternalPayloadPending<
117
120
  readonly payloadPending: boolean;
118
121
  }
119
122
 
123
+ /**
124
+ * The state of the handle's payload.
125
+ * - "pending" - The payload is not shared to all collaborators
126
+ * - "shared" - The payload is available to both the local client and remote collaborators
127
+ *
128
+ * @remarks
129
+ * Clients will see a transition of "pending" to "shared" when the payload has been shared to all collaborators.
130
+ * @legacy
131
+ * @alpha
132
+ */
133
+ export type PayloadState = "pending" | "shared";
134
+
135
+ /**
136
+ * Events which fire from an IFluidHandle.
137
+ * @legacy
138
+ * @alpha
139
+ */
140
+ export interface IFluidHandleEvents {
141
+ /**
142
+ * Emitted when the payload becomes available to remote collaborators.
143
+ */
144
+ payloadShared: () => void;
145
+ }
146
+
147
+ /**
148
+ * Observable state on the handle regarding its payload sharing state.
149
+ *
150
+ * @privateRemarks
151
+ * Contents to be merged to IFluidHandle, and then this separate interface should be removed.
152
+ * @legacy
153
+ * @alpha
154
+ */
155
+ export interface IFluidHandlePayloadPending<T> extends IFluidHandle<T> {
156
+ /**
157
+ * The current state of the handle's payload.
158
+ */
159
+ readonly payloadState: PayloadState;
160
+ /**
161
+ * Event emitter, with events that emit as the payload state transitions.
162
+ */
163
+ readonly events: Listenable<IFluidHandleEvents>;
164
+ }
165
+
166
+ /**
167
+ * Additional events which fire as a local handle's payload state transitions.
168
+ * @legacy
169
+ * @alpha
170
+ */
171
+ export interface ILocalFluidHandleEvents extends IFluidHandleEvents {
172
+ /**
173
+ * Emitted for locally created handles when the payload fails sharing to remote collaborators.
174
+ */
175
+ payloadShareFailed: (error: unknown) => void;
176
+ }
177
+
178
+ /**
179
+ * Additional observable state on a local handle regarding its payload sharing state.
180
+ * @legacy
181
+ * @alpha
182
+ */
183
+ export interface ILocalFluidHandle<T> extends IFluidHandlePayloadPending<T> {
184
+ /**
185
+ * The error encountered by the handle while sharing the payload, if one has occurred. Undefined if no error has occurred.
186
+ */
187
+ readonly payloadShareError: unknown;
188
+ /**
189
+ * Event emitter, with events that emit as the payload state transitions.
190
+ */
191
+ readonly events: Listenable<IFluidHandleEvents & ILocalFluidHandleEvents>;
192
+ }
193
+
120
194
  /**
121
195
  * Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.
122
196
  *
package/src/index.ts CHANGED
@@ -28,11 +28,16 @@ export { IFluidLoadable, IFluidRunnable } from "./fluidLoadable.js";
28
28
  export type { IRequest, IRequestHeader, IResponse } from "./fluidRouter.js";
29
29
 
30
30
  export type {
31
- IProvideFluidHandleContext,
32
- IProvideFluidHandle,
31
+ IFluidHandleErased,
32
+ IFluidHandleEvents,
33
33
  IFluidHandleInternal,
34
34
  IFluidHandleInternalPayloadPending,
35
- IFluidHandleErased,
35
+ IFluidHandlePayloadPending,
36
+ ILocalFluidHandle,
37
+ ILocalFluidHandleEvents,
38
+ IProvideFluidHandle,
39
+ IProvideFluidHandleContext,
40
+ PayloadState,
36
41
  } from "./handles.js";
37
42
  export { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from "./handles.js";
38
43