@fluidframework/container-definitions 0.42.0 → 0.44.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.
@@ -16,15 +16,15 @@ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
16
16
  import { IErrorEvent } from '@fluidframework/common-definitions';
17
17
  import { IEvent } from '@fluidframework/common-definitions';
18
18
  import { IEventProvider } from '@fluidframework/common-definitions';
19
- import { IFluidCodeDetails } from '@fluidframework/core-interfaces';
19
+ import { IFluidCodeDetails as IFluidCodeDetails_2 } from '@fluidframework/core-interfaces';
20
20
  import { IFluidConfiguration } from '@fluidframework/core-interfaces';
21
21
  import { IFluidObject } from '@fluidframework/core-interfaces';
22
- import { IFluidPackage } from '@fluidframework/core-interfaces';
23
- import { IFluidPackageEnvironment } from '@fluidframework/core-interfaces';
22
+ import { IFluidPackage as IFluidPackage_2 } from '@fluidframework/core-interfaces';
23
+ import { IFluidPackageEnvironment as IFluidPackageEnvironment_2 } from '@fluidframework/core-interfaces';
24
24
  import { IFluidResolvedUrl } from '@fluidframework/driver-definitions';
25
25
  import { IFluidRouter } from '@fluidframework/core-interfaces';
26
26
  import { IPendingProposal } from '@fluidframework/protocol-definitions';
27
- import { IProvideFluidCodeDetailsComparer } from '@fluidframework/core-interfaces';
27
+ import { IProvideFluidCodeDetailsComparer as IProvideFluidCodeDetailsComparer_2 } from '@fluidframework/core-interfaces';
28
28
  import { IQuorum } from '@fluidframework/protocol-definitions';
29
29
  import { IRequest } from '@fluidframework/core-interfaces';
30
30
  import { IResolvedUrl } from '@fluidframework/driver-definitions';
@@ -58,6 +58,16 @@ export enum BindState {
58
58
  NotBound = "NotBound"
59
59
  }
60
60
 
61
+ // @public
62
+ export namespace ConnectionState {
63
+ export type Connected = 2;
64
+ export type Connecting = 1;
65
+ export type Disconnected = 0;
66
+ }
67
+
68
+ // @public
69
+ export type ConnectionState = ConnectionState.Disconnected | ConnectionState.Connecting | ConnectionState.Connected;
70
+
61
71
  // @public
62
72
  export enum ContainerErrorType {
63
73
  dataCorruptionError = "dataCorruptionError",
@@ -86,9 +96,14 @@ export interface ICodeAllowList {
86
96
  testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;
87
97
  }
88
98
 
99
+ // @public
100
+ export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer_2> {
101
+ load(source: IFluidCodeDetails_2): Promise<IFluidModuleWithDetails>;
102
+ }
103
+
89
104
  // @public @deprecated
90
- export interface ICodeLoader extends Partial<IProvideFluidCodeDetailsComparer> {
91
- load(source: IFluidCodeDetails): Promise<IFluidModule>;
105
+ export interface ICodeLoader extends Partial<IProvideFluidCodeDetailsComparer_2> {
106
+ load(source: IFluidCodeDetails_2): Promise<IFluidModule>;
92
107
  }
93
108
 
94
109
  // @public
@@ -102,8 +117,6 @@ export interface IConnectionDetails {
102
117
  existing: boolean;
103
118
  // (undocumented)
104
119
  initialClients: ISignalClient[];
105
- // @deprecated (undocumented)
106
- maxMessageSize: number;
107
120
  // (undocumented)
108
121
  mode: ConnectionMode;
109
122
  // (undocumented)
@@ -116,21 +129,31 @@ export interface IConnectionDetails {
116
129
  export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {
117
130
  attach(request: IRequest): Promise<void>;
118
131
  readonly attachState: AttachState;
132
+ readonly audience: IAudience;
133
+ // @alpha
134
+ readonly clientId?: string | undefined;
119
135
  close(error?: ICriticalContainerError): void;
120
136
  closeAndGetPendingLocalState(): string;
121
137
  readonly closed: boolean;
122
- // @deprecated
123
- readonly codeDetails: IFluidCodeDetails | undefined;
138
+ readonly connected: boolean;
139
+ readonly connectionState: ConnectionState;
124
140
  deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
141
+ // @alpha
142
+ forceReadonly?(readonly: boolean): any;
125
143
  getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
126
- getLoadedCodeDetails?(): IFluidCodeDetails | undefined;
144
+ getLoadedCodeDetails?(): IFluidCodeDetails_2 | undefined;
127
145
  getQuorum(): IQuorum;
128
- getSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;
146
+ getSpecifiedCodeDetails?(): IFluidCodeDetails_2 | undefined;
129
147
  readonly isDirty: boolean;
130
- proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;
148
+ proposeCodeDetails(codeDetails: IFluidCodeDetails_2): Promise<boolean>;
149
+ readonly readOnlyInfo: ReadOnlyInfo;
131
150
  request(request: IRequest): Promise<IResponse>;
132
151
  resolvedUrl: IResolvedUrl | undefined;
152
+ // @alpha
153
+ resume?(): void;
133
154
  serialize(): string;
155
+ // @alpha
156
+ setAutoReconnect?(reconnect: boolean): void;
134
157
  }
135
158
 
136
159
  // @public
@@ -157,7 +180,9 @@ export interface IContainerContext extends IDisposable {
157
180
  getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;
158
181
  // (undocumented)
159
182
  getLoadedFromVersion(): IVersion | undefined;
160
- // (undocumented)
183
+ // @deprecated (undocumented)
184
+ getSpecifiedCodeDetails?(): IFluidCodeDetails_2 | undefined;
185
+ // @deprecated (undocumented)
161
186
  readonly id: string;
162
187
  // (undocumented)
163
188
  readonly loader: ILoader;
@@ -193,9 +218,9 @@ export interface IContainerEvents extends IEvent {
193
218
  // (undocumented)
194
219
  (event: "connected", listener: (clientId: string) => void): any;
195
220
  // (undocumented)
196
- (event: "codeDetailsProposed", listener: (codeDetails: IFluidCodeDetails, proposal: IPendingProposal) => void): any;
221
+ (event: "codeDetailsProposed", listener: (codeDetails: IFluidCodeDetails_2, proposal: IPendingProposal) => void): any;
197
222
  // (undocumented)
198
- (event: "contextChanged", listener: (codeDetails: IFluidCodeDetails) => void): any;
223
+ (event: "contextChanged", listener: (codeDetails: IFluidCodeDetails_2) => void): any;
199
224
  // (undocumented)
200
225
  (event: "disconnected" | "attached", listener: () => void): any;
201
226
  // (undocumented)
@@ -229,6 +254,7 @@ export interface IDeltaHandlerStrategy {
229
254
  export interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender, IDisposable {
230
255
  readonly active: boolean;
231
256
  readonly clientDetails: IClientDetails;
257
+ // @deprecated (undocumented)
232
258
  close(): void;
233
259
  readonly hasCheckpointSequenceNumber: boolean;
234
260
  readonly inbound: IDeltaQueue<T>;
@@ -307,31 +333,75 @@ export interface IErrorBase extends Partial<Error> {
307
333
  }
308
334
 
309
335
  // @public
310
- export interface IFluidBrowserPackage extends IFluidPackage {
336
+ export interface IFluidBrowserPackage extends IFluidPackage_2 {
311
337
  // (undocumented)
312
338
  fluid: {
313
339
  browser: IFluidBrowserPackageEnvironment;
314
- [environment: string]: IFluidPackageEnvironment;
340
+ [environment: string]: IFluidPackageEnvironment_2;
315
341
  };
316
342
  }
317
343
 
318
344
  // @public
319
- export interface IFluidBrowserPackageEnvironment extends IFluidPackageEnvironment {
345
+ export interface IFluidBrowserPackageEnvironment extends IFluidPackageEnvironment_2 {
320
346
  umd: {
321
347
  files: string[];
322
348
  library: string;
323
349
  };
324
350
  }
325
351
 
352
+ // @public
353
+ export interface IFluidCodeDetails {
354
+ readonly config?: IFluidCodeDetailsConfig;
355
+ readonly package: string | Readonly<IFluidPackage>;
356
+ }
357
+
358
+ // @public (undocumented)
359
+ export const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer;
360
+
361
+ // @public
362
+ export interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {
363
+ compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;
364
+ satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;
365
+ }
366
+
367
+ // @public
368
+ export interface IFluidCodeDetailsConfig {
369
+ // (undocumented)
370
+ readonly [key: string]: string;
371
+ }
372
+
326
373
  // @public
327
374
  export interface IFluidCodeResolver {
328
- resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;
375
+ resolveCodeDetails(details: IFluidCodeDetails_2): Promise<IResolvedFluidCodeDetails>;
329
376
  }
330
377
 
331
378
  // @public (undocumented)
332
379
  export interface IFluidModule {
333
380
  // (undocumented)
334
- fluidExport: IFluidObject & FluidObject<IRuntimeFactory & IProvideFluidCodeDetailsComparer>;
381
+ fluidExport: IFluidObject & FluidObject<IRuntimeFactory & IProvideFluidCodeDetailsComparer_2>;
382
+ }
383
+
384
+ // @public
385
+ export interface IFluidModuleWithDetails {
386
+ details: IFluidCodeDetails_2;
387
+ module: IFluidModule;
388
+ }
389
+
390
+ // @public
391
+ export interface IFluidPackage {
392
+ [key: string]: unknown;
393
+ fluid: {
394
+ [environment: string]: undefined | IFluidPackageEnvironment;
395
+ };
396
+ name: string;
397
+ }
398
+
399
+ // @public
400
+ export interface IFluidPackageEnvironment {
401
+ [target: string]: undefined | {
402
+ files: string[];
403
+ [key: string]: unknown;
404
+ };
335
405
  }
336
406
 
337
407
  // @public @deprecated (undocumented)
@@ -355,7 +425,7 @@ export interface IGenericError extends IErrorBase {
355
425
 
356
426
  // @public
357
427
  export interface IHostLoader extends ILoader {
358
- createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;
428
+ createDetachedContainer(codeDetails: IFluidCodeDetails_2): Promise<IContainer>;
359
429
  rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;
360
430
  }
361
431
 
@@ -405,6 +475,12 @@ export interface IProvideDeltaSender {
405
475
  readonly IDeltaSender: IDeltaSender;
406
476
  }
407
477
 
478
+ // @public (undocumented)
479
+ export interface IProvideFluidCodeDetailsComparer {
480
+ // (undocumented)
481
+ readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;
482
+ }
483
+
408
484
  // @public @deprecated (undocumented)
409
485
  export interface IProvideFluidTokenProvider {
410
486
  // (undocumented)
@@ -430,8 +506,8 @@ export interface IProxyLoaderFactory {
430
506
  }
431
507
 
432
508
  // @public
433
- export interface IResolvedFluidCodeDetails extends IFluidCodeDetails {
434
- readonly resolvedPackage: Readonly<IFluidPackage>;
509
+ export interface IResolvedFluidCodeDetails extends IFluidCodeDetails_2 {
510
+ readonly resolvedPackage: Readonly<IFluidPackage_2>;
435
511
  readonly resolvedPackageCacheId: string | undefined;
436
512
  }
437
513
 
@@ -458,6 +534,12 @@ export interface IRuntimeFactory extends IProvideRuntimeFactory {
458
534
  // @public
459
535
  export const isFluidBrowserPackage: (maybePkg: any) => maybePkg is Readonly<IFluidBrowserPackage>;
460
536
 
537
+ // @public (undocumented)
538
+ export const isFluidCodeDetails: (details: unknown) => details is Readonly<IFluidCodeDetails>;
539
+
540
+ // @public
541
+ export const isFluidPackage: (pkg: any) => pkg is Readonly<IFluidPackage>;
542
+
461
543
  // @public
462
544
  export interface IThrottlingWarning extends IErrorBase {
463
545
  // (undocumented)
package/dist/deltas.d.ts CHANGED
@@ -14,10 +14,6 @@ export interface IConnectionDetails {
14
14
  mode: ConnectionMode;
15
15
  version: string;
16
16
  initialClients: ISignalClient[];
17
- /**
18
- * @deprecated - please use `serviceConfiguration.maxMessageSize`
19
- */
20
- maxMessageSize: number;
21
17
  serviceConfiguration: IClientConfiguration;
22
18
  /**
23
19
  * Last known sequence number to ordering service at the time of connection
@@ -134,7 +130,7 @@ export interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>
134
130
  */
135
131
  readonly readonly?: boolean;
136
132
  readonly readOnlyInfo: ReadOnlyInfo;
137
- /** Terminate the connection to storage */
133
+ /** @deprecated - Use Container.close() or IContainerContext.closeFn() */
138
134
  close(): void;
139
135
  /** Submit a signal to the service to be broadcast to other connected clients, but not persisted */
140
136
  submitSignal(content: any): void;
@@ -1 +1 @@
1
- {"version":3,"file":"deltas.d.ts","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtG,OAAO,EACH,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EACh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G,SAAS,CAAC;CACxC,GAAG;IACA,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1C,gDAAgD;IAChD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CACjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"deltas.js","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6DH;;GAEG;AACU,QAAA,YAAY,GAA8B,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IEvent, IErrorEvent } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Contract representing the result of a newly established connection to the server for syncing deltas\n */\nexport interface IConnectionDetails {\n clientId: string;\n claims: ITokenClaims;\n existing: boolean;\n mode: ConnectionMode;\n version: string;\n initialClients: ISignalClient[];\n /**\n * @deprecated - please use `serviceConfiguration.maxMessageSize`\n */\n maxMessageSize: number;\n serviceConfiguration: IClientConfiguration;\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber: number | undefined;\n}\n\n/**\n * Interface used to define a strategy for handling incoming delta messages\n */\nexport interface IDeltaHandlerStrategy {\n /**\n * Processes the message.\n */\n process: (message: ISequencedDocumentMessage) => void;\n\n /**\n * Processes the signal.\n */\n processSignal: (message: ISignalMessage) => void;\n}\n\ndeclare module \"@fluidframework/core-interfaces\" {\n interface IFluidObject {\n /** @deprecated - use `FluidObject<IDeltaSender>` instead */\n readonly IDeltaSender?: IDeltaSender\n }\n}\n\n/**\n * @deprecated - This will be removed in a later release.\n */\nexport const IDeltaSender: keyof IProvideDeltaSender = \"IDeltaSender\";\n\n/**\n * @deprecated - This will be removed in a later release.\n */\nexport interface IProvideDeltaSender {\n /**\n * @deprecated - This will be removed in a later release.\n */\n readonly IDeltaSender: IDeltaSender;\n}\n\n/**\n * Contract supporting delivery of outbound messages to the server\n */\nexport interface IDeltaSender extends IProvideDeltaSender {\n /**\n * Flush all pending messages through the outbound queue\n */\n flush(): void;\n}\n\n/** Events emitted by the Delta Manager */\nexport interface IDeltaManagerEvents extends IEvent {\n (event: \"prepareSend\", listener: (messageBuffer: any[]) => void);\n (event: \"submitOp\", listener: (message: IDocumentMessage) => void);\n (event: \"op\", listener: (message: ISequencedDocumentMessage, processingTime: number) => void);\n (event: \"allSentOpsAckd\", listener: () => void);\n (event: \"pong\" | \"processTime\", listener: (latency: number) => void);\n /**\n * The connect event fires once we've received the connect_document_success message from the\n * server. This happens prior to the client's join message (if there is a join message).\n */\n (event: \"connect\", listener: (details: IConnectionDetails, opsBehind?: number) => void);\n (event: \"disconnect\", listener: (reason: string) => void);\n (event: \"readonly\", listener: (readonly: boolean) => void);\n}\n\n/**\n * Manages the transmission of ops between the runtime and storage.\n */\nexport interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender, IDisposable {\n /** The queue of inbound delta messages */\n readonly inbound: IDeltaQueue<T>;\n\n /** The queue of outbound delta messages */\n readonly outbound: IDeltaQueue<U[]>;\n\n /** The queue of inbound delta signals */\n readonly inboundSignal: IDeltaQueue<ISignalMessage>;\n\n /** The current minimum sequence number */\n readonly minimumSequenceNumber: number;\n\n /** The last sequence number processed by the delta manager */\n readonly lastSequenceNumber: number;\n\n /** The last message processed by the delta manager */\n readonly lastMessage: ISequencedDocumentMessage | undefined;\n\n /** The latest sequence number the delta manager is aware of */\n readonly lastKnownSeqNumber: number;\n\n /** The initial sequence number set when attaching the op handler */\n readonly initialSequenceNumber: number;\n\n /**\n * Tells if current connection has checkpoint information.\n * I.e. we know how far behind the client was at the time of establishing connection\n */\n readonly hasCheckpointSequenceNumber: boolean;\n\n /** Details of client */\n readonly clientDetails: IClientDetails;\n\n /** Protocol version being used to communicate with the service */\n readonly version: string;\n\n /** Max message size allowed to the delta manager */\n readonly maxMessageSize: number;\n\n /** Service configuration provided by the service. */\n readonly serviceConfiguration: IClientConfiguration | undefined;\n\n /** Flag to indicate whether the client can write or not. */\n readonly active: boolean;\n\n /**\n * Tells if container is in read-only mode.\n * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n * Readonly state can be because of no storage write permission,\n * or due to host forcing readonly mode for container.\n *\n * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n *\n * It is undefined if we have not yet established websocket connection\n * and do not know if user has write access to a file.\n * @deprecated - use readOnlyInfo\n */\n readonly readonly?: boolean;\n\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /** Terminate the connection to storage */\n close(): void;\n\n /** Submit a signal to the service to be broadcast to other connected clients, but not persisted */\n submitSignal(content: any): void;\n}\n\n/** Events emitted by a Delta Queue */\nexport interface IDeltaQueueEvents<T> extends IErrorEvent {\n (event: \"push\" | \"op\", listener: (task: T) => void);\n /**\n * @param count - number of events (T) processed before becoming idle\n * @param duration - amount of time it took to process elements (milliseconds).\n */\n (event: \"idle\", listener: (count: number, duration: number) => void);\n}\n\n/**\n * Queue of ops to be sent to or processed from storage\n */\nexport interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {\n /**\n * Flag indicating whether or not the queue was paused\n */\n paused: boolean;\n\n /**\n * The number of messages remaining in the queue\n */\n length: number;\n\n /**\n * Flag indicating whether or not the queue is idle\n */\n idle: boolean;\n\n /**\n * Pauses processing on the queue\n * @returns A promise which resolves when processing has been paused.\n */\n pause(): Promise<void>;\n\n /**\n * Resumes processing on the queue\n */\n resume(): void;\n\n /**\n * Peeks at the next message in the queue\n */\n peek(): T | undefined;\n\n /**\n * Returns all the items in the queue as an array. Does not remove them from the queue.\n */\n toArray(): T[];\n\n waitTillProcessingDone(): Promise<void>;\n}\n\nexport type ReadOnlyInfo = {\n readonly readonly: false | undefined;\n} | {\n readonly readonly: true;\n /** read-only because forceReadOnly() was called */\n readonly forced: boolean;\n /** read-only because client does not have write permissions for document */\n readonly permissions: boolean | undefined;\n /** read-only with no delta stream connection */\n readonly storageOnly: boolean;\n};\n"]}
1
+ {"version":3,"file":"deltas.js","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyDH;;GAEG;AACU,QAAA,YAAY,GAA8B,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IEvent, IErrorEvent } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Contract representing the result of a newly established connection to the server for syncing deltas\n */\nexport interface IConnectionDetails {\n clientId: string;\n claims: ITokenClaims;\n existing: boolean;\n mode: ConnectionMode;\n version: string;\n initialClients: ISignalClient[];\n serviceConfiguration: IClientConfiguration;\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber: number | undefined;\n}\n\n/**\n * Interface used to define a strategy for handling incoming delta messages\n */\nexport interface IDeltaHandlerStrategy {\n /**\n * Processes the message.\n */\n process: (message: ISequencedDocumentMessage) => void;\n\n /**\n * Processes the signal.\n */\n processSignal: (message: ISignalMessage) => void;\n}\n\ndeclare module \"@fluidframework/core-interfaces\" {\n interface IFluidObject {\n /** @deprecated - use `FluidObject<IDeltaSender>` instead */\n readonly IDeltaSender?: IDeltaSender\n }\n}\n\n/**\n * @deprecated - This will be removed in a later release.\n */\nexport const IDeltaSender: keyof IProvideDeltaSender = \"IDeltaSender\";\n\n/**\n * @deprecated - This will be removed in a later release.\n */\nexport interface IProvideDeltaSender {\n /**\n * @deprecated - This will be removed in a later release.\n */\n readonly IDeltaSender: IDeltaSender;\n}\n\n/**\n * Contract supporting delivery of outbound messages to the server\n */\nexport interface IDeltaSender extends IProvideDeltaSender {\n /**\n * Flush all pending messages through the outbound queue\n */\n flush(): void;\n}\n\n/** Events emitted by the Delta Manager */\nexport interface IDeltaManagerEvents extends IEvent {\n (event: \"prepareSend\", listener: (messageBuffer: any[]) => void);\n (event: \"submitOp\", listener: (message: IDocumentMessage) => void);\n (event: \"op\", listener: (message: ISequencedDocumentMessage, processingTime: number) => void);\n (event: \"allSentOpsAckd\", listener: () => void);\n (event: \"pong\" | \"processTime\", listener: (latency: number) => void);\n /**\n * The connect event fires once we've received the connect_document_success message from the\n * server. This happens prior to the client's join message (if there is a join message).\n */\n (event: \"connect\", listener: (details: IConnectionDetails, opsBehind?: number) => void);\n (event: \"disconnect\", listener: (reason: string) => void);\n (event: \"readonly\", listener: (readonly: boolean) => void);\n}\n\n/**\n * Manages the transmission of ops between the runtime and storage.\n */\nexport interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender, IDisposable {\n /** The queue of inbound delta messages */\n readonly inbound: IDeltaQueue<T>;\n\n /** The queue of outbound delta messages */\n readonly outbound: IDeltaQueue<U[]>;\n\n /** The queue of inbound delta signals */\n readonly inboundSignal: IDeltaQueue<ISignalMessage>;\n\n /** The current minimum sequence number */\n readonly minimumSequenceNumber: number;\n\n /** The last sequence number processed by the delta manager */\n readonly lastSequenceNumber: number;\n\n /** The last message processed by the delta manager */\n readonly lastMessage: ISequencedDocumentMessage | undefined;\n\n /** The latest sequence number the delta manager is aware of */\n readonly lastKnownSeqNumber: number;\n\n /** The initial sequence number set when attaching the op handler */\n readonly initialSequenceNumber: number;\n\n /**\n * Tells if current connection has checkpoint information.\n * I.e. we know how far behind the client was at the time of establishing connection\n */\n readonly hasCheckpointSequenceNumber: boolean;\n\n /** Details of client */\n readonly clientDetails: IClientDetails;\n\n /** Protocol version being used to communicate with the service */\n readonly version: string;\n\n /** Max message size allowed to the delta manager */\n readonly maxMessageSize: number;\n\n /** Service configuration provided by the service. */\n readonly serviceConfiguration: IClientConfiguration | undefined;\n\n /** Flag to indicate whether the client can write or not. */\n readonly active: boolean;\n\n /**\n * Tells if container is in read-only mode.\n * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n * Readonly state can be because of no storage write permission,\n * or due to host forcing readonly mode for container.\n *\n * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n *\n * It is undefined if we have not yet established websocket connection\n * and do not know if user has write access to a file.\n * @deprecated - use readOnlyInfo\n */\n readonly readonly?: boolean;\n\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /** @deprecated - Use Container.close() or IContainerContext.closeFn() */\n close(): void;\n\n /** Submit a signal to the service to be broadcast to other connected clients, but not persisted */\n submitSignal(content: any): void;\n}\n\n/** Events emitted by a Delta Queue */\nexport interface IDeltaQueueEvents<T> extends IErrorEvent {\n (event: \"push\" | \"op\", listener: (task: T) => void);\n /**\n * @param count - number of events (T) processed before becoming idle\n * @param duration - amount of time it took to process elements (milliseconds).\n */\n (event: \"idle\", listener: (count: number, duration: number) => void);\n}\n\n/**\n * Queue of ops to be sent to or processed from storage\n */\nexport interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {\n /**\n * Flag indicating whether or not the queue was paused\n */\n paused: boolean;\n\n /**\n * The number of messages remaining in the queue\n */\n length: number;\n\n /**\n * Flag indicating whether or not the queue is idle\n */\n idle: boolean;\n\n /**\n * Pauses processing on the queue\n * @returns A promise which resolves when processing has been paused.\n */\n pause(): Promise<void>;\n\n /**\n * Resumes processing on the queue\n */\n resume(): void;\n\n /**\n * Peeks at the next message in the queue\n */\n peek(): T | undefined;\n\n /**\n * Returns all the items in the queue as an array. Does not remove them from the queue.\n */\n toArray(): T[];\n\n waitTillProcessingDone(): Promise<void>;\n}\n\nexport type ReadOnlyInfo = {\n readonly readonly: false | undefined;\n} | {\n readonly readonly: true;\n /** read-only because forceReadOnly() was called */\n readonly forced: boolean;\n /** read-only because client does not have write permissions for document */\n readonly permissions: boolean | undefined;\n /** read-only with no delta stream connection */\n readonly storageOnly: boolean;\n};\n"]}
@@ -0,0 +1,109 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Specifies an environment on Fluid property of a IFluidPackage
7
+ */
8
+ export interface IFluidPackageEnvironment {
9
+ /**
10
+ * The name of the target. For a browser environment, this could be umd for scripts
11
+ * or css for styles.
12
+ */
13
+ [target: string]: undefined | {
14
+ /**
15
+ * List of files for the target. These can be relative or absolute.
16
+ * The code loader should resolve relative paths, and validate all
17
+ * full urls.
18
+ */
19
+ files: string[];
20
+ /**
21
+ * General access for extended fields as specific usages will
22
+ * likely have additional infornamation like a definition
23
+ * of Library, the entrypoint for umd packages
24
+ */
25
+ [key: string]: unknown;
26
+ };
27
+ }
28
+ /**
29
+ * Fluid-specific properties expected on a package to be loaded by the code loader.
30
+ * While compatible with the npm package format it is not necessary that that package is an
31
+ * npm package:
32
+ * {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}
33
+ */
34
+ export interface IFluidPackage {
35
+ /**
36
+ * The name of the package that this code represnets
37
+ */
38
+ name: string;
39
+ /**
40
+ * This object represents the Fluid specific properties of the package
41
+ */
42
+ fluid: {
43
+ /**
44
+ * The name of the of the environment. This should be something like browser, or node
45
+ * and contain the necessary targets for loading this code in that environment.
46
+ */
47
+ [environment: string]: undefined | IFluidPackageEnvironment;
48
+ };
49
+ /**
50
+ * General access for extended fields as specific usages will
51
+ * likely have additional infornamation like a definition of
52
+ * compatible versions, or deployment information like rings or rollouts.
53
+ */
54
+ [key: string]: unknown;
55
+ }
56
+ /**
57
+ * Check if the package.json defines a Fluid package
58
+ * @param pkg - the package json data to check if it is a Fluid package.
59
+ */
60
+ export declare const isFluidPackage: (pkg: any) => pkg is Readonly<IFluidPackage>;
61
+ /**
62
+ * Package manager configuration. Provides a key value mapping of config values
63
+ */
64
+ export interface IFluidCodeDetailsConfig {
65
+ readonly [key: string]: string;
66
+ }
67
+ /**
68
+ * Data structure used to describe the code to load on the Fluid document
69
+ */
70
+ export interface IFluidCodeDetails {
71
+ /**
72
+ * The code package to be used on the Fluid document. This is either the package name which will be loaded
73
+ * from a package manager. Or the expanded Fluid package.
74
+ */
75
+ readonly package: string | Readonly<IFluidPackage>;
76
+ /**
77
+ * Configuration details. This includes links to the package manager and base CDNs.
78
+ */
79
+ readonly config?: IFluidCodeDetailsConfig;
80
+ }
81
+ export declare const isFluidCodeDetails: (details: unknown) => details is Readonly<IFluidCodeDetails>;
82
+ export declare const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer;
83
+ export interface IProvideFluidCodeDetailsComparer {
84
+ readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;
85
+ }
86
+ /**
87
+ * Provides capability to compare Fluid code details.
88
+ */
89
+ export interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {
90
+ /**
91
+ * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.
92
+ *
93
+ * Similar semantics to:
94
+ * {@link https://github.com/npm/node-semver#usage}
95
+ */
96
+ satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;
97
+ /**
98
+ * Return a number representing the ascending sort order of the `a` and `b` code details;
99
+ * `< 0` if `a < b`.
100
+ * `= 0` if `a === b`.
101
+ * `> 0` if `a > b`.
102
+ * `undefined` if `a` is not comparable to `b`.
103
+ *
104
+ * Similar semantics to:
105
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description | Array.sort}
106
+ */
107
+ compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;
108
+ }
109
+ //# sourceMappingURL=fluidPackage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluidPackage.d.ts","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEF;;GAEG;AACJ,MAAM,WAAW,wBAAwB;IAErC;;;OAGG;IACH,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG;QAC1B;;;;WAIG;QACH,KAAK,EAAE,MAAM,EAAE,CAAC;QAEhB;;;;WAIG;QACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KAC1B,CAAA;CACJ;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE;QACH;;;WAGG;QACH,CAAC,WAAW,EAAE,MAAM,GAAI,SAAS,GAAG,wBAAwB,CAAC;KAChE,CAAC;IACF;;;;OAIG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAS,GAAG,mCAGF,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEnD;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED,eAAO,MAAM,kBAAkB,YAAa,OAAO,2CAKlD,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,MAAM,gCAA8D,CAAC;AAE7G,MAAM,WAAW,gCAAgC;IAC7C,QAAQ,CAAC,yBAAyB,EAAE,yBAAyB,CAAE;CAClE;AAED;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,gCAAgC;IAE/E;;;;;OAKG;IACH,SAAS,CAAC,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAGzF;;;;;;;;;OASG;IACH,OAAO,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAEpF"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.IFluidCodeDetailsComparer = exports.isFluidCodeDetails = exports.isFluidPackage = void 0;
8
+ /**
9
+ * Check if the package.json defines a Fluid package
10
+ * @param pkg - the package json data to check if it is a Fluid package.
11
+ */
12
+ const isFluidPackage = (pkg) => typeof pkg === "object"
13
+ && typeof (pkg === null || pkg === void 0 ? void 0 : pkg.name) === "string"
14
+ && typeof (pkg === null || pkg === void 0 ? void 0 : pkg.fluid) === "object";
15
+ exports.isFluidPackage = isFluidPackage;
16
+ const isFluidCodeDetails = (details) => {
17
+ const maybeCodeDetails = details;
18
+ return typeof maybeCodeDetails === "object"
19
+ && (typeof (maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.package) === "string" || exports.isFluidPackage(maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.package))
20
+ && ((maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.config) === undefined || typeof (maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.config) === "object");
21
+ };
22
+ exports.isFluidCodeDetails = isFluidCodeDetails;
23
+ exports.IFluidCodeDetailsComparer = "IFluidCodeDetailsComparer";
24
+ //# sourceMappingURL=fluidPackage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluidPackage.js","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyDH;;;GAGG;AACI,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAkC,EAAE,CACvE,OAAO,GAAG,KAAK,QAAQ;OACpB,QAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,CAAA,KAAK,QAAQ;OAC7B,QAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,CAAA,KAAK,QAAQ,CAAC;AAHzB,QAAA,cAAc,kBAGW;AAyB/B,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAA0C,EAAE;IAC3F,MAAM,gBAAgB,GAAG,OAAiD,CAAC;IAC3E,OAAO,OAAO,gBAAgB,KAAK,QAAQ;WACpC,CAAC,QAAO,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAA,KAAK,QAAQ,IAAI,sBAAc,CAAC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAC,CAAC;WAC5F,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,MAAK,SAAS,IAAI,QAAO,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,CAAA,KAAK,QAAQ,CAAC,CAAC;AACpG,CAAC,CAAC;AALW,QAAA,kBAAkB,sBAK7B;AAEW,QAAA,yBAAyB,GAA2C,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n /**\n * Specifies an environment on Fluid property of a IFluidPackage\n */\nexport interface IFluidPackageEnvironment {\n\n /**\n * The name of the target. For a browser environment, this could be umd for scripts\n * or css for styles.\n */\n [target: string]: undefined | {\n /**\n * List of files for the target. These can be relative or absolute.\n * The code loader should resolve relative paths, and validate all\n * full urls.\n */\n files: string[];\n\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition\n * of Library, the entrypoint for umd packages\n */\n [key: string]: unknown;\n }\n}\n\n/**\n * Fluid-specific properties expected on a package to be loaded by the code loader.\n * While compatible with the npm package format it is not necessary that that package is an\n * npm package:\n * {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}\n */\nexport interface IFluidPackage {\n /**\n * The name of the package that this code represnets\n */\n name: string;\n /**\n * This object represents the Fluid specific properties of the package\n */\n fluid: {\n /**\n * The name of the of the environment. This should be something like browser, or node\n * and contain the necessary targets for loading this code in that environment.\n */\n [environment: string]: undefined | IFluidPackageEnvironment;\n };\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition of\n * compatible versions, or deployment information like rings or rollouts.\n */\n [key: string]: unknown;\n}\n\n/**\n * Check if the package.json defines a Fluid package\n * @param pkg - the package json data to check if it is a Fluid package.\n */\nexport const isFluidPackage = (pkg: any): pkg is Readonly<IFluidPackage> =>\n typeof pkg === \"object\"\n && typeof pkg?.name === \"string\"\n && typeof pkg?.fluid === \"object\";\n\n/**\n * Package manager configuration. Provides a key value mapping of config values\n */\nexport interface IFluidCodeDetailsConfig {\n readonly [key: string]: string;\n}\n\n/**\n * Data structure used to describe the code to load on the Fluid document\n */\nexport interface IFluidCodeDetails {\n /**\n * The code package to be used on the Fluid document. This is either the package name which will be loaded\n * from a package manager. Or the expanded Fluid package.\n */\n readonly package: string | Readonly<IFluidPackage>;\n\n /**\n * Configuration details. This includes links to the package manager and base CDNs.\n */\n readonly config?: IFluidCodeDetailsConfig;\n}\n\nexport const isFluidCodeDetails = (details: unknown): details is Readonly<IFluidCodeDetails> =>{\n const maybeCodeDetails = details as Partial<IFluidCodeDetails> | undefined;\n return typeof maybeCodeDetails === \"object\"\n && (typeof maybeCodeDetails?.package === \"string\" || isFluidPackage(maybeCodeDetails?.package))\n && (maybeCodeDetails?.config === undefined || typeof maybeCodeDetails?.config === \"object\");\n};\n\nexport const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer = \"IFluidCodeDetailsComparer\";\n\nexport interface IProvideFluidCodeDetailsComparer {\n readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer ;\n}\n\n/**\n * Provides capability to compare Fluid code details.\n */\nexport interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {\n\n /**\n * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.\n *\n * Similar semantics to:\n * {@link https://github.com/npm/node-semver#usage}\n */\n satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;\n\n/* eslint-disable max-len */\n /**\n * Return a number representing the ascending sort order of the `a` and `b` code details;\n * `< 0` if `a < b`.\n * `= 0` if `a === b`.\n * `> 0` if `a > b`.\n * `undefined` if `a` is not comparable to `b`.\n *\n * Similar semantics to:\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description | Array.sort}\n */\n compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;\n/* eslint-enable max-len */\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from "./deltas";
9
9
  export * from "./error";
10
10
  export * from "./loader";
11
11
  export * from "./fluidModule";
12
+ export * from "./fluidPackage";
12
13
  export * from "./proxyLoader";
13
14
  export * from "./runtime";
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ __exportStar(require("./deltas"), exports);
22
22
  __exportStar(require("./error"), exports);
23
23
  __exportStar(require("./loader"), exports);
24
24
  __exportStar(require("./fluidModule"), exports);
25
+ __exportStar(require("./fluidPackage"), exports);
25
26
  __exportStar(require("./proxyLoader"), exports);
26
27
  __exportStar(require("./runtime"), exports);
27
28
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;GAGG;AACH,6CAA2B;AAC3B,mDAAiC;AACjC,sDAAsD;AACtD,qDAAmC;AACnC,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,gDAA8B;AAC9B,gDAA8B;AAC9B,4CAA0B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nexport * from \"./audience\";\nexport * from \"./browserPackage\";\n// eslint-disable-next-line import/no-internal-modules\nexport * from \"./legacy/chaincode\";\nexport * from \"./deltas\";\nexport * from \"./error\";\nexport * from \"./loader\";\nexport * from \"./fluidModule\";\nexport * from \"./proxyLoader\";\nexport * from \"./runtime\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;GAGG;AACH,6CAA2B;AAC3B,mDAAiC;AACjC,sDAAsD;AACtD,qDAAmC;AACnC,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,gDAA8B;AAC9B,iDAA+B;AAC/B,gDAA8B;AAC9B,4CAA0B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nexport * from \"./audience\";\nexport * from \"./browserPackage\";\n// eslint-disable-next-line import/no-internal-modules\nexport * from \"./legacy/chaincode\";\nexport * from \"./deltas\";\nexport * from \"./error\";\nexport * from \"./loader\";\nexport * from \"./fluidModule\";\nexport * from \"./fluidPackage\";\nexport * from \"./proxyLoader\";\nexport * from \"./runtime\";\n"]}