fluid-framework 2.12.0 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +140 -0
- package/api-report/fluid-framework.alpha.api.md +97 -15
- package/api-report/fluid-framework.beta.api.md +22 -10
- package/api-report/fluid-framework.legacy.alpha.api.md +22 -11
- package/api-report/fluid-framework.legacy.public.api.md +22 -10
- package/api-report/fluid-framework.public.api.md +22 -10
- package/dist/alpha.d.ts +14 -0
- package/dist/beta.d.ts +2 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +2 -0
- package/dist/package.json +2 -1
- package/dist/public.d.ts +2 -0
- package/lib/alpha.d.ts +14 -0
- package/lib/beta.d.ts +2 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +2 -0
- package/lib/public.d.ts +2 -0
- package/package.json +11 -11
- package/src/index.ts +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,145 @@
|
|
|
1
1
|
# fluid-framework
|
|
2
2
|
|
|
3
|
+
## 2.20.0
|
|
4
|
+
|
|
5
|
+
Dependency updates only.
|
|
6
|
+
|
|
7
|
+
## 2.13.0
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- Metadata can be associated with Node Schema ([#23321](https://github.com/microsoft/FluidFramework/pull/23321)) [58619c3c4e](https://github.com/microsoft/FluidFramework/commit/58619c3c4ee55ca1497a117321ae0b364e6084e6)
|
|
12
|
+
|
|
13
|
+
Users of TreeView can now specify metadata when creating Node Schema, via `SchemaFactoryAlpha`.
|
|
14
|
+
This metadata may include system-understood properties like `description`.
|
|
15
|
+
|
|
16
|
+
Example:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
const schemaFactory = new SchemaFactoryAlpha(...);
|
|
20
|
+
class Point extends schemaFactory.object("Point", {
|
|
21
|
+
x: schemaFactory.required(schemaFactory.number),
|
|
22
|
+
y: schemaFactory.required(schemaFactory.number),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
metadata: {
|
|
26
|
+
description: "A point in 2D space",
|
|
27
|
+
},
|
|
28
|
+
}) {}
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Functionality like the experimental conversion of Tree Schema to [JSON Schema](https://json-schema.org/) ([getJsonSchema](https://github.com/microsoft/FluidFramework/releases/tag/client_v2.4.0#user-content-metadata-can-now-be-associated-with-field-schema-22564)) leverages such system-understood metadata to generate useful information.
|
|
33
|
+
In the case of the `description` property, it is mapped directly to the `description` property supported by JSON Schema.
|
|
34
|
+
|
|
35
|
+
Custom, user-defined properties can also be specified.
|
|
36
|
+
These properties will not be used by the system by default, but can be used to associate common application-specific properties with Node Schema.
|
|
37
|
+
|
|
38
|
+
#### `SchemaFactoryAlpha` Updates
|
|
39
|
+
|
|
40
|
+
- `object` and `objectRecursive`, `arrayRecursive`, and `mapRecursive` now support `metadata` in their `options` parameter.
|
|
41
|
+
- (new) `arrayAlpha` - Variant of `array` that accepts an options parameter which supports `metadata`
|
|
42
|
+
- (new) `mapAlpha` - Variant of `map` that accepts an options parameter which supports `metadata`
|
|
43
|
+
|
|
44
|
+
#### Example
|
|
45
|
+
|
|
46
|
+
An application is implementing search functionality.
|
|
47
|
+
By default, the app author wishes for all app content to be potentially indexable by search, unless otherwise specified.
|
|
48
|
+
They can leverage schema metadata to decorate types of nodes that should be ignored by search, and leverage that information when walking the tree during a search.
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
|
|
52
|
+
interface AppMetadata {
|
|
53
|
+
/**
|
|
54
|
+
* Whether or not nodes of this type should be ignored by search.
|
|
55
|
+
* @defaultValue `false`
|
|
56
|
+
*/
|
|
57
|
+
searchIgnore?: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const schemaFactory = new SchemaFactoryAlpha(...);
|
|
61
|
+
class Point extends schemaFactory.object("Point", {
|
|
62
|
+
x: schemaFactory.required(schemaFactory.number),
|
|
63
|
+
y: schemaFactory.required(schemaFactory.number),
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
metadata: {
|
|
67
|
+
description: "A point in 2D space",
|
|
68
|
+
custom: {
|
|
69
|
+
searchIgnore: true,
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
}) {}
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Search can then be implemented to look for the appropriate metadata, and leverage it to omit the unwanted position data from search.
|
|
77
|
+
|
|
78
|
+
#### Potential for breaking existing code
|
|
79
|
+
|
|
80
|
+
These changes add the new property "metadata" to the base type from which all node schema derive.
|
|
81
|
+
If you have existing node schema subclasses that include a property of this name, there is a chance for potential conflict here that could be breaking.
|
|
82
|
+
If you encounter issues here, consider renaming your property or leveraging the new metadata support.
|
|
83
|
+
|
|
84
|
+
- New alpha APIs for schema evolution ([#23362](https://github.com/microsoft/FluidFramework/pull/23362)) [2406e00efe](https://github.com/microsoft/FluidFramework/commit/2406e00efed282be58a9e09cb3478c9a9d170ef0)
|
|
85
|
+
|
|
86
|
+
There are now `@alpha` APIs for schema evolution which support adding optional fields to object node types without a staged rollout.
|
|
87
|
+
|
|
88
|
+
SharedTree has many safety checks in place to ensure applications understand the format of documents they must support.
|
|
89
|
+
One of these checks verifies that the view schema (defined in application's code) aligns with the document schema (determined by the document data at rest).
|
|
90
|
+
This helps to ensure that clients running incompatible versions of the application's code don't collaborate at the same time on some document, which could cause data loss or disrupt application invariants.
|
|
91
|
+
One general solution application authors can perform is to stage the rollout of a feature which changes document schema into multiple phases:
|
|
92
|
+
|
|
93
|
+
1. Release an application version which understands documents written with the new format but doesn't attempt to upgrade any documents
|
|
94
|
+
2. Wait for this application version to saturate in the app's ecosystem
|
|
95
|
+
3. Release an application version which upgrades documents to start leveraging the new format.
|
|
96
|
+
|
|
97
|
+
However, this process can be cumbersome for application authors: for many types of changes, an app author doesn't particularly care if older application code collaborates with newer code, as the only downside is that the older application version might not present a fully faithful experience.
|
|
98
|
+
As an example, consider an application which renders circles on a canvas (similar to what is presented [here](https://github.com/microsoft/FluidFramework/blob/main/packages/dds/tree/docs/user-facing/schema-evolution.md)).
|
|
99
|
+
The application author might anticipate adding support to render the circle with various different other properties (border style, border width, background color, varying radius, etc.).
|
|
100
|
+
Therefore, they should declare their schema using `SchemaFactoryObjectOptions.allowUnknownOptionalFields` like so:
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import { SchemaFactoryAlpha } from "@fluidframework/tree/alpha";
|
|
104
|
+
// "Old" application code/schema
|
|
105
|
+
const factory = new SchemaFactoryAlpha("Geometry");
|
|
106
|
+
class Circle extends factory.object(
|
|
107
|
+
"Circle",
|
|
108
|
+
{
|
|
109
|
+
x: factory.number,
|
|
110
|
+
y: factory.number,
|
|
111
|
+
},
|
|
112
|
+
{ allowUnknownOptionalFields: true },
|
|
113
|
+
) {}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Later, they add some of these features to their application:
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import { SchemaFactoryAlpha } from "@fluidframework/tree/alpha";
|
|
120
|
+
// "New" application code/schema
|
|
121
|
+
const factory = new SchemaFactoryAlpha("Geometry");
|
|
122
|
+
class Circle extends factory.object(
|
|
123
|
+
"Circle",
|
|
124
|
+
{
|
|
125
|
+
x: factory.number,
|
|
126
|
+
y: factory.number,
|
|
127
|
+
// Note that radius and color must both be declared as optional fields since this application must
|
|
128
|
+
// support opening up existing documents that didn't have this information.
|
|
129
|
+
radius: factory.optional(factory.number),
|
|
130
|
+
color: factory.optional(factory.string), // ex: #00FF00
|
|
131
|
+
},
|
|
132
|
+
{ allowUnknownOptionalFields: true },
|
|
133
|
+
) {}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
When they go to deploy this newer version of the application, they could opt to start upgrading documents as soon as the newer code is rolled out, and the older code would still be able to open up (and collaborate on) documents using the newer schema version.
|
|
137
|
+
Note that it's only important that the old _application code_ elected to allow opening documents with unknown optional fields.
|
|
138
|
+
This policy is not persisted into documents in any form, so applications are free to modify it at any point.
|
|
139
|
+
|
|
140
|
+
For specific API details, see documentation on `SchemaFactoryObjectOptions.allowUnknownOptionalFields`.
|
|
141
|
+
For a more thorough discussion of this topic, see [Schema Evolvability](https://github.com/microsoft/FluidFramework/tree/main/packages/dds/tree#schema-evolvability) in the SharedTree README.
|
|
142
|
+
|
|
3
143
|
## 2.12.0
|
|
4
144
|
|
|
5
145
|
Dependency updates only.
|
|
@@ -238,13 +238,19 @@ export interface ForestOptions {
|
|
|
238
238
|
readonly forest?: ForestType;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
// @alpha
|
|
242
|
-
export
|
|
243
|
-
Expensive = 2,
|
|
244
|
-
Optimized = 1,
|
|
245
|
-
Reference = 0
|
|
241
|
+
// @alpha @sealed
|
|
242
|
+
export interface ForestType extends ErasedType<"ForestType"> {
|
|
246
243
|
}
|
|
247
244
|
|
|
245
|
+
// @alpha
|
|
246
|
+
export const ForestTypeExpensiveDebug: ForestType;
|
|
247
|
+
|
|
248
|
+
// @alpha
|
|
249
|
+
export const ForestTypeOptimized: ForestType;
|
|
250
|
+
|
|
251
|
+
// @alpha
|
|
252
|
+
export const ForestTypeReference: ForestType;
|
|
253
|
+
|
|
248
254
|
// @alpha @deprecated
|
|
249
255
|
export function getBranch(tree: ITree): BranchableTree;
|
|
250
256
|
|
|
@@ -735,6 +741,7 @@ export type JsonNodeSchema = JsonLeafNodeSchema | JsonMapNodeSchema | JsonArrayN
|
|
|
735
741
|
|
|
736
742
|
// @alpha @sealed
|
|
737
743
|
export interface JsonNodeSchemaBase<TNodeKind extends NodeKind, TJsonSchemaType extends JsonSchemaType> {
|
|
744
|
+
readonly description?: string | undefined;
|
|
738
745
|
readonly _treeNodeSchemaKind: TNodeKind;
|
|
739
746
|
readonly type: TJsonSchemaType;
|
|
740
747
|
}
|
|
@@ -832,6 +839,17 @@ export enum NodeKind {
|
|
|
832
839
|
Object = 2
|
|
833
840
|
}
|
|
834
841
|
|
|
842
|
+
// @public @sealed
|
|
843
|
+
export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
844
|
+
readonly custom?: TCustomMetadata | undefined;
|
|
845
|
+
readonly description?: string | undefined;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
// @public @sealed
|
|
849
|
+
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
850
|
+
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
851
|
+
}
|
|
852
|
+
|
|
835
853
|
// @alpha
|
|
836
854
|
export const noopValidator: JsonValidator;
|
|
837
855
|
|
|
@@ -947,6 +965,11 @@ export interface RunTransaction {
|
|
|
947
965
|
readonly rollback: typeof rollback;
|
|
948
966
|
}
|
|
949
967
|
|
|
968
|
+
// @alpha
|
|
969
|
+
export interface RunTransactionParams {
|
|
970
|
+
readonly preconditions?: readonly TransactionConstraint[];
|
|
971
|
+
}
|
|
972
|
+
|
|
950
973
|
// @public @sealed
|
|
951
974
|
export interface SchemaCompatibilityStatus {
|
|
952
975
|
readonly canInitialize: boolean;
|
|
@@ -964,8 +987,8 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
964
987
|
arrayRecursive<const Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array, unknown>, {
|
|
965
988
|
[Symbol.iterator](): Iterator<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
966
989
|
}, false, T, undefined>;
|
|
967
|
-
readonly boolean: TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean, true, unknown, never>;
|
|
968
|
-
readonly handle: TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never>;
|
|
990
|
+
readonly boolean: TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>;
|
|
991
|
+
readonly handle: TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never, unknown>;
|
|
969
992
|
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
970
993
|
map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchemaNonClass<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map>, MapNodeInsertableData<T>, true, T, undefined>;
|
|
971
994
|
map<Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>, MapNodeInsertableData<T>, true, T, undefined>;
|
|
@@ -977,16 +1000,40 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
977
1000
|
} | {
|
|
978
1001
|
readonly [x: string]: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
|
|
979
1002
|
}, false, T, undefined>;
|
|
980
|
-
readonly null: TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null, true, unknown, never>;
|
|
981
|
-
readonly number: TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number, true, unknown, never>;
|
|
1003
|
+
readonly null: TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null, true, unknown, never, unknown>;
|
|
1004
|
+
readonly number: TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number, true, unknown, never, unknown>;
|
|
982
1005
|
object<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
|
|
983
|
-
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveStringRecord<ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object &
|
|
1006
|
+
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveStringRecord<ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordUnsafe<T>, false, T>;
|
|
984
1007
|
optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
985
1008
|
optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
|
|
986
1009
|
required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
987
1010
|
requiredRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Required, T>;
|
|
988
1011
|
readonly scope: TScope;
|
|
989
|
-
readonly string: TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string, true, unknown, never>;
|
|
1012
|
+
readonly string: TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string, true, unknown, never, unknown>;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// @alpha
|
|
1016
|
+
export class SchemaFactoryAlpha<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactory<TScope, TName> {
|
|
1017
|
+
arrayAlpha<const Name extends TName, const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array>, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>, true, T, undefined, TCustomMetadata>;
|
|
1018
|
+
arrayRecursive<const Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array, unknown>, {
|
|
1019
|
+
[Symbol.iterator](): Iterator<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
1020
|
+
}, false, T, undefined, TCustomMetadata>;
|
|
1021
|
+
mapAlpha<Name extends TName, const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>, MapNodeInsertableData<T>, true, T, undefined, TCustomMetadata>;
|
|
1022
|
+
mapRecursive<Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map, unknown>, {
|
|
1023
|
+
[Symbol.iterator](): Iterator<[
|
|
1024
|
+
string,
|
|
1025
|
+
InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>
|
|
1026
|
+
]>;
|
|
1027
|
+
} | {
|
|
1028
|
+
readonly [x: string]: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
|
|
1029
|
+
}, false, T, undefined, TCustomMetadata>;
|
|
1030
|
+
object<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>, const TCustomMetadata = unknown>(name: Name, fields: T, options?: SchemaFactoryObjectOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T, never, TCustomMetadata>;
|
|
1031
|
+
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveStringRecord<ImplicitFieldSchema>>, const TCustomMetadata = unknown>(name: Name, t: T, options?: SchemaFactoryObjectOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordUnsafe<T>, false, T, never, TCustomMetadata>;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
// @alpha
|
|
1035
|
+
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
|
|
1036
|
+
allowUnknownOptionalFields?: boolean;
|
|
990
1037
|
}
|
|
991
1038
|
|
|
992
1039
|
// @alpha
|
|
@@ -1043,9 +1090,38 @@ export interface Tagged<V, T extends string = string> {
|
|
|
1043
1090
|
// @public
|
|
1044
1091
|
export type TelemetryBaseEventPropertyType = string | number | boolean | undefined;
|
|
1045
1092
|
|
|
1093
|
+
// @alpha
|
|
1094
|
+
export type TransactionCallbackStatus<TSuccessValue, TFailureValue> = ({
|
|
1095
|
+
rollback?: false;
|
|
1096
|
+
value: TSuccessValue;
|
|
1097
|
+
} | {
|
|
1098
|
+
rollback: true;
|
|
1099
|
+
value: TFailureValue;
|
|
1100
|
+
}) & {
|
|
1101
|
+
preconditionsOnRevert?: readonly TransactionConstraint[];
|
|
1102
|
+
};
|
|
1103
|
+
|
|
1046
1104
|
// @public
|
|
1047
1105
|
export type TransactionConstraint = NodeInDocumentConstraint;
|
|
1048
1106
|
|
|
1107
|
+
// @alpha
|
|
1108
|
+
export type TransactionResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
|
|
1109
|
+
|
|
1110
|
+
// @alpha
|
|
1111
|
+
export type TransactionResultExt<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
|
|
1112
|
+
|
|
1113
|
+
// @alpha
|
|
1114
|
+
export interface TransactionResultFailed<TFailureValue> {
|
|
1115
|
+
success: false;
|
|
1116
|
+
value: TFailureValue;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
// @alpha
|
|
1120
|
+
export interface TransactionResultSuccess<TSuccessValue> {
|
|
1121
|
+
success: true;
|
|
1122
|
+
value: TSuccessValue;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1049
1125
|
// @public
|
|
1050
1126
|
export type TransformedEvent<TThis, E, A extends any[]> = (event: E, listener: (...args: ReplaceIEventThisPlaceHolder<A, TThis>) => void) => TThis;
|
|
1051
1127
|
|
|
@@ -1218,10 +1294,10 @@ export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedType
|
|
|
1218
1294
|
type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends TreeNodeSchemaUnsafe ? NodeFromSchemaUnsafe<TSchema> : TSchema extends AllowedTypesUnsafe ? NodeFromSchemaUnsafe<FlexListToUnion<TSchema>> : unknown;
|
|
1219
1295
|
|
|
1220
1296
|
// @public @sealed
|
|
1221
|
-
export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown> = (TNode extends TreeNode ? TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info> : never) | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>;
|
|
1297
|
+
export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TCustomMetadata = unknown> = (TNode extends TreeNode ? TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info, never, TCustomMetadata> : never) | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info, never, TCustomMetadata>;
|
|
1222
1298
|
|
|
1223
1299
|
// @public @sealed
|
|
1224
|
-
export type TreeNodeSchemaClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode = TreeNode, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable> & (undefined extends TConstructorExtra ? {
|
|
1300
|
+
export type TreeNodeSchemaClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode = TreeNode, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never, TCustomMetadata = unknown> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable, TCustomMetadata> & (undefined extends TConstructorExtra ? {
|
|
1225
1301
|
new (data?: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;
|
|
1226
1302
|
} : {
|
|
1227
1303
|
new (data: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;
|
|
@@ -1234,7 +1310,7 @@ export interface TreeNodeSchemaClassUnsafe<out Name extends string, out Kind ext
|
|
|
1234
1310
|
}
|
|
1235
1311
|
|
|
1236
1312
|
// @public @sealed
|
|
1237
|
-
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown, out TInsertable = never> {
|
|
1313
|
+
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown, out TInsertable = never, out TCustomMetadata = unknown> {
|
|
1238
1314
|
readonly childTypes: ReadonlySet<TreeNodeSchema>;
|
|
1239
1315
|
// @sealed
|
|
1240
1316
|
createFromInsertable(data: TInsertable): Unhydrated<TreeNode | TreeLeafValue>;
|
|
@@ -1243,10 +1319,11 @@ export interface TreeNodeSchemaCore<out Name extends string, out Kind extends No
|
|
|
1243
1319
|
readonly info: Info;
|
|
1244
1320
|
// (undocumented)
|
|
1245
1321
|
readonly kind: Kind;
|
|
1322
|
+
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
1246
1323
|
}
|
|
1247
1324
|
|
|
1248
1325
|
// @public @sealed
|
|
1249
|
-
export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable> & (undefined extends TConstructorExtra ? {
|
|
1326
|
+
export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never, TCustomMetadata = unknown> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable, TCustomMetadata> & (undefined extends TConstructorExtra ? {
|
|
1250
1327
|
create(data?: TInsertable | TConstructorExtra): TNode;
|
|
1251
1328
|
} : {
|
|
1252
1329
|
create(data: TInsertable | TConstructorExtra): TNode;
|
|
@@ -1297,6 +1374,8 @@ export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | Unsa
|
|
|
1297
1374
|
// (undocumented)
|
|
1298
1375
|
get root(): ReadableField<TSchema>;
|
|
1299
1376
|
set root(newRoot: InsertableField<TSchema>);
|
|
1377
|
+
runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>, params?: RunTransactionParams): TransactionResultExt<TSuccessValue, TFailureValue>;
|
|
1378
|
+
runTransaction(transaction: () => VoidTransactionCallbackStatus | void, params?: RunTransactionParams): TransactionResult;
|
|
1300
1379
|
}
|
|
1301
1380
|
|
|
1302
1381
|
// @public @sealed
|
|
@@ -1377,6 +1456,9 @@ export interface ViewContent {
|
|
|
1377
1456
|
readonly tree: JsonCompatible<IFluidHandle>;
|
|
1378
1457
|
}
|
|
1379
1458
|
|
|
1459
|
+
// @alpha
|
|
1460
|
+
export type VoidTransactionCallbackStatus = Omit<TransactionCallbackStatus<unknown, unknown>, "value">;
|
|
1461
|
+
|
|
1380
1462
|
// @public @sealed
|
|
1381
1463
|
export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind, out TInfo = unknown> {
|
|
1382
1464
|
// @deprecated
|
|
@@ -619,6 +619,17 @@ export enum NodeKind {
|
|
|
619
619
|
Object = 2
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
+
// @public @sealed
|
|
623
|
+
export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
624
|
+
readonly custom?: TCustomMetadata | undefined;
|
|
625
|
+
readonly description?: string | undefined;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
// @public @sealed
|
|
629
|
+
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
630
|
+
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
631
|
+
}
|
|
632
|
+
|
|
622
633
|
// @public
|
|
623
634
|
type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = {
|
|
624
635
|
-readonly [Property in keyof T]: Property extends string ? TreeFieldFromImplicitField<T[Property]> : unknown;
|
|
@@ -723,8 +734,8 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
723
734
|
arrayRecursive<const Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array, unknown>, {
|
|
724
735
|
[Symbol.iterator](): Iterator<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
725
736
|
}, false, T, undefined>;
|
|
726
|
-
readonly boolean: TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean, true, unknown, never>;
|
|
727
|
-
readonly handle: TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never>;
|
|
737
|
+
readonly boolean: TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>;
|
|
738
|
+
readonly handle: TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never, unknown>;
|
|
728
739
|
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
729
740
|
map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchemaNonClass<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map>, MapNodeInsertableData<T>, true, T, undefined>;
|
|
730
741
|
map<Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>, MapNodeInsertableData<T>, true, T, undefined>;
|
|
@@ -736,16 +747,16 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
736
747
|
} | {
|
|
737
748
|
readonly [x: string]: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
|
|
738
749
|
}, false, T, undefined>;
|
|
739
|
-
readonly null: TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null, true, unknown, never>;
|
|
740
|
-
readonly number: TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number, true, unknown, never>;
|
|
750
|
+
readonly null: TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null, true, unknown, never, unknown>;
|
|
751
|
+
readonly number: TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number, true, unknown, never, unknown>;
|
|
741
752
|
object<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
|
|
742
|
-
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveStringRecord<ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object &
|
|
753
|
+
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveStringRecord<ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordUnsafe<T>, false, T>;
|
|
743
754
|
optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
744
755
|
optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
|
|
745
756
|
required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
746
757
|
requiredRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Required, T>;
|
|
747
758
|
readonly scope: TScope;
|
|
748
|
-
readonly string: TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string, true, unknown, never>;
|
|
759
|
+
readonly string: TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string, true, unknown, never, unknown>;
|
|
749
760
|
}
|
|
750
761
|
|
|
751
762
|
// @public
|
|
@@ -886,10 +897,10 @@ export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedType
|
|
|
886
897
|
type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends TreeNodeSchemaUnsafe ? NodeFromSchemaUnsafe<TSchema> : TSchema extends AllowedTypesUnsafe ? NodeFromSchemaUnsafe<FlexListToUnion<TSchema>> : unknown;
|
|
887
898
|
|
|
888
899
|
// @public @sealed
|
|
889
|
-
export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown> = (TNode extends TreeNode ? TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info> : never) | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>;
|
|
900
|
+
export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TCustomMetadata = unknown> = (TNode extends TreeNode ? TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info, never, TCustomMetadata> : never) | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info, never, TCustomMetadata>;
|
|
890
901
|
|
|
891
902
|
// @public @sealed
|
|
892
|
-
export type TreeNodeSchemaClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode = TreeNode, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable> & (undefined extends TConstructorExtra ? {
|
|
903
|
+
export type TreeNodeSchemaClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode = TreeNode, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never, TCustomMetadata = unknown> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable, TCustomMetadata> & (undefined extends TConstructorExtra ? {
|
|
893
904
|
new (data?: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;
|
|
894
905
|
} : {
|
|
895
906
|
new (data: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;
|
|
@@ -902,7 +913,7 @@ export interface TreeNodeSchemaClassUnsafe<out Name extends string, out Kind ext
|
|
|
902
913
|
}
|
|
903
914
|
|
|
904
915
|
// @public @sealed
|
|
905
|
-
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown, out TInsertable = never> {
|
|
916
|
+
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown, out TInsertable = never, out TCustomMetadata = unknown> {
|
|
906
917
|
readonly childTypes: ReadonlySet<TreeNodeSchema>;
|
|
907
918
|
// @sealed
|
|
908
919
|
createFromInsertable(data: TInsertable): Unhydrated<TreeNode | TreeLeafValue>;
|
|
@@ -911,10 +922,11 @@ export interface TreeNodeSchemaCore<out Name extends string, out Kind extends No
|
|
|
911
922
|
readonly info: Info;
|
|
912
923
|
// (undocumented)
|
|
913
924
|
readonly kind: Kind;
|
|
925
|
+
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
914
926
|
}
|
|
915
927
|
|
|
916
928
|
// @public @sealed
|
|
917
|
-
export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable> & (undefined extends TConstructorExtra ? {
|
|
929
|
+
export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never, TCustomMetadata = unknown> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable, TCustomMetadata> & (undefined extends TConstructorExtra ? {
|
|
918
930
|
create(data?: TInsertable | TConstructorExtra): TNode;
|
|
919
931
|
} : {
|
|
920
932
|
create(data: TInsertable | TConstructorExtra): TNode;
|
|
@@ -743,7 +743,6 @@ export interface ISharedMapEvents extends ISharedObjectEvents {
|
|
|
743
743
|
// @alpha
|
|
744
744
|
export interface ISharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends IChannel, IEventProvider<TEvent> {
|
|
745
745
|
bindToContext(): void;
|
|
746
|
-
getGCData(fullGC?: boolean): IGarbageCollectionData;
|
|
747
746
|
}
|
|
748
747
|
|
|
749
748
|
// @alpha
|
|
@@ -917,6 +916,17 @@ export enum NodeKind {
|
|
|
917
916
|
Object = 2
|
|
918
917
|
}
|
|
919
918
|
|
|
919
|
+
// @public @sealed
|
|
920
|
+
export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
921
|
+
readonly custom?: TCustomMetadata | undefined;
|
|
922
|
+
readonly description?: string | undefined;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
// @public @sealed
|
|
926
|
+
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
927
|
+
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
928
|
+
}
|
|
929
|
+
|
|
920
930
|
// @public
|
|
921
931
|
type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = {
|
|
922
932
|
-readonly [Property in keyof T]: Property extends string ? TreeFieldFromImplicitField<T[Property]> : unknown;
|
|
@@ -1021,8 +1031,8 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
1021
1031
|
arrayRecursive<const Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array, unknown>, {
|
|
1022
1032
|
[Symbol.iterator](): Iterator<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
1023
1033
|
}, false, T, undefined>;
|
|
1024
|
-
readonly boolean: TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean, true, unknown, never>;
|
|
1025
|
-
readonly handle: TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never>;
|
|
1034
|
+
readonly boolean: TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>;
|
|
1035
|
+
readonly handle: TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never, unknown>;
|
|
1026
1036
|
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
1027
1037
|
map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchemaNonClass<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map>, MapNodeInsertableData<T>, true, T, undefined>;
|
|
1028
1038
|
map<Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>, MapNodeInsertableData<T>, true, T, undefined>;
|
|
@@ -1034,16 +1044,16 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
1034
1044
|
} | {
|
|
1035
1045
|
readonly [x: string]: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
|
|
1036
1046
|
}, false, T, undefined>;
|
|
1037
|
-
readonly null: TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null, true, unknown, never>;
|
|
1038
|
-
readonly number: TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number, true, unknown, never>;
|
|
1047
|
+
readonly null: TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null, true, unknown, never, unknown>;
|
|
1048
|
+
readonly number: TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number, true, unknown, never, unknown>;
|
|
1039
1049
|
object<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
|
|
1040
|
-
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveStringRecord<ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object &
|
|
1050
|
+
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveStringRecord<ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordUnsafe<T>, false, T>;
|
|
1041
1051
|
optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
1042
1052
|
optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
|
|
1043
1053
|
required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
1044
1054
|
requiredRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Required, T>;
|
|
1045
1055
|
readonly scope: TScope;
|
|
1046
|
-
readonly string: TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string, true, unknown, never>;
|
|
1056
|
+
readonly string: TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string, true, unknown, never, unknown>;
|
|
1047
1057
|
}
|
|
1048
1058
|
|
|
1049
1059
|
// @public
|
|
@@ -1251,10 +1261,10 @@ export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedType
|
|
|
1251
1261
|
type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends TreeNodeSchemaUnsafe ? NodeFromSchemaUnsafe<TSchema> : TSchema extends AllowedTypesUnsafe ? NodeFromSchemaUnsafe<FlexListToUnion<TSchema>> : unknown;
|
|
1252
1262
|
|
|
1253
1263
|
// @public @sealed
|
|
1254
|
-
export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown> = (TNode extends TreeNode ? TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info> : never) | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>;
|
|
1264
|
+
export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TCustomMetadata = unknown> = (TNode extends TreeNode ? TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info, never, TCustomMetadata> : never) | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info, never, TCustomMetadata>;
|
|
1255
1265
|
|
|
1256
1266
|
// @public @sealed
|
|
1257
|
-
export type TreeNodeSchemaClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode = TreeNode, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable> & (undefined extends TConstructorExtra ? {
|
|
1267
|
+
export type TreeNodeSchemaClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode = TreeNode, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never, TCustomMetadata = unknown> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable, TCustomMetadata> & (undefined extends TConstructorExtra ? {
|
|
1258
1268
|
new (data?: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;
|
|
1259
1269
|
} : {
|
|
1260
1270
|
new (data: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;
|
|
@@ -1267,7 +1277,7 @@ export interface TreeNodeSchemaClassUnsafe<out Name extends string, out Kind ext
|
|
|
1267
1277
|
}
|
|
1268
1278
|
|
|
1269
1279
|
// @public @sealed
|
|
1270
|
-
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown, out TInsertable = never> {
|
|
1280
|
+
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown, out TInsertable = never, out TCustomMetadata = unknown> {
|
|
1271
1281
|
readonly childTypes: ReadonlySet<TreeNodeSchema>;
|
|
1272
1282
|
// @sealed
|
|
1273
1283
|
createFromInsertable(data: TInsertable): Unhydrated<TreeNode | TreeLeafValue>;
|
|
@@ -1276,10 +1286,11 @@ export interface TreeNodeSchemaCore<out Name extends string, out Kind extends No
|
|
|
1276
1286
|
readonly info: Info;
|
|
1277
1287
|
// (undocumented)
|
|
1278
1288
|
readonly kind: Kind;
|
|
1289
|
+
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
1279
1290
|
}
|
|
1280
1291
|
|
|
1281
1292
|
// @public @sealed
|
|
1282
|
-
export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable> & (undefined extends TConstructorExtra ? {
|
|
1293
|
+
export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never, TCustomMetadata = unknown> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable, TCustomMetadata> & (undefined extends TConstructorExtra ? {
|
|
1283
1294
|
create(data?: TInsertable | TConstructorExtra): TNode;
|
|
1284
1295
|
} : {
|
|
1285
1296
|
create(data: TInsertable | TConstructorExtra): TNode;
|
|
@@ -650,6 +650,17 @@ export enum NodeKind {
|
|
|
650
650
|
Object = 2
|
|
651
651
|
}
|
|
652
652
|
|
|
653
|
+
// @public @sealed
|
|
654
|
+
export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
655
|
+
readonly custom?: TCustomMetadata | undefined;
|
|
656
|
+
readonly description?: string | undefined;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
// @public @sealed
|
|
660
|
+
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
661
|
+
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
662
|
+
}
|
|
663
|
+
|
|
653
664
|
// @public
|
|
654
665
|
type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = {
|
|
655
666
|
-readonly [Property in keyof T]: Property extends string ? TreeFieldFromImplicitField<T[Property]> : unknown;
|
|
@@ -754,8 +765,8 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
754
765
|
arrayRecursive<const Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array, unknown>, {
|
|
755
766
|
[Symbol.iterator](): Iterator<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
756
767
|
}, false, T, undefined>;
|
|
757
|
-
readonly boolean: TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean, true, unknown, never>;
|
|
758
|
-
readonly handle: TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never>;
|
|
768
|
+
readonly boolean: TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>;
|
|
769
|
+
readonly handle: TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never, unknown>;
|
|
759
770
|
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
760
771
|
map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchemaNonClass<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map>, MapNodeInsertableData<T>, true, T, undefined>;
|
|
761
772
|
map<Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>, MapNodeInsertableData<T>, true, T, undefined>;
|
|
@@ -767,16 +778,16 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
767
778
|
} | {
|
|
768
779
|
readonly [x: string]: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
|
|
769
780
|
}, false, T, undefined>;
|
|
770
|
-
readonly null: TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null, true, unknown, never>;
|
|
771
|
-
readonly number: TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number, true, unknown, never>;
|
|
781
|
+
readonly null: TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null, true, unknown, never, unknown>;
|
|
782
|
+
readonly number: TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number, true, unknown, never, unknown>;
|
|
772
783
|
object<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
|
|
773
|
-
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveStringRecord<ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object &
|
|
784
|
+
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveStringRecord<ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordUnsafe<T>, false, T>;
|
|
774
785
|
optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
775
786
|
optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
|
|
776
787
|
required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
777
788
|
requiredRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Required, T>;
|
|
778
789
|
readonly scope: TScope;
|
|
779
|
-
readonly string: TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string, true, unknown, never>;
|
|
790
|
+
readonly string: TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string, true, unknown, never, unknown>;
|
|
780
791
|
}
|
|
781
792
|
|
|
782
793
|
// @public
|
|
@@ -910,10 +921,10 @@ export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedType
|
|
|
910
921
|
type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends TreeNodeSchemaUnsafe ? NodeFromSchemaUnsafe<TSchema> : TSchema extends AllowedTypesUnsafe ? NodeFromSchemaUnsafe<FlexListToUnion<TSchema>> : unknown;
|
|
911
922
|
|
|
912
923
|
// @public @sealed
|
|
913
|
-
export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown> = (TNode extends TreeNode ? TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info> : never) | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>;
|
|
924
|
+
export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TCustomMetadata = unknown> = (TNode extends TreeNode ? TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info, never, TCustomMetadata> : never) | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info, never, TCustomMetadata>;
|
|
914
925
|
|
|
915
926
|
// @public @sealed
|
|
916
|
-
export type TreeNodeSchemaClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode = TreeNode, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable> & (undefined extends TConstructorExtra ? {
|
|
927
|
+
export type TreeNodeSchemaClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode = TreeNode, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never, TCustomMetadata = unknown> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable, TCustomMetadata> & (undefined extends TConstructorExtra ? {
|
|
917
928
|
new (data?: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;
|
|
918
929
|
} : {
|
|
919
930
|
new (data: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;
|
|
@@ -926,7 +937,7 @@ export interface TreeNodeSchemaClassUnsafe<out Name extends string, out Kind ext
|
|
|
926
937
|
}
|
|
927
938
|
|
|
928
939
|
// @public @sealed
|
|
929
|
-
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown, out TInsertable = never> {
|
|
940
|
+
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown, out TInsertable = never, out TCustomMetadata = unknown> {
|
|
930
941
|
readonly childTypes: ReadonlySet<TreeNodeSchema>;
|
|
931
942
|
// @sealed
|
|
932
943
|
createFromInsertable(data: TInsertable): Unhydrated<TreeNode | TreeLeafValue>;
|
|
@@ -935,10 +946,11 @@ export interface TreeNodeSchemaCore<out Name extends string, out Kind extends No
|
|
|
935
946
|
readonly info: Info;
|
|
936
947
|
// (undocumented)
|
|
937
948
|
readonly kind: Kind;
|
|
949
|
+
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
938
950
|
}
|
|
939
951
|
|
|
940
952
|
// @public @sealed
|
|
941
|
-
export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable> & (undefined extends TConstructorExtra ? {
|
|
953
|
+
export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never, TCustomMetadata = unknown> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable, TCustomMetadata> & (undefined extends TConstructorExtra ? {
|
|
942
954
|
create(data?: TInsertable | TConstructorExtra): TNode;
|
|
943
955
|
} : {
|
|
944
956
|
create(data: TInsertable | TConstructorExtra): TNode;
|
|
@@ -614,6 +614,17 @@ export enum NodeKind {
|
|
|
614
614
|
Object = 2
|
|
615
615
|
}
|
|
616
616
|
|
|
617
|
+
// @public @sealed
|
|
618
|
+
export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
619
|
+
readonly custom?: TCustomMetadata | undefined;
|
|
620
|
+
readonly description?: string | undefined;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
// @public @sealed
|
|
624
|
+
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
625
|
+
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
626
|
+
}
|
|
627
|
+
|
|
617
628
|
// @public
|
|
618
629
|
type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = {
|
|
619
630
|
-readonly [Property in keyof T]: Property extends string ? TreeFieldFromImplicitField<T[Property]> : unknown;
|
|
@@ -718,8 +729,8 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
718
729
|
arrayRecursive<const Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array, unknown>, {
|
|
719
730
|
[Symbol.iterator](): Iterator<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
720
731
|
}, false, T, undefined>;
|
|
721
|
-
readonly boolean: TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean, true, unknown, never>;
|
|
722
|
-
readonly handle: TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never>;
|
|
732
|
+
readonly boolean: TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>;
|
|
733
|
+
readonly handle: TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never, unknown>;
|
|
723
734
|
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
724
735
|
map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchemaNonClass<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map>, MapNodeInsertableData<T>, true, T, undefined>;
|
|
725
736
|
map<Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>, MapNodeInsertableData<T>, true, T, undefined>;
|
|
@@ -731,16 +742,16 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
731
742
|
} | {
|
|
732
743
|
readonly [x: string]: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
|
|
733
744
|
}, false, T, undefined>;
|
|
734
|
-
readonly null: TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null, true, unknown, never>;
|
|
735
|
-
readonly number: TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number, true, unknown, never>;
|
|
745
|
+
readonly null: TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null, true, unknown, never, unknown>;
|
|
746
|
+
readonly number: TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number, true, unknown, never, unknown>;
|
|
736
747
|
object<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
|
|
737
|
-
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveStringRecord<ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object &
|
|
748
|
+
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveStringRecord<ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordUnsafe<T>, false, T>;
|
|
738
749
|
optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
739
750
|
optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
|
|
740
751
|
required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
741
752
|
requiredRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Required, T>;
|
|
742
753
|
readonly scope: TScope;
|
|
743
|
-
readonly string: TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string, true, unknown, never>;
|
|
754
|
+
readonly string: TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string, true, unknown, never, unknown>;
|
|
744
755
|
}
|
|
745
756
|
|
|
746
757
|
// @public
|
|
@@ -870,10 +881,10 @@ export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedType
|
|
|
870
881
|
type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends TreeNodeSchemaUnsafe ? NodeFromSchemaUnsafe<TSchema> : TSchema extends AllowedTypesUnsafe ? NodeFromSchemaUnsafe<FlexListToUnion<TSchema>> : unknown;
|
|
871
882
|
|
|
872
883
|
// @public @sealed
|
|
873
|
-
export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown> = (TNode extends TreeNode ? TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info> : never) | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>;
|
|
884
|
+
export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TCustomMetadata = unknown> = (TNode extends TreeNode ? TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info, never, TCustomMetadata> : never) | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info, never, TCustomMetadata>;
|
|
874
885
|
|
|
875
886
|
// @public @sealed
|
|
876
|
-
export type TreeNodeSchemaClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode = TreeNode, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable> & (undefined extends TConstructorExtra ? {
|
|
887
|
+
export type TreeNodeSchemaClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode = TreeNode, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never, TCustomMetadata = unknown> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable, TCustomMetadata> & (undefined extends TConstructorExtra ? {
|
|
877
888
|
new (data?: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;
|
|
878
889
|
} : {
|
|
879
890
|
new (data: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;
|
|
@@ -886,7 +897,7 @@ export interface TreeNodeSchemaClassUnsafe<out Name extends string, out Kind ext
|
|
|
886
897
|
}
|
|
887
898
|
|
|
888
899
|
// @public @sealed
|
|
889
|
-
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown, out TInsertable = never> {
|
|
900
|
+
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown, out TInsertable = never, out TCustomMetadata = unknown> {
|
|
890
901
|
readonly childTypes: ReadonlySet<TreeNodeSchema>;
|
|
891
902
|
// @sealed
|
|
892
903
|
createFromInsertable(data: TInsertable): Unhydrated<TreeNode | TreeLeafValue>;
|
|
@@ -895,10 +906,11 @@ export interface TreeNodeSchemaCore<out Name extends string, out Kind extends No
|
|
|
895
906
|
readonly info: Info;
|
|
896
907
|
// (undocumented)
|
|
897
908
|
readonly kind: Kind;
|
|
909
|
+
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
898
910
|
}
|
|
899
911
|
|
|
900
912
|
// @public @sealed
|
|
901
|
-
export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable> & (undefined extends TConstructorExtra ? {
|
|
913
|
+
export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends NodeKind = NodeKind, TNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue, TInsertable = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown, TConstructorExtra = never, TCustomMetadata = unknown> = TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info, TInsertable, TCustomMetadata> & (undefined extends TConstructorExtra ? {
|
|
902
914
|
create(data?: TInsertable | TConstructorExtra): TNode;
|
|
903
915
|
} : {
|
|
904
916
|
create(data: TInsertable | TConstructorExtra): TNode;
|
package/dist/alpha.d.ts
CHANGED
|
@@ -83,6 +83,8 @@ export {
|
|
|
83
83
|
NodeFromSchema,
|
|
84
84
|
NodeInDocumentConstraint,
|
|
85
85
|
NodeKind,
|
|
86
|
+
NodeSchemaMetadata,
|
|
87
|
+
NodeSchemaOptions,
|
|
86
88
|
Off,
|
|
87
89
|
ReadonlyArrayNode,
|
|
88
90
|
ReplaceIEventThisPlaceHolder,
|
|
@@ -147,6 +149,9 @@ export {
|
|
|
147
149
|
FluidClientVersion,
|
|
148
150
|
ForestOptions,
|
|
149
151
|
ForestType,
|
|
152
|
+
ForestTypeExpensiveDebug,
|
|
153
|
+
ForestTypeOptimized,
|
|
154
|
+
ForestTypeReference,
|
|
150
155
|
ICodecOptions,
|
|
151
156
|
IdentifierIndex,
|
|
152
157
|
Insertable,
|
|
@@ -175,11 +180,19 @@ export {
|
|
|
175
180
|
ReadableField,
|
|
176
181
|
RevertibleAlpha,
|
|
177
182
|
RevertibleAlphaFactory,
|
|
183
|
+
RunTransactionParams,
|
|
184
|
+
SchemaFactoryAlpha,
|
|
185
|
+
SchemaFactoryObjectOptions,
|
|
178
186
|
SchemaValidationFunction,
|
|
179
187
|
SharedTreeFormatOptions,
|
|
180
188
|
SharedTreeFormatVersion,
|
|
181
189
|
SharedTreeOptions,
|
|
182
190
|
SimpleTreeIndex,
|
|
191
|
+
TransactionCallbackStatus,
|
|
192
|
+
TransactionResult,
|
|
193
|
+
TransactionResultExt,
|
|
194
|
+
TransactionResultFailed,
|
|
195
|
+
TransactionResultSuccess,
|
|
183
196
|
TreeAlpha,
|
|
184
197
|
TreeBranch,
|
|
185
198
|
TreeBranchEvents,
|
|
@@ -194,6 +207,7 @@ export {
|
|
|
194
207
|
VerboseTree,
|
|
195
208
|
VerboseTreeNode,
|
|
196
209
|
ViewContent,
|
|
210
|
+
VoidTransactionCallbackStatus,
|
|
197
211
|
adaptEnum,
|
|
198
212
|
asTreeViewAlpha,
|
|
199
213
|
comparePersistedSchema,
|
package/dist/beta.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,8 @@ export { ConnectionState } from "@fluidframework/container-loader";
|
|
|
15
15
|
export type { ContainerAttachProps, ContainerSchema, IConnection, IFluidContainer, IFluidContainerEvents, IMember, InitialObjects, IServiceAudience, IServiceAudienceEvents, MemberChangedListener, Myself, } from "@fluidframework/fluid-static";
|
|
16
16
|
export type { SharedObjectKind } from "@fluidframework/shared-object-base";
|
|
17
17
|
export type { IErrorBase, IEventProvider, IDisposable, IEvent, IEventThisPlaceHolder, IErrorEvent, ErasedType, IFluidHandle, IFluidLoadable, ITelemetryBaseProperties, IEventTransformer, IProvideFluidLoadable, IFluidHandleErased, TransformedEvent, TelemetryBaseEventPropertyType, Tagged, ReplaceIEventThisPlaceHolder, FluidObject, // Linked in doc comment
|
|
18
|
-
FluidObjectProviderKeys,
|
|
18
|
+
FluidObjectProviderKeys, // Used by FluidObject
|
|
19
|
+
Listeners, IsListener, Listenable, Off, } from "@fluidframework/core-interfaces";
|
|
19
20
|
export type { isFluidHandle } from "@fluidframework/runtime-utils";
|
|
20
21
|
export * from "@fluidframework/tree/alpha";
|
|
21
22
|
import type { SharedObjectKind } from "@fluidframework/shared-object-base";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAMH,YAAY,EACX,eAAe,IAAI,mBAAmB,EAAE,0CAA0C;AAClF,uBAAuB,GACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,YAAY,EACX,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,MAAM,GACN,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EACX,UAAU,EACV,cAAc,EACd,WAAW,EACX,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,cAAc,EACd,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,8BAA8B,EAC9B,MAAM,EACN,4BAA4B,EAC5B,WAAW,EAAE,wBAAwB;AACrC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAMH,YAAY,EACX,eAAe,IAAI,mBAAmB,EAAE,0CAA0C;AAClF,uBAAuB,GACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,YAAY,EACX,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,MAAM,GACN,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EACX,UAAU,EACV,cAAc,EACd,WAAW,EACX,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,cAAc,EACd,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,8BAA8B,EAC9B,MAAM,EACN,4BAA4B,EAC5B,WAAW,EAAE,wBAAwB;AACrC,uBAAuB,EAAE,sBAAsB;AAE/C,SAAS,EACT,UAAU,EACV,UAAU,EACV,GAAG,GAEH,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AASnE,cAAc,4BAA4B,CAAC;AAQ3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,+BAA+B,CAAC;AAEvC;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,EAAE,gBAAgB,CAAC,KAAK,CAAsB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAExF;AAQD,YAAY,EACX,UAAU,EACV,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EAChB,aAAa,GACb,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE1E,YAAY,EACX,mBAAmB,EACnB,qBAAqB,EACrB,SAAS,EACT,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,IAAI,EACJ,sBAAsB,GACtB,MAAM,mCAAmC,CAAC;AAE3C,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,wBAAwB,GACxB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,YAAY,EACX,aAAa,EACb,mBAAmB,GACnB,MAAM,6CAA6C,CAAC;AAErD,YAAY,EACX,yBAAyB,EAAE,iCAAiC;AAC5D,aAAa,EAAE,yCAAyC;AACxD,MAAM,GACN,MAAM,6CAA6C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,11 @@ var container_loader_1 = require("@fluidframework/container-loader");
|
|
|
25
25
|
Object.defineProperty(exports, "ConnectionState", { enumerable: true, get: function () { return container_loader_1.ConnectionState; } });
|
|
26
26
|
// Let the tree package manage its own API surface.
|
|
27
27
|
// Note: this only surfaces the `@public, @beta and @alpha` API items from the tree package.
|
|
28
|
-
|
|
28
|
+
/* eslint-disable-next-line
|
|
29
|
+
no-restricted-syntax,
|
|
30
|
+
import/no-internal-modules,
|
|
31
|
+
import/export -- This re-exports all non-conflicting APIs from `@fluidframework/tree`. In cases where * exports conflict with named exports, the named exports take precedence per https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-getexportednames. This does trigger the `import/export` lint warning (which is intentionally disabled here). This approach ensures that the non-deprecated versions of the event APIs from `@fluidframework/core-interfaces` (provided as named indirect exports) eclipse the deprecated ones from `@fluidframework/tree`. The preferred versions of the event APIs are those exported via `@fluidframework/core-interfaces`.
|
|
32
|
+
*/
|
|
29
33
|
__exportStar(require("@fluidframework/tree/alpha"), exports);
|
|
30
34
|
const internal_1 = require("@fluidframework/tree/internal");
|
|
31
35
|
/**
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAiBH,+EAAoE;AAA3D,oHAAA,WAAW,OAAA;AACpB,qEAAmE;AAA1D,mHAAA,eAAe,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAiBH,+EAAoE;AAA3D,oHAAA,WAAW,OAAA;AACpB,qEAAmE;AAA1D,mHAAA,eAAe,OAAA;AA6CxB,mDAAmD;AACnD,4FAA4F;AAC5F;;;;MAIG;AACH,6DAA2C;AAU3C,4DAIuC;AAEvC;;;;;;;;;GASG;AACU,QAAA,UAAU,GAA4B,qBAAkB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,oBAAoB,CAAC,OAA0B;IAC9D,OAAO,IAAA,+BAA4B,EAAC,OAAO,CAAC,CAAC;AAC9C,CAAC;AAFD,oDAEC;AAmBD,yDAA0E;AAAjE,2GAAA,eAAe,OAAA;AAAE,qGAAA,SAAS,OAAA;AA8BnC,8DAAiE;AAAxD,wGAAA,YAAY,OAAA;AAarB,4BAA4B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Bundles a collection of Fluid Framework client libraries for easy use when paired with a corresponding service client\n * package (e.g. `@fluidframework/azure-client`, `@fluidframework/tinylicious-client`, or `@fluidframework/odsp-client (BETA)`).\n *\n * @packageDocumentation\n */\n\n// ===============================================================\n// #region Public, Beta and Alpha (non-legacy) exports\n// #region Basic re-exports\n\nexport type {\n\tConnectionState as ConnectionStateType, // TODO: deduplicate ConnectionState types\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nexport { AttachState } from \"@fluidframework/container-definitions\";\nexport { ConnectionState } from \"@fluidframework/container-loader\";\nexport type {\n\tContainerAttachProps,\n\tContainerSchema,\n\tIConnection,\n\tIFluidContainer,\n\tIFluidContainerEvents,\n\tIMember,\n\tInitialObjects,\n\tIServiceAudience,\n\tIServiceAudienceEvents,\n\tMemberChangedListener,\n\tMyself,\n} from \"@fluidframework/fluid-static\";\nexport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nexport type {\n\tIErrorBase,\n\tIEventProvider,\n\tIDisposable,\n\tIEvent,\n\tIEventThisPlaceHolder,\n\tIErrorEvent,\n\tErasedType,\n\tIFluidHandle,\n\tIFluidLoadable,\n\tITelemetryBaseProperties,\n\tIEventTransformer,\n\tIProvideFluidLoadable,\n\tIFluidHandleErased,\n\tTransformedEvent,\n\tTelemetryBaseEventPropertyType,\n\tTagged,\n\tReplaceIEventThisPlaceHolder,\n\tFluidObject, // Linked in doc comment\n\tFluidObjectProviderKeys, // Used by FluidObject\n\t/* eslint-disable import/export -- The event APIs are known to conflict, and this is intended as the exports via `@fluidframework/core-interfaces` are preferred over the deprecated ones from `@fluidframework/tree`. */\n\tListeners,\n\tIsListener,\n\tListenable,\n\tOff,\n\t/* eslint-enable import/export */\n} from \"@fluidframework/core-interfaces\";\n\nexport type { isFluidHandle } from \"@fluidframework/runtime-utils\";\n\n// Let the tree package manage its own API surface.\n// Note: this only surfaces the `@public, @beta and @alpha` API items from the tree package.\n/* eslint-disable-next-line\n\tno-restricted-syntax,\n\timport/no-internal-modules,\n\timport/export -- This re-exports all non-conflicting APIs from `@fluidframework/tree`. In cases where * exports conflict with named exports, the named exports take precedence per https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-getexportednames. This does trigger the `import/export` lint warning (which is intentionally disabled here). This approach ensures that the non-deprecated versions of the event APIs from `@fluidframework/core-interfaces` (provided as named indirect exports) eclipse the deprecated ones from `@fluidframework/tree`. The preferred versions of the event APIs are those exported via `@fluidframework/core-interfaces`.\n\t*/\nexport * from \"@fluidframework/tree/alpha\";\n\n// End of basic public+beta+alpha exports - nothing above this line should\n// depend on an /internal path.\n// #endregion Basic re-exports\n// ---------------------------------------------------------------\n// #region Custom re-exports\n\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport type { ITree } from \"@fluidframework/tree\";\nimport {\n\tSharedTree as OriginalSharedTree,\n\tconfiguredSharedTree as originalConfiguredSharedTree,\n\ttype SharedTreeOptions,\n} from \"@fluidframework/tree/internal\";\n\n/**\n * A hierarchical data structure for collaboratively editing strongly typed JSON-like trees\n * of objects, arrays, and other data types.\n * @privateRemarks\n * Here we reexport SharedTree, but with the `@alpha` types (`ISharedObjectKind`) removed, just keeping the `SharedObjectKind`.\n * Doing this requires creating this new typed export rather than relying on a reexport directly from the tree package.\n * The tree package itself does not do this because it's API needs to be usable from the encapsulated API which requires `ISharedObjectKind`.\n * This package however is not intended for use by users of the encapsulated API, and therefor it can discard that interface.\n * @public\n */\nexport const SharedTree: SharedObjectKind<ITree> = OriginalSharedTree;\n\n/**\n * {@link SharedTree} but allowing a non-default configuration.\n * @remarks\n * This is useful for debugging and testing to opt into extra validation or see if opting out of some optimizations fixes an issue.\n * @example\n * ```typescript\n * import {\n * \tForestType,\n * \tTreeCompressionStrategy,\n * \tconfiguredSharedTree,\n * \ttypeboxValidator,\n * } from \"@fluid-framework/alpha\";\n * const SharedTree = configuredSharedTree({\n * \tforest: ForestType.Reference,\n * \tjsonValidator: typeboxValidator,\n * \ttreeEncodeType: TreeCompressionStrategy.Uncompressed,\n * });\n * ```\n * @alpha\n */\nexport function configuredSharedTree(options: SharedTreeOptions): SharedObjectKind<ITree> {\n\treturn originalConfiguredSharedTree(options);\n}\n\n// #endregion Custom re-exports\n// #endregion\n\n// ===============================================================\n// #region Legacy exports\n\nexport type {\n\tIDirectory,\n\tIDirectoryEvents,\n\tIDirectoryValueChanged,\n\tISharedDirectory,\n\tISharedDirectoryEvents,\n\tISharedMap,\n\tISharedMapEvents,\n\tIValueChanged,\n} from \"@fluidframework/map/internal\";\n\nexport { SharedDirectory, SharedMap } from \"@fluidframework/map/internal\";\n\nexport type {\n\tDeserializeCallback,\n\tInteriorSequencePlace,\n\tIInterval,\n\tIIntervalCollectionEvent,\n\tIIntervalCollection,\n\tIntervalIndex,\n\tIntervalStickiness,\n\tISequenceDeltaRange,\n\tISerializableInterval,\n\tISerializedInterval,\n\tISharedIntervalCollection,\n\tISharedSegmentSequenceEvents,\n\tISharedString,\n\tSequencePlace,\n\tSharedStringSegment,\n\tSide,\n\tISharedSegmentSequence,\n} from \"@fluidframework/sequence/internal\";\n\nexport type {\n\tIntervalType,\n\tSequenceDeltaEvent,\n\tSequenceEvent,\n\tSequenceInterval,\n\tSequenceMaintenanceEvent,\n} from \"@fluidframework/sequence/internal\";\n\nexport { SharedString } from \"@fluidframework/sequence/internal\";\n\nexport type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\nexport type {\n\tISequencedDocumentMessage, // Leaked via ISharedObjectEvents\n\tIBranchOrigin, // Required for ISequencedDocumentMessage\n\tITrace, // Required for ISequencedDocumentMessage\n} from \"@fluidframework/driver-definitions/internal\";\n\n// #endregion Legacy exports\n"]}
|
package/dist/legacy.d.ts
CHANGED
package/dist/package.json
CHANGED
package/dist/public.d.ts
CHANGED
package/lib/alpha.d.ts
CHANGED
|
@@ -83,6 +83,8 @@ export {
|
|
|
83
83
|
NodeFromSchema,
|
|
84
84
|
NodeInDocumentConstraint,
|
|
85
85
|
NodeKind,
|
|
86
|
+
NodeSchemaMetadata,
|
|
87
|
+
NodeSchemaOptions,
|
|
86
88
|
Off,
|
|
87
89
|
ReadonlyArrayNode,
|
|
88
90
|
ReplaceIEventThisPlaceHolder,
|
|
@@ -147,6 +149,9 @@ export {
|
|
|
147
149
|
FluidClientVersion,
|
|
148
150
|
ForestOptions,
|
|
149
151
|
ForestType,
|
|
152
|
+
ForestTypeExpensiveDebug,
|
|
153
|
+
ForestTypeOptimized,
|
|
154
|
+
ForestTypeReference,
|
|
150
155
|
ICodecOptions,
|
|
151
156
|
IdentifierIndex,
|
|
152
157
|
Insertable,
|
|
@@ -175,11 +180,19 @@ export {
|
|
|
175
180
|
ReadableField,
|
|
176
181
|
RevertibleAlpha,
|
|
177
182
|
RevertibleAlphaFactory,
|
|
183
|
+
RunTransactionParams,
|
|
184
|
+
SchemaFactoryAlpha,
|
|
185
|
+
SchemaFactoryObjectOptions,
|
|
178
186
|
SchemaValidationFunction,
|
|
179
187
|
SharedTreeFormatOptions,
|
|
180
188
|
SharedTreeFormatVersion,
|
|
181
189
|
SharedTreeOptions,
|
|
182
190
|
SimpleTreeIndex,
|
|
191
|
+
TransactionCallbackStatus,
|
|
192
|
+
TransactionResult,
|
|
193
|
+
TransactionResultExt,
|
|
194
|
+
TransactionResultFailed,
|
|
195
|
+
TransactionResultSuccess,
|
|
183
196
|
TreeAlpha,
|
|
184
197
|
TreeBranch,
|
|
185
198
|
TreeBranchEvents,
|
|
@@ -194,6 +207,7 @@ export {
|
|
|
194
207
|
VerboseTree,
|
|
195
208
|
VerboseTreeNode,
|
|
196
209
|
ViewContent,
|
|
210
|
+
VoidTransactionCallbackStatus,
|
|
197
211
|
adaptEnum,
|
|
198
212
|
asTreeViewAlpha,
|
|
199
213
|
comparePersistedSchema,
|
package/lib/beta.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -15,7 +15,8 @@ export { ConnectionState } from "@fluidframework/container-loader";
|
|
|
15
15
|
export type { ContainerAttachProps, ContainerSchema, IConnection, IFluidContainer, IFluidContainerEvents, IMember, InitialObjects, IServiceAudience, IServiceAudienceEvents, MemberChangedListener, Myself, } from "@fluidframework/fluid-static";
|
|
16
16
|
export type { SharedObjectKind } from "@fluidframework/shared-object-base";
|
|
17
17
|
export type { IErrorBase, IEventProvider, IDisposable, IEvent, IEventThisPlaceHolder, IErrorEvent, ErasedType, IFluidHandle, IFluidLoadable, ITelemetryBaseProperties, IEventTransformer, IProvideFluidLoadable, IFluidHandleErased, TransformedEvent, TelemetryBaseEventPropertyType, Tagged, ReplaceIEventThisPlaceHolder, FluidObject, // Linked in doc comment
|
|
18
|
-
FluidObjectProviderKeys,
|
|
18
|
+
FluidObjectProviderKeys, // Used by FluidObject
|
|
19
|
+
Listeners, IsListener, Listenable, Off, } from "@fluidframework/core-interfaces";
|
|
19
20
|
export type { isFluidHandle } from "@fluidframework/runtime-utils";
|
|
20
21
|
export * from "@fluidframework/tree/alpha";
|
|
21
22
|
import type { SharedObjectKind } from "@fluidframework/shared-object-base";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAMH,YAAY,EACX,eAAe,IAAI,mBAAmB,EAAE,0CAA0C;AAClF,uBAAuB,GACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,YAAY,EACX,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,MAAM,GACN,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EACX,UAAU,EACV,cAAc,EACd,WAAW,EACX,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,cAAc,EACd,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,8BAA8B,EAC9B,MAAM,EACN,4BAA4B,EAC5B,WAAW,EAAE,wBAAwB;AACrC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAMH,YAAY,EACX,eAAe,IAAI,mBAAmB,EAAE,0CAA0C;AAClF,uBAAuB,GACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,YAAY,EACX,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,MAAM,GACN,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EACX,UAAU,EACV,cAAc,EACd,WAAW,EACX,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,cAAc,EACd,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,8BAA8B,EAC9B,MAAM,EACN,4BAA4B,EAC5B,WAAW,EAAE,wBAAwB;AACrC,uBAAuB,EAAE,sBAAsB;AAE/C,SAAS,EACT,UAAU,EACV,UAAU,EACV,GAAG,GAEH,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AASnE,cAAc,4BAA4B,CAAC;AAQ3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,+BAA+B,CAAC;AAEvC;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,EAAE,gBAAgB,CAAC,KAAK,CAAsB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAExF;AAQD,YAAY,EACX,UAAU,EACV,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EAChB,aAAa,GACb,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE1E,YAAY,EACX,mBAAmB,EACnB,qBAAqB,EACrB,SAAS,EACT,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,IAAI,EACJ,sBAAsB,GACtB,MAAM,mCAAmC,CAAC;AAE3C,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,wBAAwB,GACxB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,YAAY,EACX,aAAa,EACb,mBAAmB,GACnB,MAAM,6CAA6C,CAAC;AAErD,YAAY,EACX,yBAAyB,EAAE,iCAAiC;AAC5D,aAAa,EAAE,yCAAyC;AACxD,MAAM,GACN,MAAM,6CAA6C,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -6,7 +6,11 @@ export { AttachState } from "@fluidframework/container-definitions";
|
|
|
6
6
|
export { ConnectionState } from "@fluidframework/container-loader";
|
|
7
7
|
// Let the tree package manage its own API surface.
|
|
8
8
|
// Note: this only surfaces the `@public, @beta and @alpha` API items from the tree package.
|
|
9
|
-
|
|
9
|
+
/* eslint-disable-next-line
|
|
10
|
+
no-restricted-syntax,
|
|
11
|
+
import/no-internal-modules,
|
|
12
|
+
import/export -- This re-exports all non-conflicting APIs from `@fluidframework/tree`. In cases where * exports conflict with named exports, the named exports take precedence per https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-getexportednames. This does trigger the `import/export` lint warning (which is intentionally disabled here). This approach ensures that the non-deprecated versions of the event APIs from `@fluidframework/core-interfaces` (provided as named indirect exports) eclipse the deprecated ones from `@fluidframework/tree`. The preferred versions of the event APIs are those exported via `@fluidframework/core-interfaces`.
|
|
13
|
+
*/
|
|
10
14
|
export * from "@fluidframework/tree/alpha";
|
|
11
15
|
import { SharedTree as OriginalSharedTree, configuredSharedTree as originalConfiguredSharedTree, } from "@fluidframework/tree/internal";
|
|
12
16
|
/**
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AA6CnE,mDAAmD;AACnD,4FAA4F;AAC5F;;;;MAIG;AACH,cAAc,4BAA4B,CAAC;AAU3C,OAAO,EACN,UAAU,IAAI,kBAAkB,EAChC,oBAAoB,IAAI,4BAA4B,GAEpD,MAAM,+BAA+B,CAAC;AAEvC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,UAAU,GAA4B,kBAAkB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA0B;IAC9D,OAAO,4BAA4B,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC;AAmBD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AA8B1E,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAajE,4BAA4B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Bundles a collection of Fluid Framework client libraries for easy use when paired with a corresponding service client\n * package (e.g. `@fluidframework/azure-client`, `@fluidframework/tinylicious-client`, or `@fluidframework/odsp-client (BETA)`).\n *\n * @packageDocumentation\n */\n\n// ===============================================================\n// #region Public, Beta and Alpha (non-legacy) exports\n// #region Basic re-exports\n\nexport type {\n\tConnectionState as ConnectionStateType, // TODO: deduplicate ConnectionState types\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nexport { AttachState } from \"@fluidframework/container-definitions\";\nexport { ConnectionState } from \"@fluidframework/container-loader\";\nexport type {\n\tContainerAttachProps,\n\tContainerSchema,\n\tIConnection,\n\tIFluidContainer,\n\tIFluidContainerEvents,\n\tIMember,\n\tInitialObjects,\n\tIServiceAudience,\n\tIServiceAudienceEvents,\n\tMemberChangedListener,\n\tMyself,\n} from \"@fluidframework/fluid-static\";\nexport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nexport type {\n\tIErrorBase,\n\tIEventProvider,\n\tIDisposable,\n\tIEvent,\n\tIEventThisPlaceHolder,\n\tIErrorEvent,\n\tErasedType,\n\tIFluidHandle,\n\tIFluidLoadable,\n\tITelemetryBaseProperties,\n\tIEventTransformer,\n\tIProvideFluidLoadable,\n\tIFluidHandleErased,\n\tTransformedEvent,\n\tTelemetryBaseEventPropertyType,\n\tTagged,\n\tReplaceIEventThisPlaceHolder,\n\tFluidObject, // Linked in doc comment\n\tFluidObjectProviderKeys, // Used by FluidObject\n\t/* eslint-disable import/export -- The event APIs are known to conflict, and this is intended as the exports via `@fluidframework/core-interfaces` are preferred over the deprecated ones from `@fluidframework/tree`. */\n\tListeners,\n\tIsListener,\n\tListenable,\n\tOff,\n\t/* eslint-enable import/export */\n} from \"@fluidframework/core-interfaces\";\n\nexport type { isFluidHandle } from \"@fluidframework/runtime-utils\";\n\n// Let the tree package manage its own API surface.\n// Note: this only surfaces the `@public, @beta and @alpha` API items from the tree package.\n/* eslint-disable-next-line\n\tno-restricted-syntax,\n\timport/no-internal-modules,\n\timport/export -- This re-exports all non-conflicting APIs from `@fluidframework/tree`. In cases where * exports conflict with named exports, the named exports take precedence per https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-getexportednames. This does trigger the `import/export` lint warning (which is intentionally disabled here). This approach ensures that the non-deprecated versions of the event APIs from `@fluidframework/core-interfaces` (provided as named indirect exports) eclipse the deprecated ones from `@fluidframework/tree`. The preferred versions of the event APIs are those exported via `@fluidframework/core-interfaces`.\n\t*/\nexport * from \"@fluidframework/tree/alpha\";\n\n// End of basic public+beta+alpha exports - nothing above this line should\n// depend on an /internal path.\n// #endregion Basic re-exports\n// ---------------------------------------------------------------\n// #region Custom re-exports\n\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport type { ITree } from \"@fluidframework/tree\";\nimport {\n\tSharedTree as OriginalSharedTree,\n\tconfiguredSharedTree as originalConfiguredSharedTree,\n\ttype SharedTreeOptions,\n} from \"@fluidframework/tree/internal\";\n\n/**\n * A hierarchical data structure for collaboratively editing strongly typed JSON-like trees\n * of objects, arrays, and other data types.\n * @privateRemarks\n * Here we reexport SharedTree, but with the `@alpha` types (`ISharedObjectKind`) removed, just keeping the `SharedObjectKind`.\n * Doing this requires creating this new typed export rather than relying on a reexport directly from the tree package.\n * The tree package itself does not do this because it's API needs to be usable from the encapsulated API which requires `ISharedObjectKind`.\n * This package however is not intended for use by users of the encapsulated API, and therefor it can discard that interface.\n * @public\n */\nexport const SharedTree: SharedObjectKind<ITree> = OriginalSharedTree;\n\n/**\n * {@link SharedTree} but allowing a non-default configuration.\n * @remarks\n * This is useful for debugging and testing to opt into extra validation or see if opting out of some optimizations fixes an issue.\n * @example\n * ```typescript\n * import {\n * \tForestType,\n * \tTreeCompressionStrategy,\n * \tconfiguredSharedTree,\n * \ttypeboxValidator,\n * } from \"@fluid-framework/alpha\";\n * const SharedTree = configuredSharedTree({\n * \tforest: ForestType.Reference,\n * \tjsonValidator: typeboxValidator,\n * \ttreeEncodeType: TreeCompressionStrategy.Uncompressed,\n * });\n * ```\n * @alpha\n */\nexport function configuredSharedTree(options: SharedTreeOptions): SharedObjectKind<ITree> {\n\treturn originalConfiguredSharedTree(options);\n}\n\n// #endregion Custom re-exports\n// #endregion\n\n// ===============================================================\n// #region Legacy exports\n\nexport type {\n\tIDirectory,\n\tIDirectoryEvents,\n\tIDirectoryValueChanged,\n\tISharedDirectory,\n\tISharedDirectoryEvents,\n\tISharedMap,\n\tISharedMapEvents,\n\tIValueChanged,\n} from \"@fluidframework/map/internal\";\n\nexport { SharedDirectory, SharedMap } from \"@fluidframework/map/internal\";\n\nexport type {\n\tDeserializeCallback,\n\tInteriorSequencePlace,\n\tIInterval,\n\tIIntervalCollectionEvent,\n\tIIntervalCollection,\n\tIntervalIndex,\n\tIntervalStickiness,\n\tISequenceDeltaRange,\n\tISerializableInterval,\n\tISerializedInterval,\n\tISharedIntervalCollection,\n\tISharedSegmentSequenceEvents,\n\tISharedString,\n\tSequencePlace,\n\tSharedStringSegment,\n\tSide,\n\tISharedSegmentSequence,\n} from \"@fluidframework/sequence/internal\";\n\nexport type {\n\tIntervalType,\n\tSequenceDeltaEvent,\n\tSequenceEvent,\n\tSequenceInterval,\n\tSequenceMaintenanceEvent,\n} from \"@fluidframework/sequence/internal\";\n\nexport { SharedString } from \"@fluidframework/sequence/internal\";\n\nexport type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\nexport type {\n\tISequencedDocumentMessage, // Leaked via ISharedObjectEvents\n\tIBranchOrigin, // Required for ISequencedDocumentMessage\n\tITrace, // Required for ISequencedDocumentMessage\n} from \"@fluidframework/driver-definitions/internal\";\n\n// #endregion Legacy exports\n"]}
|
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.20.0",
|
|
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": "~2.
|
|
61
|
-
"@fluidframework/container-loader": "~2.
|
|
62
|
-
"@fluidframework/core-interfaces": "~2.
|
|
63
|
-
"@fluidframework/driver-definitions": "~2.
|
|
64
|
-
"@fluidframework/fluid-static": "~2.
|
|
65
|
-
"@fluidframework/map": "~2.
|
|
66
|
-
"@fluidframework/runtime-utils": "~2.
|
|
67
|
-
"@fluidframework/sequence": "~2.
|
|
68
|
-
"@fluidframework/shared-object-base": "~2.
|
|
69
|
-
"@fluidframework/tree": "~2.
|
|
60
|
+
"@fluidframework/container-definitions": "~2.20.0",
|
|
61
|
+
"@fluidframework/container-loader": "~2.20.0",
|
|
62
|
+
"@fluidframework/core-interfaces": "~2.20.0",
|
|
63
|
+
"@fluidframework/driver-definitions": "~2.20.0",
|
|
64
|
+
"@fluidframework/fluid-static": "~2.20.0",
|
|
65
|
+
"@fluidframework/map": "~2.20.0",
|
|
66
|
+
"@fluidframework/runtime-utils": "~2.20.0",
|
|
67
|
+
"@fluidframework/sequence": "~2.20.0",
|
|
68
|
+
"@fluidframework/shared-object-base": "~2.20.0",
|
|
69
|
+
"@fluidframework/tree": "~2.20.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@arethetypeswrong/cli": "^0.17.1",
|
package/src/index.ts
CHANGED
|
@@ -54,13 +54,23 @@ export type {
|
|
|
54
54
|
ReplaceIEventThisPlaceHolder,
|
|
55
55
|
FluidObject, // Linked in doc comment
|
|
56
56
|
FluidObjectProviderKeys, // Used by FluidObject
|
|
57
|
+
/* eslint-disable import/export -- The event APIs are known to conflict, and this is intended as the exports via `@fluidframework/core-interfaces` are preferred over the deprecated ones from `@fluidframework/tree`. */
|
|
58
|
+
Listeners,
|
|
59
|
+
IsListener,
|
|
60
|
+
Listenable,
|
|
61
|
+
Off,
|
|
62
|
+
/* eslint-enable import/export */
|
|
57
63
|
} from "@fluidframework/core-interfaces";
|
|
58
64
|
|
|
59
65
|
export type { isFluidHandle } from "@fluidframework/runtime-utils";
|
|
60
66
|
|
|
61
67
|
// Let the tree package manage its own API surface.
|
|
62
68
|
// Note: this only surfaces the `@public, @beta and @alpha` API items from the tree package.
|
|
63
|
-
|
|
69
|
+
/* eslint-disable-next-line
|
|
70
|
+
no-restricted-syntax,
|
|
71
|
+
import/no-internal-modules,
|
|
72
|
+
import/export -- This re-exports all non-conflicting APIs from `@fluidframework/tree`. In cases where * exports conflict with named exports, the named exports take precedence per https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-getexportednames. This does trigger the `import/export` lint warning (which is intentionally disabled here). This approach ensures that the non-deprecated versions of the event APIs from `@fluidframework/core-interfaces` (provided as named indirect exports) eclipse the deprecated ones from `@fluidframework/tree`. The preferred versions of the event APIs are those exported via `@fluidframework/core-interfaces`.
|
|
73
|
+
*/
|
|
64
74
|
export * from "@fluidframework/tree/alpha";
|
|
65
75
|
|
|
66
76
|
// End of basic public+beta+alpha exports - nothing above this line should
|