diff --git a/packages/dds/tree/api-report/tree.alpha.api.md b/packages/dds/tree/api-report/tree.alpha.api.md index f27d5e37e910..7f84c452cf26 100644 --- a/packages/dds/tree/api-report/tree.alpha.api.md +++ b/packages/dds/tree/api-report/tree.alpha.api.md @@ -421,9 +421,9 @@ export namespace JsonAsTree { } const // @system _APIExtractorWorkaroundObjectBase: TreeNodeSchemaClass<"com.fluidframework.json.object", NodeKind.Map, System_Unsafe.TreeMapNodeUnsafe, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.object", NodeKind.Map, unknown>, { - [Symbol.iterator](): Iterator<[string, string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe, LeafSchema<"boolean", boolean>> | null], any, undefined>; + [Symbol.iterator](): Iterator<[string, string | number | System_Unsafe.InsertableTypedNodeUnsafe, LeafSchema<"boolean", boolean>> | JsonObject | Array | null], any, undefined>; } | { - readonly [x: string]: string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe, LeafSchema<"boolean", boolean>> | null; + readonly [x: string]: string | number | System_Unsafe.InsertableTypedNodeUnsafe, LeafSchema<"boolean", boolean>> | JsonObject | Array | null; }, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>; // (undocumented) export type Primitive = TreeNodeFromImplicitAllowedTypes; @@ -431,7 +431,7 @@ export namespace JsonAsTree { export type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema; const // @system _APIExtractorWorkaroundArrayBase: TreeNodeSchemaClass<"com.fluidframework.json.array", NodeKind.Array, System_Unsafe.TreeArrayNodeUnsafe, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.array", NodeKind.Array, unknown>, { - [Symbol.iterator](): Iterator, LeafSchema<"boolean", boolean>> | null, any, undefined>; + [Symbol.iterator](): Iterator, LeafSchema<"boolean", boolean>> | JsonObject | Array | null, any, undefined>; }, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>; // (undocumented) export type Tree = TreeNodeFromImplicitAllowedTypes; diff --git a/packages/framework/fluid-framework/api-report/fluid-framework.alpha.api.md b/packages/framework/fluid-framework/api-report/fluid-framework.alpha.api.md index 4c6348f43fef..7147081e9450 100644 --- a/packages/framework/fluid-framework/api-report/fluid-framework.alpha.api.md +++ b/packages/framework/fluid-framework/api-report/fluid-framework.alpha.api.md @@ -145,7 +145,7 @@ export namespace ConnectionStateType { export type ConnectionStateType = ConnectionStateType.Disconnected | ConnectionStateType.EstablishingConnection | ConnectionStateType.CatchingUp | ConnectionStateType.Connected; // @public -export type ContainerAttachProps = T; +export type ContainerAttachProps = AttachProps & T; // @public export interface ContainerSchema { @@ -538,8 +538,8 @@ export type IEventTransformer = TEvent extends { } ? TransformedEvent : TransformedEvent; // @public @sealed -export interface IFluidContainer extends IEventProvider { - attach(props?: ContainerAttachProps): Promise; +export interface IFluidContainer extends IEventProvider { + attach(props?: ContainerAttachProps): Promise; readonly attachState: AttachState; connect(): void; readonly connectionState: ConnectionStateType; @@ -760,9 +760,9 @@ export namespace JsonAsTree { } const // @system _APIExtractorWorkaroundObjectBase: TreeNodeSchemaClass<"com.fluidframework.json.object", NodeKind.Map, System_Unsafe.TreeMapNodeUnsafe, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.object", NodeKind.Map, unknown>, { - [Symbol.iterator](): Iterator<[string, string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe, LeafSchema<"boolean", boolean>> | null], any, undefined>; + [Symbol.iterator](): Iterator<[string, string | number | System_Unsafe.InsertableTypedNodeUnsafe, LeafSchema<"boolean", boolean>> | JsonObject | Array | null], any, undefined>; } | { - readonly [x: string]: string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe, LeafSchema<"boolean", boolean>> | null; + readonly [x: string]: string | number | System_Unsafe.InsertableTypedNodeUnsafe, LeafSchema<"boolean", boolean>> | JsonObject | Array | null; }, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>; // (undocumented) export type Primitive = TreeNodeFromImplicitAllowedTypes; @@ -770,7 +770,7 @@ export namespace JsonAsTree { export type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema; const // @system _APIExtractorWorkaroundArrayBase: TreeNodeSchemaClass<"com.fluidframework.json.array", NodeKind.Array, System_Unsafe.TreeArrayNodeUnsafe, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.array", NodeKind.Array, unknown>, { - [Symbol.iterator](): Iterator, LeafSchema<"boolean", boolean>> | null, any, undefined>; + [Symbol.iterator](): Iterator, LeafSchema<"boolean", boolean>> | JsonObject | Array | null, any, undefined>; }, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>; // (undocumented) export type Tree = TreeNodeFromImplicitAllowedTypes; diff --git a/packages/framework/fluid-framework/api-report/fluid-framework.beta.api.md b/packages/framework/fluid-framework/api-report/fluid-framework.beta.api.md index f4d6637ffabb..8a597875c683 100644 --- a/packages/framework/fluid-framework/api-report/fluid-framework.beta.api.md +++ b/packages/framework/fluid-framework/api-report/fluid-framework.beta.api.md @@ -59,7 +59,7 @@ export namespace ConnectionStateType { export type ConnectionStateType = ConnectionStateType.Disconnected | ConnectionStateType.EstablishingConnection | ConnectionStateType.CatchingUp | ConnectionStateType.Connected; // @public -export type ContainerAttachProps = T; +export type ContainerAttachProps = AttachProps & T; // @public export interface ContainerSchema { @@ -341,8 +341,8 @@ export type IEventTransformer = TEvent extends { } ? TransformedEvent : TransformedEvent; // @public @sealed -export interface IFluidContainer extends IEventProvider { - attach(props?: ContainerAttachProps): Promise; +export interface IFluidContainer extends IEventProvider { + attach(props?: ContainerAttachProps): Promise; readonly attachState: AttachState; connect(): void; readonly connectionState: ConnectionStateType; diff --git a/packages/framework/fluid-framework/api-report/fluid-framework.legacy.alpha.api.md b/packages/framework/fluid-framework/api-report/fluid-framework.legacy.alpha.api.md index 48818d6435c5..0cf2c3d3e5c4 100644 --- a/packages/framework/fluid-framework/api-report/fluid-framework.legacy.alpha.api.md +++ b/packages/framework/fluid-framework/api-report/fluid-framework.legacy.alpha.api.md @@ -59,7 +59,7 @@ export namespace ConnectionStateType { export type ConnectionStateType = ConnectionStateType.Disconnected | ConnectionStateType.EstablishingConnection | ConnectionStateType.CatchingUp | ConnectionStateType.Connected; // @public -export type ContainerAttachProps = T; +export type ContainerAttachProps = AttachProps & T; // @public export interface ContainerSchema { @@ -379,8 +379,8 @@ export type IEventTransformer = TEvent extends { } ? TransformedEvent : TransformedEvent; // @public @sealed -export interface IFluidContainer extends IEventProvider { - attach(props?: ContainerAttachProps): Promise; +export interface IFluidContainer extends IEventProvider { + attach(props?: ContainerAttachProps): Promise; readonly attachState: AttachState; connect(): void; readonly connectionState: ConnectionStateType; diff --git a/packages/framework/fluid-framework/api-report/fluid-framework.legacy.public.api.md b/packages/framework/fluid-framework/api-report/fluid-framework.legacy.public.api.md index 942f56e42e4a..a359f00666dc 100644 --- a/packages/framework/fluid-framework/api-report/fluid-framework.legacy.public.api.md +++ b/packages/framework/fluid-framework/api-report/fluid-framework.legacy.public.api.md @@ -59,7 +59,7 @@ export namespace ConnectionStateType { export type ConnectionStateType = ConnectionStateType.Disconnected | ConnectionStateType.EstablishingConnection | ConnectionStateType.CatchingUp | ConnectionStateType.Connected; // @public -export type ContainerAttachProps = T; +export type ContainerAttachProps = AttachProps & T; // @public export interface ContainerSchema { @@ -369,8 +369,8 @@ export type IEventTransformer = TEvent extends { } ? TransformedEvent : TransformedEvent; // @public @sealed -export interface IFluidContainer extends IEventProvider { - attach(props?: ContainerAttachProps): Promise; +export interface IFluidContainer extends IEventProvider { + attach(props?: ContainerAttachProps): Promise; readonly attachState: AttachState; connect(): void; readonly connectionState: ConnectionStateType; diff --git a/packages/framework/fluid-framework/api-report/fluid-framework.public.api.md b/packages/framework/fluid-framework/api-report/fluid-framework.public.api.md index 605eb8fb4ec9..b82336ba2772 100644 --- a/packages/framework/fluid-framework/api-report/fluid-framework.public.api.md +++ b/packages/framework/fluid-framework/api-report/fluid-framework.public.api.md @@ -59,7 +59,7 @@ export namespace ConnectionStateType { export type ConnectionStateType = ConnectionStateType.Disconnected | ConnectionStateType.EstablishingConnection | ConnectionStateType.CatchingUp | ConnectionStateType.Connected; // @public -export type ContainerAttachProps = T; +export type ContainerAttachProps = AttachProps & T; // @public export interface ContainerSchema { @@ -341,8 +341,8 @@ export type IEventTransformer = TEvent extends { } ? TransformedEvent : TransformedEvent; // @public @sealed -export interface IFluidContainer extends IEventProvider { - attach(props?: ContainerAttachProps): Promise; +export interface IFluidContainer extends IEventProvider { + attach(props?: ContainerAttachProps): Promise; readonly attachState: AttachState; connect(): void; readonly connectionState: ConnectionStateType; diff --git a/packages/framework/fluid-static/api-report/fluid-static.alpha.api.md b/packages/framework/fluid-static/api-report/fluid-static.alpha.api.md index 3e583349f1a5..23cf44a75a07 100644 --- a/packages/framework/fluid-static/api-report/fluid-static.alpha.api.md +++ b/packages/framework/fluid-static/api-report/fluid-static.alpha.api.md @@ -4,11 +4,17 @@ ```ts +// @public (undocumented) +export interface AttachProps { + fileName: string | undefined; + filePath: string | undefined; +} + // @public export type CompatibilityMode = "1" | "2"; // @public -export type ContainerAttachProps = T; +export type ContainerAttachProps = AttachProps & T; // @public export interface ContainerSchema { @@ -23,8 +29,8 @@ export interface IConnection { } // @public @sealed -export interface IFluidContainer extends IEventProvider { - attach(props?: ContainerAttachProps): Promise; +export interface IFluidContainer extends IEventProvider { + attach(props?: ContainerAttachProps): Promise; readonly attachState: AttachState; connect(): void; readonly connectionState: ConnectionState; diff --git a/packages/framework/fluid-static/api-report/fluid-static.beta.api.md b/packages/framework/fluid-static/api-report/fluid-static.beta.api.md index d79be0f31535..592a89d8607d 100644 --- a/packages/framework/fluid-static/api-report/fluid-static.beta.api.md +++ b/packages/framework/fluid-static/api-report/fluid-static.beta.api.md @@ -4,11 +4,17 @@ ```ts +// @public (undocumented) +export interface AttachProps { + fileName: string | undefined; + filePath: string | undefined; +} + // @public export type CompatibilityMode = "1" | "2"; // @public -export type ContainerAttachProps = T; +export type ContainerAttachProps = AttachProps & T; // @public export interface ContainerSchema { @@ -23,8 +29,8 @@ export interface IConnection { } // @public @sealed -export interface IFluidContainer extends IEventProvider { - attach(props?: ContainerAttachProps): Promise; +export interface IFluidContainer extends IEventProvider { + attach(props?: ContainerAttachProps): Promise; readonly attachState: AttachState; connect(): void; readonly connectionState: ConnectionState; diff --git a/packages/framework/fluid-static/api-report/fluid-static.public.api.md b/packages/framework/fluid-static/api-report/fluid-static.public.api.md index 35d6cf0a0dc8..8b375e9627c3 100644 --- a/packages/framework/fluid-static/api-report/fluid-static.public.api.md +++ b/packages/framework/fluid-static/api-report/fluid-static.public.api.md @@ -4,11 +4,17 @@ ```ts +// @public (undocumented) +export interface AttachProps { + fileName: string | undefined; + filePath: string | undefined; +} + // @public export type CompatibilityMode = "1" | "2"; // @public -export type ContainerAttachProps = T; +export type ContainerAttachProps = AttachProps & T; // @public export interface ContainerSchema { @@ -23,8 +29,8 @@ export interface IConnection { } // @public @sealed -export interface IFluidContainer extends IEventProvider { - attach(props?: ContainerAttachProps): Promise; +export interface IFluidContainer extends IEventProvider { + attach(props?: ContainerAttachProps): Promise; readonly attachState: AttachState; connect(): void; readonly connectionState: ConnectionState; diff --git a/packages/framework/fluid-static/src/fluidContainer.ts b/packages/framework/fluid-static/src/fluidContainer.ts index 27620fccc445..3894acb8f875 100644 --- a/packages/framework/fluid-static/src/fluidContainer.ts +++ b/packages/framework/fluid-static/src/fluidContainer.ts @@ -106,8 +106,10 @@ export interface IFluidContainerEvents extends IEvent { * @sealed * @public */ -export interface IFluidContainer - extends IEventProvider { +export interface IFluidContainer< + TContainerSchema extends ContainerSchema = ContainerSchema, + TAttachProps extends object = object, +> extends IEventProvider { /** * Provides the current connected state of the container */ @@ -170,7 +172,7 @@ export interface IFluidContainer; + attach(props?: ContainerAttachProps): Promise; /** * Attempts to connect the container to the delta stream and process operations. diff --git a/packages/framework/fluid-static/src/index.ts b/packages/framework/fluid-static/src/index.ts index 4d9f853035a2..3032a4ac6262 100644 --- a/packages/framework/fluid-static/src/index.ts +++ b/packages/framework/fluid-static/src/index.ts @@ -20,6 +20,7 @@ export { export { createDOProviderContainerRuntimeFactory } from "./rootDataObject.js"; export { createServiceAudience } from "./serviceAudience.js"; export type { + AttachProps, CompatibilityMode, ContainerSchema, ContainerAttachProps, diff --git a/packages/framework/fluid-static/src/types.ts b/packages/framework/fluid-static/src/types.ts index 20e5e8f2f231..5a886b4024e6 100644 --- a/packages/framework/fluid-static/src/types.ts +++ b/packages/framework/fluid-static/src/types.ts @@ -45,11 +45,24 @@ export type LoadableObjectKind = | ISharedObjectKind | DataObjectKind; +// eslint-disable-next-line jsdoc/require-jsdoc +export interface AttachProps { + /** + * The file path where Fluid containers are created. If undefined, the file is created at the root. + */ + filePath: string | undefined; + + /** + * The file name of the Fluid file. If undefined, the file is named with a GUID. + */ + fileName: string | undefined; +} + /** * Represents properties that can be attached to a container. * @public */ -export type ContainerAttachProps = T; +export type ContainerAttachProps = AttachProps & T; /** * Declares the Fluid objects that will be available in the {@link IFluidContainer | Container}.