Skip to content

draft #24634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

draft #24634

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/dds/tree/api-report/tree.alpha.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,17 +421,17 @@ export namespace JsonAsTree {
}
const // @system
_APIExtractorWorkaroundObjectBase: TreeNodeSchemaClass<"com.fluidframework.json.object", NodeKind.Map, System_Unsafe.TreeMapNodeUnsafe<readonly [LeafSchema<"null", null>, 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>, LeafSchema<"boolean", boolean>> | null], any, undefined>;
[Symbol.iterator](): Iterator<[string, string | number | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | JsonObject | Array | null], any, undefined>;
} | {
readonly [x: string]: string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null;
readonly [x: string]: string | number | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, 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<typeof Primitive>;
// @system
export type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<typeof Array>;
const // @system
_APIExtractorWorkaroundArrayBase: TreeNodeSchemaClass<"com.fluidframework.json.array", NodeKind.Array, System_Unsafe.TreeArrayNodeUnsafe<readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.array", NodeKind.Array, unknown>, {
[Symbol.iterator](): Iterator<string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null, any, undefined>;
[Symbol.iterator](): Iterator<string | number | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, 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<typeof Tree>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export namespace ConnectionStateType {
export type ConnectionStateType = ConnectionStateType.Disconnected | ConnectionStateType.EstablishingConnection | ConnectionStateType.CatchingUp | ConnectionStateType.Connected;

// @public
export type ContainerAttachProps<T = unknown> = T;
export type ContainerAttachProps<T extends object = object> = AttachProps & T;

// @public
export interface ContainerSchema {
Expand Down Expand Up @@ -538,8 +538,8 @@ export type IEventTransformer<TThis, TEvent extends IEvent> = TEvent extends {
} ? TransformedEvent<TThis, E0, A0> : TransformedEvent<TThis, string, any[]>;

// @public @sealed
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps): Promise<string>;
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema, TAttachProps extends object = object> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps<TAttachProps>): Promise<string>;
readonly attachState: AttachState;
connect(): void;
readonly connectionState: ConnectionStateType;
Expand Down Expand Up @@ -760,17 +760,17 @@ export namespace JsonAsTree {
}
const // @system
_APIExtractorWorkaroundObjectBase: TreeNodeSchemaClass<"com.fluidframework.json.object", NodeKind.Map, System_Unsafe.TreeMapNodeUnsafe<readonly [LeafSchema<"null", null>, 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>, LeafSchema<"boolean", boolean>> | null], any, undefined>;
[Symbol.iterator](): Iterator<[string, string | number | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | JsonObject | Array | null], any, undefined>;
} | {
readonly [x: string]: string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null;
readonly [x: string]: string | number | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, 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<typeof Primitive>;
// @system
export type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<typeof Array>;
const // @system
_APIExtractorWorkaroundArrayBase: TreeNodeSchemaClass<"com.fluidframework.json.array", NodeKind.Array, System_Unsafe.TreeArrayNodeUnsafe<readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.array", NodeKind.Array, unknown>, {
[Symbol.iterator](): Iterator<string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null, any, undefined>;
[Symbol.iterator](): Iterator<string | number | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, 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<typeof Tree>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export namespace ConnectionStateType {
export type ConnectionStateType = ConnectionStateType.Disconnected | ConnectionStateType.EstablishingConnection | ConnectionStateType.CatchingUp | ConnectionStateType.Connected;

// @public
export type ContainerAttachProps<T = unknown> = T;
export type ContainerAttachProps<T extends object = object> = AttachProps & T;

// @public
export interface ContainerSchema {
Expand Down Expand Up @@ -341,8 +341,8 @@ export type IEventTransformer<TThis, TEvent extends IEvent> = TEvent extends {
} ? TransformedEvent<TThis, E0, A0> : TransformedEvent<TThis, string, any[]>;

// @public @sealed
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps): Promise<string>;
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema, TAttachProps extends object = object> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps<TAttachProps>): Promise<string>;
readonly attachState: AttachState;
connect(): void;
readonly connectionState: ConnectionStateType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export namespace ConnectionStateType {
export type ConnectionStateType = ConnectionStateType.Disconnected | ConnectionStateType.EstablishingConnection | ConnectionStateType.CatchingUp | ConnectionStateType.Connected;

// @public
export type ContainerAttachProps<T = unknown> = T;
export type ContainerAttachProps<T extends object = object> = AttachProps & T;

// @public
export interface ContainerSchema {
Expand Down Expand Up @@ -379,8 +379,8 @@ export type IEventTransformer<TThis, TEvent extends IEvent> = TEvent extends {
} ? TransformedEvent<TThis, E0, A0> : TransformedEvent<TThis, string, any[]>;

// @public @sealed
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps): Promise<string>;
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema, TAttachProps extends object = object> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps<TAttachProps>): Promise<string>;
readonly attachState: AttachState;
connect(): void;
readonly connectionState: ConnectionStateType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export namespace ConnectionStateType {
export type ConnectionStateType = ConnectionStateType.Disconnected | ConnectionStateType.EstablishingConnection | ConnectionStateType.CatchingUp | ConnectionStateType.Connected;

// @public
export type ContainerAttachProps<T = unknown> = T;
export type ContainerAttachProps<T extends object = object> = AttachProps & T;

// @public
export interface ContainerSchema {
Expand Down Expand Up @@ -369,8 +369,8 @@ export type IEventTransformer<TThis, TEvent extends IEvent> = TEvent extends {
} ? TransformedEvent<TThis, E0, A0> : TransformedEvent<TThis, string, any[]>;

// @public @sealed
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps): Promise<string>;
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema, TAttachProps extends object = object> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps<TAttachProps>): Promise<string>;
readonly attachState: AttachState;
connect(): void;
readonly connectionState: ConnectionStateType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export namespace ConnectionStateType {
export type ConnectionStateType = ConnectionStateType.Disconnected | ConnectionStateType.EstablishingConnection | ConnectionStateType.CatchingUp | ConnectionStateType.Connected;

// @public
export type ContainerAttachProps<T = unknown> = T;
export type ContainerAttachProps<T extends object = object> = AttachProps & T;

// @public
export interface ContainerSchema {
Expand Down Expand Up @@ -341,8 +341,8 @@ export type IEventTransformer<TThis, TEvent extends IEvent> = TEvent extends {
} ? TransformedEvent<TThis, E0, A0> : TransformedEvent<TThis, string, any[]>;

// @public @sealed
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps): Promise<string>;
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema, TAttachProps extends object = object> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps<TAttachProps>): Promise<string>;
readonly attachState: AttachState;
connect(): void;
readonly connectionState: ConnectionStateType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = unknown> = T;
export type ContainerAttachProps<T extends object = object> = AttachProps & T;

// @public
export interface ContainerSchema {
Expand All @@ -23,8 +29,8 @@ export interface IConnection {
}

// @public @sealed
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps): Promise<string>;
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema, TAttachProps extends object = object> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps<TAttachProps>): Promise<string>;
readonly attachState: AttachState;
connect(): void;
readonly connectionState: ConnectionState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = unknown> = T;
export type ContainerAttachProps<T extends object = object> = AttachProps & T;

// @public
export interface ContainerSchema {
Expand All @@ -23,8 +29,8 @@ export interface IConnection {
}

// @public @sealed
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps): Promise<string>;
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema, TAttachProps extends object = object> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps<TAttachProps>): Promise<string>;
readonly attachState: AttachState;
connect(): void;
readonly connectionState: ConnectionState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = unknown> = T;
export type ContainerAttachProps<T extends object = object> = AttachProps & T;

// @public
export interface ContainerSchema {
Expand All @@ -23,8 +29,8 @@ export interface IConnection {
}

// @public @sealed
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps): Promise<string>;
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema, TAttachProps extends object = object> extends IEventProvider<IFluidContainerEvents> {
attach(props?: ContainerAttachProps<TAttachProps>): Promise<string>;
readonly attachState: AttachState;
connect(): void;
readonly connectionState: ConnectionState;
Expand Down
8 changes: 5 additions & 3 deletions packages/framework/fluid-static/src/fluidContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ export interface IFluidContainerEvents extends IEvent {
* @sealed
* @public
*/
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema>
extends IEventProvider<IFluidContainerEvents> {
export interface IFluidContainer<
TContainerSchema extends ContainerSchema = ContainerSchema,
TAttachProps extends object = object,
> extends IEventProvider<IFluidContainerEvents> {
/**
* Provides the current connected state of the container
*/
Expand Down Expand Up @@ -170,7 +172,7 @@ export interface IFluidContainer<TContainerSchema extends ContainerSchema = Cont
*
* @returns A promise which resolves when the attach is complete, with the string identifier of the container.
*/
attach(props?: ContainerAttachProps): Promise<string>;
attach(props?: ContainerAttachProps<TAttachProps>): Promise<string>;

/**
* Attempts to connect the container to the delta stream and process operations.
Expand Down
1 change: 1 addition & 0 deletions packages/framework/fluid-static/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export {
export { createDOProviderContainerRuntimeFactory } from "./rootDataObject.js";
export { createServiceAudience } from "./serviceAudience.js";
export type {
AttachProps,
CompatibilityMode,
ContainerSchema,
ContainerAttachProps,
Expand Down
15 changes: 14 additions & 1 deletion packages/framework/fluid-static/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,24 @@ export type LoadableObjectKind<T extends IFluidLoadable = IFluidLoadable> =
| ISharedObjectKind<T>
| DataObjectKind<T>;

// 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 = unknown> = T;
export type ContainerAttachProps<T extends object = object> = AttachProps & T;

/**
* Declares the Fluid objects that will be available in the {@link IFluidContainer | Container}.
Expand Down
Loading