fluid-framework 2.3.0 → 2.4.0-294316
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/api-report/fluid-framework.alpha.api.md +21 -12
- package/api-report/fluid-framework.beta.api.md +14 -5
- package/api-report/fluid-framework.legacy.alpha.api.md +14 -5
- package/api-report/fluid-framework.legacy.public.api.md +14 -5
- package/api-report/fluid-framework.public.api.md +14 -5
- package/dist/alpha.d.ts +1 -0
- package/dist/beta.d.ts +1 -0
- package/dist/legacy.d.ts +1 -0
- package/dist/public.d.ts +1 -0
- package/lib/alpha.d.ts +1 -0
- package/lib/beta.d.ts +1 -0
- package/lib/legacy.d.ts +1 -0
- package/lib/public.d.ts +1 -0
- package/package.json +11 -11
|
@@ -89,21 +89,29 @@ export enum FieldKind {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
// @public
|
|
92
|
-
export interface FieldProps {
|
|
92
|
+
export interface FieldProps<TCustomMetadata = unknown> {
|
|
93
93
|
readonly defaultProvider?: DefaultProvider;
|
|
94
94
|
readonly key?: string;
|
|
95
|
+
readonly metadata?: FieldSchemaMetadata<TCustomMetadata>;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
// @public @sealed
|
|
98
|
-
export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes> {
|
|
99
|
+
export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, out TCustomMetadata = unknown> {
|
|
99
100
|
readonly allowedTypes: Types;
|
|
100
101
|
get allowedTypeSet(): ReadonlySet<TreeNodeSchema>;
|
|
101
102
|
readonly kind: Kind;
|
|
102
|
-
|
|
103
|
+
get metadata(): FieldSchemaMetadata<TCustomMetadata> | undefined;
|
|
104
|
+
readonly props?: FieldProps<TCustomMetadata> | undefined;
|
|
103
105
|
readonly requiresValue: boolean;
|
|
104
106
|
protected _typeCheck: MakeNominal;
|
|
105
107
|
}
|
|
106
108
|
|
|
109
|
+
// @public @sealed
|
|
110
|
+
export interface FieldSchemaMetadata<TCustomMetadata = unknown> {
|
|
111
|
+
custom?: TCustomMetadata;
|
|
112
|
+
description?: string | undefined;
|
|
113
|
+
}
|
|
114
|
+
|
|
107
115
|
// @public
|
|
108
116
|
export interface FieldSchemaUnsafe<out Kind extends FieldKind, out Types extends Unenforced<ImplicitAllowedTypes>> extends FieldSchema<Kind, any> {
|
|
109
117
|
readonly allowedTypes: Types;
|
|
@@ -537,15 +545,15 @@ export interface ITreeViewConfiguration<TSchema extends ImplicitFieldSchema = Im
|
|
|
537
545
|
|
|
538
546
|
// @alpha @sealed
|
|
539
547
|
export interface JsonArrayNodeSchema extends JsonNodeSchemaBase<NodeKind.Array, "array"> {
|
|
540
|
-
readonly items:
|
|
541
|
-
anyOf: JsonSchemaRef[];
|
|
542
|
-
};
|
|
548
|
+
readonly items: JsonFieldSchema;
|
|
543
549
|
}
|
|
544
550
|
|
|
545
551
|
// @alpha @sealed
|
|
546
|
-
export
|
|
552
|
+
export type JsonFieldSchema = {
|
|
553
|
+
readonly description?: string | undefined;
|
|
554
|
+
} & ({
|
|
547
555
|
readonly anyOf: JsonSchemaRef[];
|
|
548
|
-
}
|
|
556
|
+
} | JsonSchemaRef);
|
|
549
557
|
|
|
550
558
|
// @alpha @sealed
|
|
551
559
|
export interface JsonLeafNodeSchema extends JsonNodeSchemaBase<NodeKind.Leaf, JsonLeafSchemaType> {
|
|
@@ -593,9 +601,9 @@ export interface JsonSchemaRef {
|
|
|
593
601
|
export type JsonSchemaType = "object" | "array" | JsonLeafSchemaType;
|
|
594
602
|
|
|
595
603
|
// @alpha @sealed
|
|
596
|
-
export
|
|
604
|
+
export type JsonTreeSchema = JsonFieldSchema & {
|
|
597
605
|
readonly $defs: Record<JsonSchemaId, JsonNodeSchema>;
|
|
598
|
-
}
|
|
606
|
+
};
|
|
599
607
|
|
|
600
608
|
// @public
|
|
601
609
|
export type LazyItem<Item = unknown> = Item | (() => Item);
|
|
@@ -765,9 +773,9 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
765
773
|
readonly number: TreeNodeSchema<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
|
|
766
774
|
object<const Name extends TName, const T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
|
|
767
775
|
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & { readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>; } & { readonly [Property_1 in keyof T as FieldHasDefaultUnsafe<T[Property_1]> extends true ? Property_1 : never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property_1]> | undefined; }, false, T>;
|
|
768
|
-
optional<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps
|
|
776
|
+
optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
769
777
|
optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
|
|
770
|
-
required<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps
|
|
778
|
+
required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
771
779
|
requiredRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Required, T>;
|
|
772
780
|
// (undocumented)
|
|
773
781
|
readonly scope: TScope;
|
|
@@ -959,6 +967,7 @@ export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposab
|
|
|
959
967
|
initialize(content: InsertableTreeFieldFromImplicitField<TSchema>): void;
|
|
960
968
|
get root(): TreeFieldFromImplicitField<TSchema>;
|
|
961
969
|
set root(newRoot: InsertableTreeFieldFromImplicitField<TSchema>);
|
|
970
|
+
readonly schema: TSchema;
|
|
962
971
|
upgradeSchema(): void;
|
|
963
972
|
}
|
|
964
973
|
|
|
@@ -89,21 +89,29 @@ export enum FieldKind {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
// @public
|
|
92
|
-
export interface FieldProps {
|
|
92
|
+
export interface FieldProps<TCustomMetadata = unknown> {
|
|
93
93
|
readonly defaultProvider?: DefaultProvider;
|
|
94
94
|
readonly key?: string;
|
|
95
|
+
readonly metadata?: FieldSchemaMetadata<TCustomMetadata>;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
// @public @sealed
|
|
98
|
-
export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes> {
|
|
99
|
+
export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, out TCustomMetadata = unknown> {
|
|
99
100
|
readonly allowedTypes: Types;
|
|
100
101
|
get allowedTypeSet(): ReadonlySet<TreeNodeSchema>;
|
|
101
102
|
readonly kind: Kind;
|
|
102
|
-
|
|
103
|
+
get metadata(): FieldSchemaMetadata<TCustomMetadata> | undefined;
|
|
104
|
+
readonly props?: FieldProps<TCustomMetadata> | undefined;
|
|
103
105
|
readonly requiresValue: boolean;
|
|
104
106
|
protected _typeCheck: MakeNominal;
|
|
105
107
|
}
|
|
106
108
|
|
|
109
|
+
// @public @sealed
|
|
110
|
+
export interface FieldSchemaMetadata<TCustomMetadata = unknown> {
|
|
111
|
+
custom?: TCustomMetadata;
|
|
112
|
+
description?: string | undefined;
|
|
113
|
+
}
|
|
114
|
+
|
|
107
115
|
// @public
|
|
108
116
|
export interface FieldSchemaUnsafe<out Kind extends FieldKind, out Types extends Unenforced<ImplicitAllowedTypes>> extends FieldSchema<Kind, any> {
|
|
109
117
|
readonly allowedTypes: Types;
|
|
@@ -697,9 +705,9 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
697
705
|
readonly number: TreeNodeSchema<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
|
|
698
706
|
object<const Name extends TName, const T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
|
|
699
707
|
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & { readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>; } & { readonly [Property_1 in keyof T as FieldHasDefaultUnsafe<T[Property_1]> extends true ? Property_1 : never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property_1]> | undefined; }, false, T>;
|
|
700
|
-
optional<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps
|
|
708
|
+
optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
701
709
|
optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
|
|
702
|
-
required<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps
|
|
710
|
+
required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
703
711
|
requiredRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Required, T>;
|
|
704
712
|
// (undocumented)
|
|
705
713
|
readonly scope: TScope;
|
|
@@ -891,6 +899,7 @@ export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposab
|
|
|
891
899
|
initialize(content: InsertableTreeFieldFromImplicitField<TSchema>): void;
|
|
892
900
|
get root(): TreeFieldFromImplicitField<TSchema>;
|
|
893
901
|
set root(newRoot: InsertableTreeFieldFromImplicitField<TSchema>);
|
|
902
|
+
readonly schema: TSchema;
|
|
894
903
|
upgradeSchema(): void;
|
|
895
904
|
}
|
|
896
905
|
|
|
@@ -92,21 +92,29 @@ export enum FieldKind {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// @public
|
|
95
|
-
export interface FieldProps {
|
|
95
|
+
export interface FieldProps<TCustomMetadata = unknown> {
|
|
96
96
|
readonly defaultProvider?: DefaultProvider;
|
|
97
97
|
readonly key?: string;
|
|
98
|
+
readonly metadata?: FieldSchemaMetadata<TCustomMetadata>;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
// @public @sealed
|
|
101
|
-
export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes> {
|
|
102
|
+
export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, out TCustomMetadata = unknown> {
|
|
102
103
|
readonly allowedTypes: Types;
|
|
103
104
|
get allowedTypeSet(): ReadonlySet<TreeNodeSchema>;
|
|
104
105
|
readonly kind: Kind;
|
|
105
|
-
|
|
106
|
+
get metadata(): FieldSchemaMetadata<TCustomMetadata> | undefined;
|
|
107
|
+
readonly props?: FieldProps<TCustomMetadata> | undefined;
|
|
106
108
|
readonly requiresValue: boolean;
|
|
107
109
|
protected _typeCheck: MakeNominal;
|
|
108
110
|
}
|
|
109
111
|
|
|
112
|
+
// @public @sealed
|
|
113
|
+
export interface FieldSchemaMetadata<TCustomMetadata = unknown> {
|
|
114
|
+
custom?: TCustomMetadata;
|
|
115
|
+
description?: string | undefined;
|
|
116
|
+
}
|
|
117
|
+
|
|
110
118
|
// @public
|
|
111
119
|
export interface FieldSchemaUnsafe<out Kind extends FieldKind, out Types extends Unenforced<ImplicitAllowedTypes>> extends FieldSchema<Kind, any> {
|
|
112
120
|
readonly allowedTypes: Types;
|
|
@@ -998,9 +1006,9 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
998
1006
|
readonly number: TreeNodeSchema<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
|
|
999
1007
|
object<const Name extends TName, const T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
|
|
1000
1008
|
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & { readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>; } & { readonly [Property_1 in keyof T as FieldHasDefaultUnsafe<T[Property_1]> extends true ? Property_1 : never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property_1]> | undefined; }, false, T>;
|
|
1001
|
-
optional<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps
|
|
1009
|
+
optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
1002
1010
|
optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
|
|
1003
|
-
required<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps
|
|
1011
|
+
required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
1004
1012
|
requiredRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Required, T>;
|
|
1005
1013
|
// (undocumented)
|
|
1006
1014
|
readonly scope: TScope;
|
|
@@ -1273,6 +1281,7 @@ export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposab
|
|
|
1273
1281
|
initialize(content: InsertableTreeFieldFromImplicitField<TSchema>): void;
|
|
1274
1282
|
get root(): TreeFieldFromImplicitField<TSchema>;
|
|
1275
1283
|
set root(newRoot: InsertableTreeFieldFromImplicitField<TSchema>);
|
|
1284
|
+
readonly schema: TSchema;
|
|
1276
1285
|
upgradeSchema(): void;
|
|
1277
1286
|
}
|
|
1278
1287
|
|
|
@@ -89,21 +89,29 @@ export enum FieldKind {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
// @public
|
|
92
|
-
export interface FieldProps {
|
|
92
|
+
export interface FieldProps<TCustomMetadata = unknown> {
|
|
93
93
|
readonly defaultProvider?: DefaultProvider;
|
|
94
94
|
readonly key?: string;
|
|
95
|
+
readonly metadata?: FieldSchemaMetadata<TCustomMetadata>;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
// @public @sealed
|
|
98
|
-
export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes> {
|
|
99
|
+
export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, out TCustomMetadata = unknown> {
|
|
99
100
|
readonly allowedTypes: Types;
|
|
100
101
|
get allowedTypeSet(): ReadonlySet<TreeNodeSchema>;
|
|
101
102
|
readonly kind: Kind;
|
|
102
|
-
|
|
103
|
+
get metadata(): FieldSchemaMetadata<TCustomMetadata> | undefined;
|
|
104
|
+
readonly props?: FieldProps<TCustomMetadata> | undefined;
|
|
103
105
|
readonly requiresValue: boolean;
|
|
104
106
|
protected _typeCheck: MakeNominal;
|
|
105
107
|
}
|
|
106
108
|
|
|
109
|
+
// @public @sealed
|
|
110
|
+
export interface FieldSchemaMetadata<TCustomMetadata = unknown> {
|
|
111
|
+
custom?: TCustomMetadata;
|
|
112
|
+
description?: string | undefined;
|
|
113
|
+
}
|
|
114
|
+
|
|
107
115
|
// @public
|
|
108
116
|
export interface FieldSchemaUnsafe<out Kind extends FieldKind, out Types extends Unenforced<ImplicitAllowedTypes>> extends FieldSchema<Kind, any> {
|
|
109
117
|
readonly allowedTypes: Types;
|
|
@@ -728,9 +736,9 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
728
736
|
readonly number: TreeNodeSchema<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
|
|
729
737
|
object<const Name extends TName, const T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
|
|
730
738
|
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & { readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>; } & { readonly [Property_1 in keyof T as FieldHasDefaultUnsafe<T[Property_1]> extends true ? Property_1 : never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property_1]> | undefined; }, false, T>;
|
|
731
|
-
optional<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps
|
|
739
|
+
optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
732
740
|
optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
|
|
733
|
-
required<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps
|
|
741
|
+
required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
734
742
|
requiredRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Required, T>;
|
|
735
743
|
// (undocumented)
|
|
736
744
|
readonly scope: TScope;
|
|
@@ -916,6 +924,7 @@ export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposab
|
|
|
916
924
|
initialize(content: InsertableTreeFieldFromImplicitField<TSchema>): void;
|
|
917
925
|
get root(): TreeFieldFromImplicitField<TSchema>;
|
|
918
926
|
set root(newRoot: InsertableTreeFieldFromImplicitField<TSchema>);
|
|
927
|
+
readonly schema: TSchema;
|
|
919
928
|
upgradeSchema(): void;
|
|
920
929
|
}
|
|
921
930
|
|
|
@@ -89,21 +89,29 @@ export enum FieldKind {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
// @public
|
|
92
|
-
export interface FieldProps {
|
|
92
|
+
export interface FieldProps<TCustomMetadata = unknown> {
|
|
93
93
|
readonly defaultProvider?: DefaultProvider;
|
|
94
94
|
readonly key?: string;
|
|
95
|
+
readonly metadata?: FieldSchemaMetadata<TCustomMetadata>;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
// @public @sealed
|
|
98
|
-
export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes> {
|
|
99
|
+
export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, out TCustomMetadata = unknown> {
|
|
99
100
|
readonly allowedTypes: Types;
|
|
100
101
|
get allowedTypeSet(): ReadonlySet<TreeNodeSchema>;
|
|
101
102
|
readonly kind: Kind;
|
|
102
|
-
|
|
103
|
+
get metadata(): FieldSchemaMetadata<TCustomMetadata> | undefined;
|
|
104
|
+
readonly props?: FieldProps<TCustomMetadata> | undefined;
|
|
103
105
|
readonly requiresValue: boolean;
|
|
104
106
|
protected _typeCheck: MakeNominal;
|
|
105
107
|
}
|
|
106
108
|
|
|
109
|
+
// @public @sealed
|
|
110
|
+
export interface FieldSchemaMetadata<TCustomMetadata = unknown> {
|
|
111
|
+
custom?: TCustomMetadata;
|
|
112
|
+
description?: string | undefined;
|
|
113
|
+
}
|
|
114
|
+
|
|
107
115
|
// @public
|
|
108
116
|
export interface FieldSchemaUnsafe<out Kind extends FieldKind, out Types extends Unenforced<ImplicitAllowedTypes>> extends FieldSchema<Kind, any> {
|
|
109
117
|
readonly allowedTypes: Types;
|
|
@@ -692,9 +700,9 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
692
700
|
readonly number: TreeNodeSchema<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
|
|
693
701
|
object<const Name extends TName, const T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
|
|
694
702
|
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & { readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>; } & { readonly [Property_1 in keyof T as FieldHasDefaultUnsafe<T[Property_1]> extends true ? Property_1 : never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property_1]> | undefined; }, false, T>;
|
|
695
|
-
optional<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps
|
|
703
|
+
optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
696
704
|
optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
|
|
697
|
-
required<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps
|
|
705
|
+
required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
698
706
|
requiredRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Required, T>;
|
|
699
707
|
// (undocumented)
|
|
700
708
|
readonly scope: TScope;
|
|
@@ -876,6 +884,7 @@ export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposab
|
|
|
876
884
|
initialize(content: InsertableTreeFieldFromImplicitField<TSchema>): void;
|
|
877
885
|
get root(): TreeFieldFromImplicitField<TSchema>;
|
|
878
886
|
set root(newRoot: InsertableTreeFieldFromImplicitField<TSchema>);
|
|
887
|
+
readonly schema: TSchema;
|
|
879
888
|
upgradeSchema(): void;
|
|
880
889
|
}
|
|
881
890
|
|
package/dist/alpha.d.ts
CHANGED
package/dist/beta.d.ts
CHANGED
package/dist/legacy.d.ts
CHANGED
package/dist/public.d.ts
CHANGED
package/lib/alpha.d.ts
CHANGED
package/lib/beta.d.ts
CHANGED
package/lib/legacy.d.ts
CHANGED
package/lib/public.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fluid-framework",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0-294316",
|
|
4
4
|
"description": "The main entry point into Fluid Framework public packages",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
"main": "lib/index.js",
|
|
58
58
|
"types": "lib/public.d.ts",
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@fluidframework/container-definitions": "
|
|
61
|
-
"@fluidframework/container-loader": "
|
|
62
|
-
"@fluidframework/core-interfaces": "
|
|
63
|
-
"@fluidframework/driver-definitions": "
|
|
64
|
-
"@fluidframework/fluid-static": "
|
|
65
|
-
"@fluidframework/map": "
|
|
66
|
-
"@fluidframework/runtime-utils": "
|
|
67
|
-
"@fluidframework/sequence": "
|
|
68
|
-
"@fluidframework/shared-object-base": "
|
|
69
|
-
"@fluidframework/tree": "
|
|
60
|
+
"@fluidframework/container-definitions": "2.4.0-294316",
|
|
61
|
+
"@fluidframework/container-loader": "2.4.0-294316",
|
|
62
|
+
"@fluidframework/core-interfaces": "2.4.0-294316",
|
|
63
|
+
"@fluidframework/driver-definitions": "2.4.0-294316",
|
|
64
|
+
"@fluidframework/fluid-static": "2.4.0-294316",
|
|
65
|
+
"@fluidframework/map": "2.4.0-294316",
|
|
66
|
+
"@fluidframework/runtime-utils": "2.4.0-294316",
|
|
67
|
+
"@fluidframework/sequence": "2.4.0-294316",
|
|
68
|
+
"@fluidframework/shared-object-base": "2.4.0-294316",
|
|
69
|
+
"@fluidframework/tree": "2.4.0-294316"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@arethetypeswrong/cli": "^0.15.2",
|