fluid-framework 2.0.0-rc.4.0.7 → 2.0.0-rc.4.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-report/fluid-framework.api.md +1673 -1
- package/package.json +11 -11
- package/dist/public.d.ts +0 -112
- package/lib/public.d.ts +0 -112
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import { Client } from '@fluidframework/merge-tree/internal';
|
|
8
8
|
import { Deferred } from '@fluidframework/core-utils/internal';
|
|
9
9
|
import { ErasedType } from '@fluidframework/core-interfaces';
|
|
10
|
+
import { FieldSchemaUnsafe as FieldSchemaUnsafe_2 } from './typesUnsafe.js';
|
|
11
|
+
import { Forbidden as Forbidden_2 } from '../default-schema/defaultFieldKinds.js';
|
|
10
12
|
import { IChannel } from '@fluidframework/datastore-definitions';
|
|
11
13
|
import { IChannelAttributes } from '@fluidframework/datastore-definitions';
|
|
12
14
|
import type { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
@@ -26,15 +28,17 @@ import { IMergeTreeDeltaCallbackArgs } from '@fluidframework/merge-tree/internal
|
|
|
26
28
|
import { IMergeTreeDeltaOpArgs } from '@fluidframework/merge-tree/internal';
|
|
27
29
|
import { IMergeTreeGroupMsg } from '@fluidframework/merge-tree/internal';
|
|
28
30
|
import { IMergeTreeMaintenanceCallbackArgs } from '@fluidframework/merge-tree/internal';
|
|
31
|
+
import { InsertableObjectFromSchemaRecordUnsafe as InsertableObjectFromSchemaRecordUnsafe_2 } from './typesUnsafe.js';
|
|
29
32
|
import { IRelativePosition } from '@fluidframework/merge-tree/internal';
|
|
30
33
|
import { ISegment } from '@fluidframework/merge-tree/internal';
|
|
31
34
|
import { ISegmentAction } from '@fluidframework/merge-tree/internal';
|
|
32
35
|
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
33
|
-
import
|
|
36
|
+
import { ISharedObject } from '@fluidframework/shared-object-base';
|
|
34
37
|
import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
|
|
35
38
|
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
36
39
|
import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
|
|
37
40
|
import { ITelemetryContext } from '@fluidframework/runtime-definitions';
|
|
41
|
+
import { LeafNodeSchema as LeafNodeSchema_2 } from '../feature-libraries/index.js';
|
|
38
42
|
import { LocalReferencePosition } from '@fluidframework/merge-tree/internal';
|
|
39
43
|
import { Marker } from '@fluidframework/merge-tree/internal';
|
|
40
44
|
import { MergeTreeDeltaOperationType } from '@fluidframework/merge-tree/internal';
|
|
@@ -45,14 +49,138 @@ import { PropertiesManager } from '@fluidframework/merge-tree/internal';
|
|
|
45
49
|
import { PropertySet } from '@fluidframework/merge-tree/internal';
|
|
46
50
|
import { ReferencePosition } from '@fluidframework/merge-tree/internal';
|
|
47
51
|
import { ReferenceType } from '@fluidframework/merge-tree/internal';
|
|
52
|
+
import { SchemaLibrary as SchemaLibrary_2 } from '../feature-libraries/schemaBuilderBase.js';
|
|
53
|
+
import { SessionSpaceCompressedId } from '@fluidframework/id-compressor';
|
|
48
54
|
import { SharedObject } from '@fluidframework/shared-object-base/internal';
|
|
49
55
|
import { SlidingPreference } from '@fluidframework/merge-tree/internal';
|
|
56
|
+
import { StableId } from '@fluidframework/id-compressor';
|
|
57
|
+
import type { Static } from '@sinclair/typebox';
|
|
50
58
|
import { TextSegment } from '@fluidframework/merge-tree/internal';
|
|
59
|
+
import { TreeNodeSchema as TreeNodeSchema_2 } from './schemaTypes.js';
|
|
60
|
+
import { TreeNodeSchemaClass as TreeNodeSchemaClass_2 } from './schemaTypes.js';
|
|
61
|
+
import { TreeObjectNodeUnsafe as TreeObjectNodeUnsafe_2 } from './typesUnsafe.js';
|
|
62
|
+
import type { TSchema } from '@sinclair/typebox';
|
|
51
63
|
import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
52
64
|
|
|
65
|
+
// @internal
|
|
66
|
+
export function adaptEnum<TScope extends string, const TEnum extends Record<string, string>>(factory: SchemaFactory<TScope>, members: TEnum): (<TValue extends TEnum[keyof TEnum]>(value: TValue) => object & TreeNode & ObjectFromSchemaRecord<EmptyObject> & {
|
|
67
|
+
readonly value: TValue;
|
|
68
|
+
}) & { readonly [Property in keyof TEnum]: TreeNodeSchemaClass<ScopedSchemaName<TScope, TEnum[Property]>, NodeKind.Object, object & TreeNode & ObjectFromSchemaRecord<EmptyObject> & {
|
|
69
|
+
readonly value: TEnum[Property];
|
|
70
|
+
}, object & InsertableObjectFromSchemaRecord<EmptyObject>, true, unknown> & (new () => object & TreeNode & ObjectFromSchemaRecord<EmptyObject> & {
|
|
71
|
+
readonly value: TEnum[Property];
|
|
72
|
+
}); };
|
|
73
|
+
|
|
74
|
+
// @internal
|
|
75
|
+
export interface Adapters {
|
|
76
|
+
// (undocumented)
|
|
77
|
+
readonly tree?: readonly TreeAdapter[];
|
|
78
|
+
}
|
|
79
|
+
|
|
53
80
|
// @public
|
|
54
81
|
export type AllowedTypes = readonly LazyItem<TreeNodeSchema>[];
|
|
55
82
|
|
|
83
|
+
// @internal
|
|
84
|
+
export type AllowedTypeSet = Any | ReadonlySet<FlexTreeNodeSchema>;
|
|
85
|
+
|
|
86
|
+
// @internal
|
|
87
|
+
export type AllowedTypesToFlexInsertableTree<T extends FlexAllowedTypes> = [
|
|
88
|
+
T extends readonly LazyItem<FlexTreeNodeSchema>[] ? InsertableFlexNode<Assume<FlexListToUnion<T>, FlexTreeNodeSchema>> : ContextuallyTypedNodeData
|
|
89
|
+
][_InlineTrick];
|
|
90
|
+
|
|
91
|
+
// @internal
|
|
92
|
+
export enum AllowedUpdateType {
|
|
93
|
+
Initialize = 1,
|
|
94
|
+
None = 0,
|
|
95
|
+
SchemaCompatible = 2
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// @internal
|
|
99
|
+
export type AllowOptional<T> = [FlattenKeys<RequiredFields<T> & OptionalFields<T>>][_InlineTrick];
|
|
100
|
+
|
|
101
|
+
// @internal
|
|
102
|
+
export type AllowOptionalNotFlattened<T> = [RequiredFields<T> & OptionalFields<T>][_InlineTrick];
|
|
103
|
+
|
|
104
|
+
// @internal
|
|
105
|
+
export type Anchor = Brand<number, "rebaser.Anchor">;
|
|
106
|
+
|
|
107
|
+
// @internal
|
|
108
|
+
export interface AnchorEvents {
|
|
109
|
+
afterDestroy(anchor: AnchorNode): void;
|
|
110
|
+
childrenChanged(anchor: AnchorNode): void;
|
|
111
|
+
childrenChanging(anchor: AnchorNode): void;
|
|
112
|
+
subtreeChanged(anchor: AnchorNode): void;
|
|
113
|
+
subtreeChanging(anchor: AnchorNode): PathVisitor | void;
|
|
114
|
+
valueChanging(anchor: AnchorNode, value: Value): void;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// @internal
|
|
118
|
+
export interface AnchorLocator {
|
|
119
|
+
locate(anchor: Anchor): AnchorNode | undefined;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// @internal
|
|
123
|
+
export interface AnchorNode extends UpPath<AnchorNode>, ISubscribable<AnchorEvents> {
|
|
124
|
+
readonly anchorSet: AnchorSet;
|
|
125
|
+
child(key: FieldKey, index: number): UpPath<AnchorNode>;
|
|
126
|
+
getOrCreateChildRef(key: FieldKey, index: number): [Anchor, AnchorNode];
|
|
127
|
+
readonly slots: BrandedMapSubset<AnchorSlot<any>>;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// @internal @sealed
|
|
131
|
+
export class AnchorSet implements ISubscribable<AnchorSetRootEvents>, AnchorLocator {
|
|
132
|
+
constructor();
|
|
133
|
+
acquireVisitor(): AnnouncedVisitor & DeltaVisitor;
|
|
134
|
+
// (undocumented)
|
|
135
|
+
forget(anchor: Anchor): void;
|
|
136
|
+
generationNumber: number;
|
|
137
|
+
internalizePath(originalPath: UpPath): UpPath;
|
|
138
|
+
isEmpty(): boolean;
|
|
139
|
+
// (undocumented)
|
|
140
|
+
locate(anchor: Anchor): AnchorNode | undefined;
|
|
141
|
+
// (undocumented)
|
|
142
|
+
on<K extends keyof AnchorSetRootEvents>(eventName: K, listener: AnchorSetRootEvents[K]): () => void;
|
|
143
|
+
get slots(): BrandedMapSubset<AnchorSlot<any>>;
|
|
144
|
+
track(path: UpPath | null): Anchor;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// @internal
|
|
148
|
+
export interface AnchorSetRootEvents {
|
|
149
|
+
childrenChanging(anchors: AnchorSet): void;
|
|
150
|
+
treeChanging(anchors: AnchorSet): void;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// @internal
|
|
154
|
+
export type AnchorSlot<TContent> = BrandedKey<Opaque<Brand<number, "AnchorSlot">>, TContent>;
|
|
155
|
+
|
|
156
|
+
// @internal
|
|
157
|
+
export function anchorSlot<TContent>(): AnchorSlot<TContent>;
|
|
158
|
+
|
|
159
|
+
// @internal
|
|
160
|
+
export interface AnnouncedVisitor extends DeltaVisitor {
|
|
161
|
+
// (undocumented)
|
|
162
|
+
afterAttach(source: FieldKey, destination: Range_2): void;
|
|
163
|
+
afterCreate(content: ProtoNodes, destination: FieldKey): void;
|
|
164
|
+
// (undocumented)
|
|
165
|
+
afterDetach(source: PlaceIndex, count: number, destination: FieldKey): void;
|
|
166
|
+
// (undocumented)
|
|
167
|
+
afterReplace(newContentSource: FieldKey, newContent: Range_2, oldContent: FieldKey): void;
|
|
168
|
+
// (undocumented)
|
|
169
|
+
beforeAttach(source: FieldKey, count: number, destination: PlaceIndex): void;
|
|
170
|
+
// (undocumented)
|
|
171
|
+
beforeDestroy(field: FieldKey, count: number): void;
|
|
172
|
+
// (undocumented)
|
|
173
|
+
beforeDetach(source: Range_2, destination: FieldKey): void;
|
|
174
|
+
// (undocumented)
|
|
175
|
+
beforeReplace(newContent: FieldKey, oldContent: Range_2, oldContentDestination: FieldKey): void;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// @internal
|
|
179
|
+
export const Any: "Any";
|
|
180
|
+
|
|
181
|
+
// @internal
|
|
182
|
+
export type Any = typeof Any;
|
|
183
|
+
|
|
56
184
|
// @public
|
|
57
185
|
export type ApplyKind<T, Kind extends FieldKind, DefaultsAreOptional extends boolean> = {
|
|
58
186
|
[FieldKind.Required]: T;
|
|
@@ -60,6 +188,26 @@ export type ApplyKind<T, Kind extends FieldKind, DefaultsAreOptional extends boo
|
|
|
60
188
|
[FieldKind.Identifier]: DefaultsAreOptional extends true ? T | undefined : T;
|
|
61
189
|
}[Kind];
|
|
62
190
|
|
|
191
|
+
// @internal
|
|
192
|
+
export type ApplyMultiplicity<TMultiplicity extends Multiplicity, TypedChild> = {
|
|
193
|
+
[Multiplicity.Forbidden]: undefined;
|
|
194
|
+
[Multiplicity.Optional]: undefined | TypedChild;
|
|
195
|
+
[Multiplicity.Sequence]: TypedChild[];
|
|
196
|
+
[Multiplicity.Single]: TypedChild;
|
|
197
|
+
}[TMultiplicity];
|
|
198
|
+
|
|
199
|
+
// @internal
|
|
200
|
+
export interface ArrayLikeMut<TGet, TSet extends TGet = TGet> extends ArrayLike<TGet> {
|
|
201
|
+
// (undocumented)
|
|
202
|
+
[n: number]: TSet;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// @internal
|
|
206
|
+
export type AssignableFieldKinds = typeof FieldKinds.optional | typeof FieldKinds.required;
|
|
207
|
+
|
|
208
|
+
// @internal
|
|
209
|
+
export type Assume<TInput, TAssumeToBe> = [TInput] extends [TAssumeToBe] ? TInput : TAssumeToBe;
|
|
210
|
+
|
|
63
211
|
// @public
|
|
64
212
|
export enum AttachState {
|
|
65
213
|
Attached = "Attached",
|
|
@@ -67,6 +215,71 @@ export enum AttachState {
|
|
|
67
215
|
Detached = "Detached"
|
|
68
216
|
}
|
|
69
217
|
|
|
218
|
+
// @internal
|
|
219
|
+
export type Brand<ValueType, Name> = ValueType & BrandedType<ValueType, Name>;
|
|
220
|
+
|
|
221
|
+
// @internal
|
|
222
|
+
export function brand<T>(value: T extends BrandedType<infer ValueType, unknown> ? ValueType : never): T;
|
|
223
|
+
|
|
224
|
+
// @internal
|
|
225
|
+
export type BrandedKey<TKey, TContent> = TKey & Invariant<TContent>;
|
|
226
|
+
|
|
227
|
+
// @internal (undocumented)
|
|
228
|
+
export type BrandedKeyContent<TKey extends BrandedKey<unknown, any>> = TKey extends BrandedKey<unknown, infer TContent> ? TContent : never;
|
|
229
|
+
|
|
230
|
+
// @internal
|
|
231
|
+
export interface BrandedMapSubset<K extends BrandedKey<unknown, any>> {
|
|
232
|
+
// (undocumented)
|
|
233
|
+
delete(key: K): boolean;
|
|
234
|
+
// (undocumented)
|
|
235
|
+
get<K2 extends K>(key: K2): BrandedKeyContent<K2> | undefined;
|
|
236
|
+
// (undocumented)
|
|
237
|
+
has(key: K): boolean;
|
|
238
|
+
// (undocumented)
|
|
239
|
+
set<K2 extends K>(key: K2, value: BrandedKeyContent<K2>): this;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// @internal @sealed
|
|
243
|
+
export abstract class BrandedType<out ValueType, Name> {
|
|
244
|
+
static [Symbol.hasInstance](value: never): value is never;
|
|
245
|
+
protected abstract brand(dummy: never): Name;
|
|
246
|
+
// (undocumented)
|
|
247
|
+
protected _typeCheck?: Covariant<ValueType>;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// @internal
|
|
251
|
+
export function buildTreeConfiguration<T extends FlexFieldSchema>(config: InitializeAndSchematizeConfiguration<T>): InitializeAndSchematizeConfiguration<T>;
|
|
252
|
+
|
|
253
|
+
// @internal
|
|
254
|
+
export type ChangesetLocalId = Brand<number, "ChangesetLocalId">;
|
|
255
|
+
|
|
256
|
+
// @internal
|
|
257
|
+
export interface CheckoutEvents {
|
|
258
|
+
afterBatch(): void;
|
|
259
|
+
commitApplied(data: CommitMetadata, getRevertible?: RevertibleFactory): void;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// @internal
|
|
263
|
+
export type CheckTypesOverlap<T, TCheck> = [Extract<T, TCheck> extends never ? never : T][0];
|
|
264
|
+
|
|
265
|
+
// @internal
|
|
266
|
+
export type ChildCollection = FieldKey | RootField;
|
|
267
|
+
|
|
268
|
+
// @internal
|
|
269
|
+
export interface ChildLocation {
|
|
270
|
+
// (undocumented)
|
|
271
|
+
readonly container: ChildCollection;
|
|
272
|
+
// (undocumented)
|
|
273
|
+
readonly index: number;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// @internal
|
|
277
|
+
export type CollectOptions<TTypedFields, TValueSchema extends ValueSchema | undefined, TName> = TValueSchema extends undefined ? FlattenKeys<{
|
|
278
|
+
[typeNameSymbol]?: UnbrandedName<TName>;
|
|
279
|
+
} & (TValueSchema extends ValueSchema ? {
|
|
280
|
+
[valueSymbol]: TreeValue<TValueSchema>;
|
|
281
|
+
} : EmptyObject)> & TTypedFields : TValueSchema extends ValueSchema ? TreeValue<TValueSchema> : undefined;
|
|
282
|
+
|
|
70
283
|
// @public
|
|
71
284
|
export enum CommitKind {
|
|
72
285
|
Default = 0,
|
|
@@ -80,6 +293,12 @@ export interface CommitMetadata {
|
|
|
80
293
|
readonly kind: CommitKind;
|
|
81
294
|
}
|
|
82
295
|
|
|
296
|
+
// @internal
|
|
297
|
+
export function compareLocalNodeKeys(a: LocalNodeKey, b: LocalNodeKey): -1 | 0 | 1;
|
|
298
|
+
|
|
299
|
+
// @internal
|
|
300
|
+
export function configuredSharedTree(options: SharedTreeOptions): ISharedObjectKind<ITree>;
|
|
301
|
+
|
|
83
302
|
// @public
|
|
84
303
|
export enum ConnectionState {
|
|
85
304
|
CatchingUp = 1,
|
|
@@ -121,6 +340,68 @@ export interface ContainerSchema {
|
|
|
121
340
|
readonly initialObjects: LoadableObjectClassRecord;
|
|
122
341
|
}
|
|
123
342
|
|
|
343
|
+
// @internal
|
|
344
|
+
export type ContextuallyTypedFieldData = ContextuallyTypedNodeData | undefined;
|
|
345
|
+
|
|
346
|
+
// @internal
|
|
347
|
+
export type ContextuallyTypedNodeData = ContextuallyTypedNodeDataObject | number | string | boolean | null | readonly ContextuallyTypedNodeData[] | MarkedArrayLike<ContextuallyTypedNodeData>;
|
|
348
|
+
|
|
349
|
+
// @internal
|
|
350
|
+
export interface ContextuallyTypedNodeDataObject {
|
|
351
|
+
readonly [typeNameSymbol]?: string;
|
|
352
|
+
readonly [valueSymbol]?: Value;
|
|
353
|
+
[key: FieldKey]: ContextuallyTypedFieldData;
|
|
354
|
+
[key: string]: ContextuallyTypedFieldData;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// @internal
|
|
358
|
+
export interface Contravariant<in T> {
|
|
359
|
+
// (undocumented)
|
|
360
|
+
_removeCovariance?: (_: T) => void;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// @internal
|
|
364
|
+
export interface Covariant<out T> {
|
|
365
|
+
// (undocumented)
|
|
366
|
+
_removeContravariance?: T;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// @internal
|
|
370
|
+
export function createEmitter<E extends Events<E>>(noListeners?: NoListenersCallback<E>): ISubscribable<E> & IEmitter<E> & HasListeners<E>;
|
|
371
|
+
|
|
372
|
+
// @internal
|
|
373
|
+
export interface CursorAdapter<TNode> {
|
|
374
|
+
// (undocumented)
|
|
375
|
+
getFieldFromNode(node: TNode, key: FieldKey): readonly TNode[];
|
|
376
|
+
// (undocumented)
|
|
377
|
+
keysFromNode(node: TNode): readonly FieldKey[];
|
|
378
|
+
// (undocumented)
|
|
379
|
+
type(node: TNode): TreeType;
|
|
380
|
+
// (undocumented)
|
|
381
|
+
value(node: TNode): Value;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// @internal
|
|
385
|
+
export function cursorForJsonableTreeNode(root: JsonableTree): ITreeCursorSynchronous;
|
|
386
|
+
|
|
387
|
+
// @internal
|
|
388
|
+
export function cursorForTypedTreeData<T extends FlexTreeNodeSchema>(context: TreeDataContext, schema: T, data: InsertableFlexNode<T>): ITreeCursorSynchronous;
|
|
389
|
+
|
|
390
|
+
// @internal
|
|
391
|
+
export function cursorFromContextualData(context: TreeDataContext, typeSet: AllowedTypeSet, data: ContextuallyTypedNodeData): ITreeCursorSynchronous;
|
|
392
|
+
|
|
393
|
+
// @internal (undocumented)
|
|
394
|
+
export const enum CursorLocationType {
|
|
395
|
+
Fields = 1,
|
|
396
|
+
Nodes = 0
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// @internal
|
|
400
|
+
export interface CursorWithNode<TNode> extends ITreeCursorSynchronous {
|
|
401
|
+
fork(): CursorWithNode<TNode>;
|
|
402
|
+
getNode(): TNode;
|
|
403
|
+
}
|
|
404
|
+
|
|
124
405
|
// @public
|
|
125
406
|
export type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
126
407
|
readonly factory: {
|
|
@@ -132,9 +413,107 @@ export type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
|
132
413
|
export interface DefaultProvider extends ErasedType<"@fluidframework/tree.FieldProvider"> {
|
|
133
414
|
}
|
|
134
415
|
|
|
416
|
+
// @internal
|
|
417
|
+
export const defaultSchemaPolicy: FullSchemaPolicy;
|
|
418
|
+
|
|
419
|
+
// @internal
|
|
420
|
+
export interface DeltaDetachedNodeBuild<TTree = DeltaProtoNode> {
|
|
421
|
+
// (undocumented)
|
|
422
|
+
readonly id: DeltaDetachedNodeId;
|
|
423
|
+
// (undocumented)
|
|
424
|
+
readonly trees: readonly TTree[];
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// @internal
|
|
428
|
+
export interface DeltaDetachedNodeChanges {
|
|
429
|
+
// (undocumented)
|
|
430
|
+
readonly fields: DeltaFieldMap;
|
|
431
|
+
// (undocumented)
|
|
432
|
+
readonly id: DeltaDetachedNodeId;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// @internal
|
|
436
|
+
export interface DeltaDetachedNodeDestruction {
|
|
437
|
+
// (undocumented)
|
|
438
|
+
readonly count: number;
|
|
439
|
+
// (undocumented)
|
|
440
|
+
readonly id: DeltaDetachedNodeId;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// @internal
|
|
444
|
+
export interface DeltaDetachedNodeId {
|
|
445
|
+
// (undocumented)
|
|
446
|
+
readonly major?: RevisionTag;
|
|
447
|
+
// (undocumented)
|
|
448
|
+
readonly minor: number;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// @internal
|
|
452
|
+
export interface DeltaDetachedNodeRename {
|
|
453
|
+
// (undocumented)
|
|
454
|
+
readonly count: number;
|
|
455
|
+
// (undocumented)
|
|
456
|
+
readonly newId: DeltaDetachedNodeId;
|
|
457
|
+
// (undocumented)
|
|
458
|
+
readonly oldId: DeltaDetachedNodeId;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// @internal
|
|
462
|
+
export interface DeltaFieldChanges {
|
|
463
|
+
readonly global?: readonly DeltaDetachedNodeChanges[];
|
|
464
|
+
readonly local?: readonly DeltaMark[];
|
|
465
|
+
readonly rename?: readonly DeltaDetachedNodeRename[];
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// @internal (undocumented)
|
|
469
|
+
export type DeltaFieldMap = ReadonlyMap<FieldKey, DeltaFieldChanges>;
|
|
470
|
+
|
|
471
|
+
// @internal
|
|
472
|
+
export interface DeltaMark {
|
|
473
|
+
readonly attach?: DeltaDetachedNodeId;
|
|
474
|
+
readonly count: number;
|
|
475
|
+
readonly detach?: DeltaDetachedNodeId;
|
|
476
|
+
readonly fields?: DeltaFieldMap;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// @internal
|
|
480
|
+
export type DeltaProtoNode = ITreeCursorSynchronous;
|
|
481
|
+
|
|
482
|
+
// @internal
|
|
483
|
+
export interface DeltaRoot<TTree = DeltaProtoNode> {
|
|
484
|
+
readonly build?: readonly DeltaDetachedNodeBuild<TTree>[];
|
|
485
|
+
readonly destroy?: readonly DeltaDetachedNodeDestruction[];
|
|
486
|
+
readonly fields?: DeltaFieldMap;
|
|
487
|
+
readonly refreshers?: readonly DeltaDetachedNodeBuild<TTree>[];
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// @internal
|
|
491
|
+
export interface DeltaVisitor {
|
|
492
|
+
attach(source: FieldKey, count: number, destination: PlaceIndex): void;
|
|
493
|
+
create(content: ProtoNodes, destination: FieldKey): void;
|
|
494
|
+
destroy(detachedField: FieldKey, count: number): void;
|
|
495
|
+
detach(source: Range_2, destination: FieldKey): void;
|
|
496
|
+
enterField(key: FieldKey): void;
|
|
497
|
+
enterNode(index: NodeIndex): void;
|
|
498
|
+
exitField(key: FieldKey): void;
|
|
499
|
+
exitNode(index: NodeIndex): void;
|
|
500
|
+
free(): void;
|
|
501
|
+
replace(newContentSource: FieldKey, range: Range_2, oldContentDestination: FieldKey): void;
|
|
502
|
+
}
|
|
503
|
+
|
|
135
504
|
// @alpha (undocumented)
|
|
136
505
|
export type DeserializeCallback = (properties: PropertySet) => void;
|
|
137
506
|
|
|
507
|
+
// @internal
|
|
508
|
+
export interface DetachedField extends Opaque<Brand<string, "tree.DetachedField">> {
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// @internal
|
|
512
|
+
export type DetachedPlaceUpPath = Brand<Omit<PlaceUpPath, "parent">, "DetachedRangeUpPath">;
|
|
513
|
+
|
|
514
|
+
// @internal
|
|
515
|
+
export type DetachedRangeUpPath = Brand<Omit<RangeUpPath, "parent">, "DetachedRangeUpPath">;
|
|
516
|
+
|
|
138
517
|
// @alpha @sealed
|
|
139
518
|
export class DirectoryFactory implements IChannelFactory<ISharedDirectory> {
|
|
140
519
|
static readonly Attributes: IChannelAttributes;
|
|
@@ -148,14 +527,58 @@ export class DirectoryFactory implements IChannelFactory<ISharedDirectory> {
|
|
|
148
527
|
// @public
|
|
149
528
|
export const disposeSymbol: unique symbol;
|
|
150
529
|
|
|
530
|
+
// @internal
|
|
531
|
+
export const EmptyKey: FieldKey;
|
|
532
|
+
|
|
533
|
+
// @internal
|
|
534
|
+
export type EmptyObject = {};
|
|
535
|
+
|
|
536
|
+
// @internal
|
|
537
|
+
export function encodeTreeSchema(schema: TreeStoredSchema): JsonCompatible;
|
|
538
|
+
|
|
539
|
+
// @internal
|
|
540
|
+
export function enumFromStrings<TScope extends string, const Members extends string>(factory: SchemaFactory<TScope>, members: Members[]): (<TValue extends Members>(value: TValue) => object & TreeNode & ObjectFromSchemaRecord<EmptyObject> & {
|
|
541
|
+
readonly value: TValue;
|
|
542
|
+
}) & Record<Members, TreeNodeSchemaClass<ScopedSchemaName<TScope, Members>, NodeKind.Object, object & TreeNode & ObjectFromSchemaRecord<EmptyObject> & {
|
|
543
|
+
readonly value: Members;
|
|
544
|
+
}, object & InsertableObjectFromSchemaRecord<EmptyObject>, true, unknown> & (new () => object & TreeNode & ObjectFromSchemaRecord<EmptyObject> & {
|
|
545
|
+
readonly value: Members;
|
|
546
|
+
})>;
|
|
547
|
+
|
|
548
|
+
// @internal
|
|
549
|
+
export interface ErasedTreeNodeSchemaDataFormat extends ErasedType<"TreeNodeSchemaDataFormat"> {
|
|
550
|
+
}
|
|
551
|
+
|
|
151
552
|
// @public
|
|
152
553
|
export type Events<E> = {
|
|
153
554
|
[P in (string | symbol) & keyof E as IsEvent<E[P]> extends true ? P : never]: E[P];
|
|
154
555
|
};
|
|
155
556
|
|
|
557
|
+
// @internal
|
|
558
|
+
export type ExtractFromOpaque<TOpaque extends BrandedType<any, unknown>> = TOpaque extends BrandedType<infer ValueType, infer Name> ? isAny<ValueType> extends true ? unknown : Brand<ValueType, Name> : never;
|
|
559
|
+
|
|
560
|
+
// @internal
|
|
561
|
+
export function extractFromOpaque<TOpaque extends BrandedType<any, unknown>>(value: TOpaque): ExtractFromOpaque<TOpaque>;
|
|
562
|
+
|
|
156
563
|
// @public
|
|
157
564
|
export type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result ? Result : Item;
|
|
158
565
|
|
|
566
|
+
// @internal (undocumented)
|
|
567
|
+
export function fail(message: string): never;
|
|
568
|
+
|
|
569
|
+
// @internal
|
|
570
|
+
export interface FieldAnchor {
|
|
571
|
+
// (undocumented)
|
|
572
|
+
fieldKey: FieldKey;
|
|
573
|
+
parent: Anchor | undefined;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
// @internal
|
|
577
|
+
export type FieldGenerator = () => MapTree[];
|
|
578
|
+
|
|
579
|
+
// @internal
|
|
580
|
+
export type FieldKey = Brand<string, "tree.FieldKey">;
|
|
581
|
+
|
|
159
582
|
// @public
|
|
160
583
|
export enum FieldKind {
|
|
161
584
|
Identifier = 2,
|
|
@@ -163,6 +586,40 @@ export enum FieldKind {
|
|
|
163
586
|
Required = 1
|
|
164
587
|
}
|
|
165
588
|
|
|
589
|
+
// @internal
|
|
590
|
+
export interface FieldKindData {
|
|
591
|
+
// (undocumented)
|
|
592
|
+
readonly identifier: FieldKindIdentifier;
|
|
593
|
+
// (undocumented)
|
|
594
|
+
readonly multiplicity: Multiplicity;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
// @internal
|
|
598
|
+
export type FieldKindIdentifier = Brand<string, "tree.FieldKindIdentifier">;
|
|
599
|
+
|
|
600
|
+
// @internal
|
|
601
|
+
export const FieldKinds: {
|
|
602
|
+
readonly required: Required_2;
|
|
603
|
+
readonly optional: Optional;
|
|
604
|
+
readonly sequence: Sequence;
|
|
605
|
+
readonly identifier: Identifier;
|
|
606
|
+
readonly forbidden: Forbidden;
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
// @internal
|
|
610
|
+
export interface FieldLocation {
|
|
611
|
+
// (undocumented)
|
|
612
|
+
readonly key: FieldKey;
|
|
613
|
+
// (undocumented)
|
|
614
|
+
readonly parent: ForestLocation;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// @internal
|
|
618
|
+
export interface FieldMapObject<TChild> {
|
|
619
|
+
// (undocumented)
|
|
620
|
+
[key: string]: TChild[];
|
|
621
|
+
}
|
|
622
|
+
|
|
166
623
|
// @public
|
|
167
624
|
export interface FieldProps {
|
|
168
625
|
readonly defaultProvider?: DefaultProvider;
|
|
@@ -185,12 +642,396 @@ export interface FieldSchemaUnsafe<out Kind extends FieldKind, out Types extends
|
|
|
185
642
|
readonly kind: Kind;
|
|
186
643
|
}
|
|
187
644
|
|
|
645
|
+
// @internal
|
|
646
|
+
export interface FieldUpPath<TUpPath extends UpPath = UpPath> {
|
|
647
|
+
readonly field: FieldKey;
|
|
648
|
+
readonly parent: TUpPath | undefined;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// @internal
|
|
652
|
+
export type FlattenKeys<T> = [{
|
|
653
|
+
[Property in keyof T]: T[Property];
|
|
654
|
+
}][_InlineTrick];
|
|
655
|
+
|
|
656
|
+
// @internal
|
|
657
|
+
export type FlexAllowedTypes = readonly [Any] | readonly LazyItem<FlexTreeNodeSchema>[];
|
|
658
|
+
|
|
659
|
+
// @internal @sealed
|
|
660
|
+
export abstract class FlexFieldKind<TName extends string = string, TMultiplicity extends Multiplicity = Multiplicity> implements FieldKindData {
|
|
661
|
+
protected constructor(identifier: TName & FieldKindIdentifier, multiplicity: TMultiplicity);
|
|
662
|
+
// (undocumented)
|
|
663
|
+
readonly identifier: TName & FieldKindIdentifier;
|
|
664
|
+
// (undocumented)
|
|
665
|
+
readonly multiplicity: TMultiplicity;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
// @internal
|
|
669
|
+
export class FlexFieldNodeSchema<Name extends string = string, Specification extends Unenforced<FlexFieldSchema> = FlexFieldSchema> extends TreeNodeSchemaBase<Name, Specification> {
|
|
670
|
+
// (undocumented)
|
|
671
|
+
static create<const Name extends string, const Specification extends FlexFieldSchema>(builder: Named<string>, name: TreeNodeSchemaIdentifier<Name>, specification: Specification): FlexFieldNodeSchema<Name, Specification>;
|
|
672
|
+
// (undocumented)
|
|
673
|
+
getFieldSchema(field?: FieldKey): FlexFieldSchema;
|
|
674
|
+
// (undocumented)
|
|
675
|
+
protected _typeCheck2?: MakeNominal;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// @internal @sealed
|
|
679
|
+
export class FlexFieldSchema<out TKind extends FlexFieldKind = FlexFieldKind, const out TTypes extends Unenforced<FlexAllowedTypes> = FlexAllowedTypes> {
|
|
680
|
+
// (undocumented)
|
|
681
|
+
readonly allowedTypes: TTypes;
|
|
682
|
+
get allowedTypeSet(): AllowedTypeSet;
|
|
683
|
+
static create<TKind extends FlexFieldKind, const Types extends FlexAllowedTypes>(kind: TKind, allowedTypes: Types): FlexFieldSchema<TKind, Types>;
|
|
684
|
+
static createUnsafe<TKind extends FlexFieldKind, const Types extends Unenforced<FlexAllowedTypes>>(kind: TKind, allowedTypes: Types): FlexFieldSchema<TKind, Types>;
|
|
685
|
+
static readonly empty: FlexFieldSchema<Forbidden_2, readonly []>;
|
|
686
|
+
equals(other: FlexFieldSchema): boolean;
|
|
687
|
+
// (undocumented)
|
|
688
|
+
readonly kind: TKind;
|
|
689
|
+
get monomorphicChildType(): FlexTreeNodeSchema | undefined;
|
|
690
|
+
// (undocumented)
|
|
691
|
+
readonly stored: TreeFieldStoredSchema;
|
|
692
|
+
// (undocumented)
|
|
693
|
+
protected _typeCheck?: MakeNominal;
|
|
694
|
+
get types(): TreeTypeSet;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// @internal
|
|
698
|
+
export type FlexibleFieldContent<TSchema extends FlexFieldSchema> = InsertableFlexField<TSchema> | ITreeCursorSynchronous;
|
|
699
|
+
|
|
700
|
+
// @internal
|
|
701
|
+
export type FlexibleNodeContent<TTypes extends FlexAllowedTypes> = AllowedTypesToFlexInsertableTree<TTypes> | ITreeCursorSynchronous;
|
|
702
|
+
|
|
703
|
+
// @internal
|
|
704
|
+
export type FlexibleNodeSubSequence<TTypes extends FlexAllowedTypes> = Iterable<AllowedTypesToFlexInsertableTree<TTypes>> | ITreeCursorSynchronous;
|
|
705
|
+
|
|
706
|
+
// @internal
|
|
707
|
+
export type FlexImplicitAllowedTypes = FlexAllowedTypes | FlexTreeNodeSchema | Any;
|
|
708
|
+
|
|
709
|
+
// @internal
|
|
710
|
+
export type FlexImplicitFieldSchema = FlexFieldSchema | FlexImplicitAllowedTypes;
|
|
711
|
+
|
|
188
712
|
// @public
|
|
189
713
|
export type FlexList<Item = unknown> = readonly LazyItem<Item>[];
|
|
190
714
|
|
|
191
715
|
// @public
|
|
192
716
|
export type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
|
|
193
717
|
|
|
718
|
+
// @internal
|
|
719
|
+
export type FlexMapFieldSchema = FlexFieldSchema<typeof FieldKinds.optional | typeof FieldKinds.sequence>;
|
|
720
|
+
|
|
721
|
+
// @internal (undocumented)
|
|
722
|
+
export class FlexMapNodeSchema<const out Name extends string = string, const out Specification extends Unenforced<FlexMapFieldSchema> = FlexMapFieldSchema> extends TreeNodeSchemaBase<Name, Specification> {
|
|
723
|
+
// (undocumented)
|
|
724
|
+
static create<const Name extends string, const Specification extends FlexMapFieldSchema>(builder: Named<string>, name: TreeNodeSchemaIdentifier<Name>, specification: Specification): FlexMapNodeSchema<Name, Specification>;
|
|
725
|
+
// (undocumented)
|
|
726
|
+
getFieldSchema(field: FieldKey): FlexMapFieldSchema;
|
|
727
|
+
// (undocumented)
|
|
728
|
+
get mapFields(): FlexMapFieldSchema;
|
|
729
|
+
// (undocumented)
|
|
730
|
+
protected _typeCheck2?: MakeNominal;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
// @internal (undocumented)
|
|
734
|
+
export interface FlexObjectNodeFields {
|
|
735
|
+
// (undocumented)
|
|
736
|
+
readonly [key: string]: FlexFieldSchema;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// @internal (undocumented)
|
|
740
|
+
export class FlexObjectNodeSchema<const out Name extends string = string, const out Specification extends Unenforced<FlexObjectNodeFields> = FlexObjectNodeFields> extends TreeNodeSchemaBase<Name, Specification> {
|
|
741
|
+
// (undocumented)
|
|
742
|
+
static create<const Name extends string, const Specification extends FlexObjectNodeFields>(builder: Named<string>, name: TreeNodeSchemaIdentifier<Name>, specification: Specification): FlexObjectNodeSchema<Name, Specification>;
|
|
743
|
+
// (undocumented)
|
|
744
|
+
getFieldSchema(field: FieldKey): FlexFieldSchema;
|
|
745
|
+
// (undocumented)
|
|
746
|
+
readonly objectNodeFields: ReadonlyMap<FieldKey, FlexFieldSchema>;
|
|
747
|
+
// (undocumented)
|
|
748
|
+
readonly objectNodeFieldsObject: NormalizeObjectNodeFields<Assume<Specification, FlexObjectNodeFields>>;
|
|
749
|
+
// (undocumented)
|
|
750
|
+
protected _typeCheck2?: MakeNominal;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
// @internal
|
|
754
|
+
export interface FlexTreeContext extends ISubscribable<ForestEvents> {
|
|
755
|
+
readonly checkout: ITreeCheckout;
|
|
756
|
+
// (undocumented)
|
|
757
|
+
readonly nodeKeyManager: NodeKeyManager;
|
|
758
|
+
get root(): FlexTreeField;
|
|
759
|
+
readonly schema: FlexTreeSchema;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
// @internal
|
|
763
|
+
export interface FlexTreeEntity<out TSchema = unknown> {
|
|
764
|
+
readonly [flexTreeMarker]: FlexTreeEntityKind;
|
|
765
|
+
boxedIterator(): IterableIterator<FlexTreeEntity>;
|
|
766
|
+
readonly context: FlexTreeContext;
|
|
767
|
+
readonly schema: TSchema;
|
|
768
|
+
treeStatus(): TreeStatus;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
// @internal (undocumented)
|
|
772
|
+
export enum FlexTreeEntityKind {
|
|
773
|
+
// (undocumented)
|
|
774
|
+
Field = 1,
|
|
775
|
+
// (undocumented)
|
|
776
|
+
Node = 0
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// @internal
|
|
780
|
+
export interface FlexTreeField extends FlexTreeEntity<FlexFieldSchema> {
|
|
781
|
+
// (undocumented)
|
|
782
|
+
readonly [flexTreeMarker]: FlexTreeEntityKind.Field;
|
|
783
|
+
boxedAt(index: number): FlexTreeNode | undefined;
|
|
784
|
+
// (undocumented)
|
|
785
|
+
boxedIterator(): IterableIterator<FlexTreeNode>;
|
|
786
|
+
is<TSchema extends FlexFieldSchema>(schema: TSchema): this is FlexTreeTypedField<TSchema>;
|
|
787
|
+
isSameAs(other: FlexTreeField): boolean;
|
|
788
|
+
readonly key: FieldKey;
|
|
789
|
+
readonly parent?: FlexTreeNode;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
// @internal
|
|
793
|
+
export interface FlexTreeFieldNode<in out TSchema extends FlexFieldNodeSchema> extends FlexTreeNode {
|
|
794
|
+
readonly boxedContent: FlexTreeTypedField<TSchema["info"]>;
|
|
795
|
+
readonly content: FlexTreeUnboxField<TSchema["info"]>;
|
|
796
|
+
// (undocumented)
|
|
797
|
+
readonly schema: TSchema;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// @internal
|
|
801
|
+
export interface FlexTreeLeafNode<in out TSchema extends LeafNodeSchema> extends FlexTreeNode {
|
|
802
|
+
// (undocumented)
|
|
803
|
+
readonly schema: TSchema;
|
|
804
|
+
readonly value: TreeValue<TSchema["info"]>;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
// @internal
|
|
808
|
+
export interface FlexTreeMapNode<in out TSchema extends FlexMapNodeSchema> extends FlexTreeNode {
|
|
809
|
+
// (undocumented)
|
|
810
|
+
[Symbol.iterator](): IterableIterator<[
|
|
811
|
+
FieldKey,
|
|
812
|
+
FlexTreeUnboxField<TSchema["info"], "notEmpty">
|
|
813
|
+
]>;
|
|
814
|
+
boxedIterator(): IterableIterator<FlexTreeTypedField<TSchema["info"]>>;
|
|
815
|
+
delete(key: string): void;
|
|
816
|
+
entries(): IterableIterator<[FieldKey, FlexTreeUnboxField<TSchema["info"], "notEmpty">]>;
|
|
817
|
+
forEach(callbackFn: (value: FlexTreeUnboxField<TSchema["info"], "notEmpty">, key: FieldKey, map: FlexTreeMapNode<TSchema>) => void, thisArg?: any): void;
|
|
818
|
+
get(key: string): FlexTreeUnboxField<TSchema["info"]>;
|
|
819
|
+
getBoxed(key: string): FlexTreeTypedField<TSchema["info"]>;
|
|
820
|
+
has(key: string): boolean;
|
|
821
|
+
keys(): IterableIterator<FieldKey>;
|
|
822
|
+
// (undocumented)
|
|
823
|
+
readonly schema: TSchema;
|
|
824
|
+
set(key: string, value: FlexibleFieldContent<TSchema["info"]>): void;
|
|
825
|
+
readonly size: number;
|
|
826
|
+
values(): IterableIterator<FlexTreeUnboxField<TSchema["info"], "notEmpty">>;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
// @internal
|
|
830
|
+
export const flexTreeMarker: unique symbol;
|
|
831
|
+
|
|
832
|
+
// @internal
|
|
833
|
+
export interface FlexTreeNode extends FlexTreeEntity<FlexTreeNodeSchema> {
|
|
834
|
+
// (undocumented)
|
|
835
|
+
readonly [flexTreeMarker]: FlexTreeEntityKind.Node;
|
|
836
|
+
readonly anchorNode: AnchorNode;
|
|
837
|
+
// (undocumented)
|
|
838
|
+
boxedIterator(): IterableIterator<FlexTreeField>;
|
|
839
|
+
getBoxed(key: FieldKey): FlexTreeField;
|
|
840
|
+
is<TSchema extends FlexTreeNodeSchema>(schema: TSchema): this is FlexTreeTypedNode<TSchema>;
|
|
841
|
+
on<K extends keyof FlexTreeNodeEvents>(eventName: K, listener: FlexTreeNodeEvents[K]): () => void;
|
|
842
|
+
readonly parentField: {
|
|
843
|
+
readonly parent: FlexTreeField;
|
|
844
|
+
readonly index: number;
|
|
845
|
+
};
|
|
846
|
+
tryGetField(key: FieldKey): undefined | FlexTreeField;
|
|
847
|
+
readonly value?: TreeValue;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
// @internal
|
|
851
|
+
export interface FlexTreeNodeEvents {
|
|
852
|
+
changing(upPath: UpPath): void;
|
|
853
|
+
subtreeChanging(upPath: UpPath): PathVisitor | void;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
// @internal
|
|
857
|
+
export interface FlexTreeNodeKeyField extends FlexTreeField {
|
|
858
|
+
// (undocumented)
|
|
859
|
+
readonly localNodeKey: LocalNodeKey;
|
|
860
|
+
// (undocumented)
|
|
861
|
+
readonly stableNodeKey: StableNodeKey;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
// @internal (undocumented)
|
|
865
|
+
export type FlexTreeNodeSchema = TreeNodeSchemaBase;
|
|
866
|
+
|
|
867
|
+
// @internal
|
|
868
|
+
export interface FlexTreeObjectNode extends FlexTreeNode {
|
|
869
|
+
readonly localNodeKey?: LocalNodeKey;
|
|
870
|
+
// (undocumented)
|
|
871
|
+
readonly schema: FlexObjectNodeSchema;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
// @internal
|
|
875
|
+
export type FlexTreeObjectNodeFields<TFields extends FlexObjectNodeFields> = FlexTreeObjectNodeFieldsInner<FlattenKeys<{
|
|
876
|
+
[key in keyof TFields as key extends PropertyNameFromFieldKey<key & string> ? key : never]: TFields[key];
|
|
877
|
+
} & {
|
|
878
|
+
[key in keyof TFields as key extends PropertyNameFromFieldKey<key & string> ? never : PropertyNameFromFieldKey<key & string>]: TFields[key];
|
|
879
|
+
}>>;
|
|
880
|
+
|
|
881
|
+
// @internal
|
|
882
|
+
export type FlexTreeObjectNodeFieldsInner<TFields extends FlexObjectNodeFields> = FlattenKeys<{
|
|
883
|
+
readonly [key in keyof TFields as `boxed${Capitalize<key & string>}`]: FlexTreeTypedField<TFields[key]>;
|
|
884
|
+
} & {
|
|
885
|
+
readonly [key in keyof TFields as TFields[key]["kind"] extends AssignableFieldKinds ? never : key]: FlexTreeUnboxField<TFields[key]>;
|
|
886
|
+
} & {
|
|
887
|
+
-readonly [key in keyof TFields as TFields[key]["kind"] extends AssignableFieldKinds ? key : never]: FlexTreeUnboxField<TFields[key]>;
|
|
888
|
+
} & {
|
|
889
|
+
readonly [key in keyof TFields as TFields[key]["kind"] extends AssignableFieldKinds ? `set${Capitalize<key & string>}` : never]: (content: FlexibleFieldContent<TFields[key]>) => void;
|
|
890
|
+
}>;
|
|
891
|
+
|
|
892
|
+
// @internal
|
|
893
|
+
export type FlexTreeObjectNodeTyped<TSchema extends FlexObjectNodeSchema> = FlexObjectNodeSchema extends TSchema ? FlexTreeObjectNode : FlexTreeObjectNode & FlexTreeObjectNodeFields<TSchema["info"]>;
|
|
894
|
+
|
|
895
|
+
// @internal
|
|
896
|
+
export interface FlexTreeOptionalField<in out TTypes extends FlexAllowedTypes> extends FlexTreeField {
|
|
897
|
+
// (undocumented)
|
|
898
|
+
readonly boxedContent?: FlexTreeTypedNodeUnion<TTypes>;
|
|
899
|
+
// (undocumented)
|
|
900
|
+
get content(): FlexTreeUnboxNodeUnion<TTypes> | undefined;
|
|
901
|
+
set content(newContent: FlexibleNodeContent<TTypes> | undefined);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
// @internal
|
|
905
|
+
export interface FlexTreeRequiredField<in out TTypes extends FlexAllowedTypes> extends FlexTreeField {
|
|
906
|
+
// (undocumented)
|
|
907
|
+
readonly boxedContent: FlexTreeTypedNodeUnion<TTypes>;
|
|
908
|
+
// (undocumented)
|
|
909
|
+
get content(): FlexTreeUnboxNodeUnion<TTypes>;
|
|
910
|
+
set content(content: FlexibleNodeContent<TTypes>);
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
// @internal
|
|
914
|
+
export interface FlexTreeSchema<out T extends FlexFieldSchema = FlexFieldSchema> extends SchemaCollection {
|
|
915
|
+
readonly adapters: Adapters;
|
|
916
|
+
readonly policy: FullSchemaPolicy;
|
|
917
|
+
readonly rootFieldSchema: T;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
// @internal
|
|
921
|
+
export interface FlexTreeSequenceField<in out TTypes extends FlexAllowedTypes> extends FlexTreeField {
|
|
922
|
+
// (undocumented)
|
|
923
|
+
[Symbol.iterator](): IterableIterator<FlexTreeUnboxNodeUnion<TTypes>>;
|
|
924
|
+
at(index: number): FlexTreeUnboxNodeUnion<TTypes> | undefined;
|
|
925
|
+
boxedAt(index: number): FlexTreeTypedNodeUnion<TTypes> | undefined;
|
|
926
|
+
// (undocumented)
|
|
927
|
+
boxedIterator(): IterableIterator<FlexTreeTypedNodeUnion<TTypes>>;
|
|
928
|
+
insertAt(index: number, value: FlexibleNodeSubSequence<TTypes>): void;
|
|
929
|
+
insertAtEnd(value: FlexibleNodeSubSequence<TTypes>): void;
|
|
930
|
+
insertAtStart(value: FlexibleNodeSubSequence<TTypes>): void;
|
|
931
|
+
// (undocumented)
|
|
932
|
+
readonly length: number;
|
|
933
|
+
map<U>(callbackfn: (value: FlexTreeUnboxNodeUnion<TTypes>, index: number) => U): U[];
|
|
934
|
+
mapBoxed<U>(callbackfn: (value: FlexTreeTypedNodeUnion<TTypes>, index: number) => U): U[];
|
|
935
|
+
moveRangeToEnd(sourceStart: number, sourceEnd: number): void;
|
|
936
|
+
moveRangeToEnd(sourceStart: number, sourceEnd: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
937
|
+
moveRangeToIndex(index: number, sourceStart: number, sourceEnd: number): void;
|
|
938
|
+
moveRangeToIndex(index: number, sourceStart: number, sourceEnd: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
939
|
+
moveRangeToStart(sourceStart: number, sourceEnd: number): void;
|
|
940
|
+
moveRangeToStart(sourceStart: number, sourceEnd: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
941
|
+
moveToEnd(sourceIndex: number): void;
|
|
942
|
+
moveToEnd(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
943
|
+
moveToIndex(index: number, sourceIndex: number): void;
|
|
944
|
+
moveToIndex(index: number, sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
945
|
+
moveToStart(sourceIndex: number): void;
|
|
946
|
+
moveToStart(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
947
|
+
removeAt(index: number): void;
|
|
948
|
+
sequenceEditor(): SequenceFieldEditBuilder;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// @internal
|
|
952
|
+
export type FlexTreeTypedField<TSchema extends FlexFieldSchema> = FlexTreeTypedFieldInner<TSchema["kind"], TSchema["allowedTypes"]>;
|
|
953
|
+
|
|
954
|
+
// @internal
|
|
955
|
+
export type FlexTreeTypedFieldInner<Kind extends FlexFieldKind, Types extends FlexAllowedTypes> = Kind extends typeof FieldKinds.sequence ? FlexTreeSequenceField<Types> : Kind extends typeof FieldKinds.required ? FlexTreeRequiredField<Types> : Kind extends typeof FieldKinds.optional ? FlexTreeOptionalField<Types> : FlexTreeField;
|
|
956
|
+
|
|
957
|
+
// @internal
|
|
958
|
+
export type FlexTreeTypedNode<TSchema extends FlexTreeNodeSchema> = TSchema extends LeafNodeSchema ? FlexTreeLeafNode<TSchema> : TSchema extends FlexMapNodeSchema ? FlexTreeMapNode<TSchema> : TSchema extends FlexFieldNodeSchema ? FlexTreeFieldNode<TSchema> : TSchema extends FlexObjectNodeSchema ? FlexTreeObjectNodeTyped<TSchema> : FlexTreeNode;
|
|
959
|
+
|
|
960
|
+
// @internal
|
|
961
|
+
export type FlexTreeTypedNodeUnion<T extends FlexAllowedTypes> = T extends FlexList<FlexTreeNodeSchema> ? FlexTreeTypedNode<Assume<FlexListToUnion<T>, FlexTreeNodeSchema>> : FlexTreeNode;
|
|
962
|
+
|
|
963
|
+
// @internal
|
|
964
|
+
export type FlexTreeUnboxField<TSchema extends FlexFieldSchema, Emptiness extends "maybeEmpty" | "notEmpty" = "maybeEmpty"> = FlexTreeUnboxFieldInner<TSchema["kind"], TSchema["allowedTypes"], Emptiness>;
|
|
965
|
+
|
|
966
|
+
// @internal
|
|
967
|
+
export type FlexTreeUnboxFieldInner<Kind extends FlexFieldKind, TTypes extends FlexAllowedTypes, Emptiness extends "maybeEmpty" | "notEmpty"> = Kind extends typeof FieldKinds.sequence ? FlexTreeSequenceField<TTypes> : Kind extends typeof FieldKinds.required ? FlexTreeUnboxNodeUnion<TTypes> : Kind extends typeof FieldKinds.optional ? FlexTreeUnboxNodeUnion<TTypes> | (Emptiness extends "notEmpty" ? never : undefined) : unknown;
|
|
968
|
+
|
|
969
|
+
// @internal
|
|
970
|
+
export type FlexTreeUnboxNode<TSchema extends FlexTreeNodeSchema> = TSchema extends LeafNodeSchema ? TreeValue<TSchema["info"]> : TSchema extends FlexMapNodeSchema ? FlexTreeMapNode<TSchema> : TSchema extends FlexFieldNodeSchema ? FlexTreeFieldNode<TSchema> : TSchema extends FlexObjectNodeSchema ? FlexTreeObjectNodeTyped<TSchema> : FlexTreeUnknownUnboxed;
|
|
971
|
+
|
|
972
|
+
// @internal
|
|
973
|
+
export type FlexTreeUnboxNodeUnion<TTypes extends FlexAllowedTypes> = TTypes extends readonly [
|
|
974
|
+
LazyItem<infer InnerType>
|
|
975
|
+
] ? InnerType extends FlexTreeNodeSchema ? FlexTreeUnboxNode<InnerType> : InnerType extends Any ? FlexTreeNode : unknown : boolean extends IsArrayOfOne<TTypes> ? FlexTreeUnknownUnboxed : FlexTreeTypedNodeUnion<TTypes>;
|
|
976
|
+
|
|
977
|
+
// @internal
|
|
978
|
+
export type FlexTreeUnknownUnboxed = TreeValue | FlexTreeNode;
|
|
979
|
+
|
|
980
|
+
// @internal
|
|
981
|
+
export interface FlexTreeView<in out TRoot extends FlexFieldSchema> extends IDisposable {
|
|
982
|
+
readonly checkout: ITreeCheckout;
|
|
983
|
+
readonly context: FlexTreeContext;
|
|
984
|
+
readonly flexTree: FlexTreeTypedField<TRoot>;
|
|
985
|
+
fork(): ITreeViewFork<TRoot>;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
// @internal (undocumented)
|
|
989
|
+
export interface Forbidden extends FlexFieldKind<typeof forbiddenFieldKindIdentifier, Multiplicity.Forbidden> {
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
// @internal
|
|
993
|
+
export const forbiddenFieldKindIdentifier = "Forbidden";
|
|
994
|
+
|
|
995
|
+
// @internal
|
|
996
|
+
export interface ForestEvents {
|
|
997
|
+
afterRootFieldCreated(key: FieldKey): void;
|
|
998
|
+
beforeChange(): void;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
// @internal
|
|
1002
|
+
export type ForestLocation = ITreeSubscriptionCursor | Anchor;
|
|
1003
|
+
|
|
1004
|
+
// @internal
|
|
1005
|
+
export enum ForestType {
|
|
1006
|
+
Optimized = 1,
|
|
1007
|
+
Reference = 0
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
// @internal
|
|
1011
|
+
export interface FullSchemaPolicy extends SchemaPolicy {
|
|
1012
|
+
readonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// @internal
|
|
1016
|
+
export interface GenericFieldsNode<TChild> {
|
|
1017
|
+
// (undocumented)
|
|
1018
|
+
fields?: FieldMapObject<TChild>;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
// @internal
|
|
1022
|
+
export interface GenericTreeNode<TChild> extends GenericFieldsNode<TChild>, NodeData {
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
// @internal (undocumented)
|
|
1026
|
+
export interface HasListeners<E extends Events<E>> {
|
|
1027
|
+
hasListeners(eventName?: keyof Events<E>): boolean;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
// @internal
|
|
1031
|
+
export interface ICodecOptions {
|
|
1032
|
+
readonly jsonValidator: JsonValidator;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
194
1035
|
// @public
|
|
195
1036
|
export interface IConnection {
|
|
196
1037
|
readonly id: string;
|
|
@@ -200,6 +1041,30 @@ export interface IConnection {
|
|
|
200
1041
|
// @public
|
|
201
1042
|
export type ICriticalContainerError = IErrorBase;
|
|
202
1043
|
|
|
1044
|
+
// @internal
|
|
1045
|
+
export interface IdAllocator<TId = number> {
|
|
1046
|
+
allocate: (count?: number) => TId;
|
|
1047
|
+
// (undocumented)
|
|
1048
|
+
getMaxId: () => TId;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
// @internal
|
|
1052
|
+
export interface IDefaultEditBuilder {
|
|
1053
|
+
// (undocumented)
|
|
1054
|
+
addNodeExistsConstraint(path: UpPath): void;
|
|
1055
|
+
move(sourceField: FieldUpPath, sourceIndex: number, count: number, destinationField: FieldUpPath, destinationIndex: number): void;
|
|
1056
|
+
// (undocumented)
|
|
1057
|
+
optionalField(field: FieldUpPath): OptionalFieldEditBuilder;
|
|
1058
|
+
// (undocumented)
|
|
1059
|
+
sequenceField(field: FieldUpPath): SequenceFieldEditBuilder;
|
|
1060
|
+
// (undocumented)
|
|
1061
|
+
valueField(field: FieldUpPath): ValueFieldEditBuilder;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
// @internal (undocumented)
|
|
1065
|
+
export interface Identifier extends FlexFieldKind<"Identifier", Multiplicity.Single> {
|
|
1066
|
+
}
|
|
1067
|
+
|
|
203
1068
|
// @alpha
|
|
204
1069
|
export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable_2> {
|
|
205
1070
|
readonly absolutePath: string;
|
|
@@ -233,6 +1098,17 @@ export interface IDisposable {
|
|
|
233
1098
|
[disposeSymbol](): void;
|
|
234
1099
|
}
|
|
235
1100
|
|
|
1101
|
+
// @internal
|
|
1102
|
+
export interface IEditableForest extends IForestSubscription {
|
|
1103
|
+
acquireVisitor(): DeltaVisitor;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
// @internal
|
|
1107
|
+
export interface IEmitter<E extends Events<E>> {
|
|
1108
|
+
emit<K extends keyof Events<E>>(eventName: K, ...args: Parameters<E[K]>): void;
|
|
1109
|
+
emitAndCollect<K extends keyof Events<E>>(eventName: K, ...args: Parameters<E[K]>): ReturnType<E[K]>[];
|
|
1110
|
+
}
|
|
1111
|
+
|
|
236
1112
|
// @public @sealed
|
|
237
1113
|
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
|
|
238
1114
|
attach(props?: ContainerAttachProps): Promise<string>;
|
|
@@ -256,6 +1132,19 @@ export interface IFluidContainerEvents extends IEvent {
|
|
|
256
1132
|
(event: "disposed", listener: (error?: ICriticalContainerError) => void): any;
|
|
257
1133
|
}
|
|
258
1134
|
|
|
1135
|
+
// @internal
|
|
1136
|
+
export interface IForestSubscription extends ISubscribable<ForestEvents> {
|
|
1137
|
+
allocateCursor(): ITreeSubscriptionCursor;
|
|
1138
|
+
readonly anchors: AnchorSet;
|
|
1139
|
+
clone(schema: TreeStoredSchemaSubscription, anchors: AnchorSet): IEditableForest;
|
|
1140
|
+
forgetAnchor(anchor: Anchor): void;
|
|
1141
|
+
getCursorAboveDetachedFields(): ITreeCursorSynchronous;
|
|
1142
|
+
readonly isEmpty: boolean;
|
|
1143
|
+
moveCursorToPath(destination: UpPath, cursorToMove: ITreeSubscriptionCursor): void;
|
|
1144
|
+
tryMoveCursorToField(destination: FieldAnchor, cursorToMove: ITreeSubscriptionCursor): TreeNavigationResult;
|
|
1145
|
+
tryMoveCursorToNode(destination: Anchor, cursorToMove: ITreeSubscriptionCursor): TreeNavigationResult;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
259
1148
|
// @alpha
|
|
260
1149
|
export interface IInterval {
|
|
261
1150
|
// (undocumented)
|
|
@@ -330,11 +1219,28 @@ export type ImplicitAllowedTypes = AllowedTypes | TreeNodeSchema;
|
|
|
330
1219
|
// @public
|
|
331
1220
|
export type ImplicitFieldSchema = FieldSchema | ImplicitAllowedTypes;
|
|
332
1221
|
|
|
1222
|
+
// @internal
|
|
1223
|
+
export interface InitializeAndSchematizeConfiguration<TRoot extends FlexFieldSchema = FlexFieldSchema> extends TreeContent<TRoot>, SchematizeConfiguration<TRoot> {
|
|
1224
|
+
}
|
|
1225
|
+
|
|
333
1226
|
// @public
|
|
334
1227
|
export type InitialObjects<T extends ContainerSchema> = {
|
|
335
1228
|
[K in keyof T["initialObjects"]]: T["initialObjects"][K] extends LoadableObjectClass<infer TChannel> ? TChannel : never;
|
|
336
1229
|
};
|
|
337
1230
|
|
|
1231
|
+
// @internal
|
|
1232
|
+
export type _InlineTrick = 0;
|
|
1233
|
+
|
|
1234
|
+
// @internal
|
|
1235
|
+
export type InsertableFlexField<TField extends FlexFieldSchema> = [
|
|
1236
|
+
ApplyMultiplicity<TField["kind"]["multiplicity"], AllowedTypesToFlexInsertableTree<TField["allowedTypes"]>>
|
|
1237
|
+
][_InlineTrick];
|
|
1238
|
+
|
|
1239
|
+
// @internal
|
|
1240
|
+
export type InsertableFlexNode<TSchema extends FlexTreeNodeSchema> = FlattenKeys<CollectOptions<TSchema extends FlexObjectNodeSchema<string, infer TFields extends FlexObjectNodeFields> ? TypedFields<TFields> : TSchema extends FlexFieldNodeSchema<string, infer TField extends FlexFieldSchema> ? InsertableFlexField<TField> : TSchema extends FlexMapNodeSchema<string, infer TField extends FlexFieldSchema> ? {
|
|
1241
|
+
readonly [P in string]: InsertableFlexField<TField>;
|
|
1242
|
+
} : EmptyObject, TSchema extends LeafNodeSchema<string, infer TValueSchema extends ValueSchema> ? TValueSchema : undefined, TSchema["name"]>>;
|
|
1243
|
+
|
|
338
1244
|
// @public
|
|
339
1245
|
export type InsertableObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = {
|
|
340
1246
|
readonly [Property in keyof T]: InsertableTreeFieldFromImplicitField<T[Property]>;
|
|
@@ -405,6 +1311,24 @@ export enum IntervalType {
|
|
|
405
1311
|
Transient = 4
|
|
406
1312
|
}
|
|
407
1313
|
|
|
1314
|
+
// @internal
|
|
1315
|
+
export interface Invariant<in out T> extends Contravariant<T>, Covariant<T> {
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
// @internal
|
|
1319
|
+
export type isAny<T> = boolean extends (T extends never ? true : false) ? true : false;
|
|
1320
|
+
|
|
1321
|
+
// @internal
|
|
1322
|
+
export type IsArrayOfOne<T extends readonly unknown[]> = T["length"] extends 1 ? true : 1 extends T["length"] ? boolean : false;
|
|
1323
|
+
|
|
1324
|
+
// @internal
|
|
1325
|
+
export interface ISchemaEditor {
|
|
1326
|
+
setStoredSchema(oldSchema: TreeStoredSchema, newSchema: TreeStoredSchema): void;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
// @internal
|
|
1330
|
+
export function isContextuallyTypedNodeDataObject(data: ContextuallyTypedNodeData | undefined): data is ContextuallyTypedNodeDataObject;
|
|
1331
|
+
|
|
408
1332
|
// @alpha
|
|
409
1333
|
export interface ISequenceDeltaRange<TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes> {
|
|
410
1334
|
operation: TOperation;
|
|
@@ -519,6 +1443,20 @@ export interface ISharedString extends SharedSegmentSequence<SharedStringSegment
|
|
|
519
1443
|
searchForMarker(startPos: number, markerLabel: string, forwards?: boolean): Marker | undefined;
|
|
520
1444
|
}
|
|
521
1445
|
|
|
1446
|
+
// @internal
|
|
1447
|
+
export interface ISharedTree extends ISharedObject, ITree {
|
|
1448
|
+
contentSnapshot(): SharedTreeContentSnapshot;
|
|
1449
|
+
schematizeFlexTree<TRoot extends FlexFieldSchema>(config: InitializeAndSchematizeConfiguration<TRoot>, onDispose: () => void): FlexTreeView<TRoot> | undefined;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
// @internal
|
|
1453
|
+
export interface ISharedTreeEditor extends IDefaultEditBuilder {
|
|
1454
|
+
schema: ISchemaEditor;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
// @internal (undocumented)
|
|
1458
|
+
export function isNeverField(policy: FullSchemaPolicy, originalData: TreeStoredSchema, field: TreeFieldStoredSchema): boolean;
|
|
1459
|
+
|
|
522
1460
|
// @public
|
|
523
1461
|
export interface ISubscribable<E extends Events<E>> {
|
|
524
1462
|
on<K extends keyof Events<E>>(eventName: K, listener: E[K]): () => void;
|
|
@@ -529,26 +1467,178 @@ export class IterableTreeArrayContent<T> implements Iterable<T> {
|
|
|
529
1467
|
[Symbol.iterator](): Iterator<T>;
|
|
530
1468
|
}
|
|
531
1469
|
|
|
1470
|
+
// @internal
|
|
1471
|
+
export interface ITransaction {
|
|
1472
|
+
abort(): TransactionResult.Abort;
|
|
1473
|
+
commit(): TransactionResult.Commit;
|
|
1474
|
+
inProgress(): boolean;
|
|
1475
|
+
start(): void;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
532
1478
|
// @public
|
|
533
1479
|
export interface ITree extends IChannel {
|
|
534
1480
|
schematize<TRoot extends ImplicitFieldSchema>(config: TreeConfiguration<TRoot>): TreeView<TRoot>;
|
|
535
1481
|
}
|
|
536
1482
|
|
|
1483
|
+
// @internal
|
|
1484
|
+
export interface ITreeCheckout extends AnchorLocator {
|
|
1485
|
+
readonly editor: ISharedTreeEditor;
|
|
1486
|
+
readonly events: ISubscribable<CheckoutEvents>;
|
|
1487
|
+
readonly forest: IForestSubscription;
|
|
1488
|
+
fork(): ITreeCheckoutFork;
|
|
1489
|
+
getRemovedRoots(): [string | number | undefined, number, JsonableTree][];
|
|
1490
|
+
merge(view: ITreeCheckoutFork): void;
|
|
1491
|
+
merge(view: ITreeCheckoutFork, disposeView: boolean): void;
|
|
1492
|
+
rebase(view: ITreeCheckoutFork): void;
|
|
1493
|
+
readonly rootEvents: ISubscribable<AnchorSetRootEvents>;
|
|
1494
|
+
readonly storedSchema: TreeStoredSchemaSubscription;
|
|
1495
|
+
readonly transaction: ITransaction;
|
|
1496
|
+
updateSchema(newSchema: TreeStoredSchema): void;
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
// @internal
|
|
1500
|
+
export interface ITreeCheckoutFork extends ITreeCheckout, IDisposable {
|
|
1501
|
+
rebaseOnto(view: ITreeCheckout): void;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
// @internal
|
|
1505
|
+
export interface ITreeCursor {
|
|
1506
|
+
readonly [CursorMarker]: true;
|
|
1507
|
+
readonly chunkLength: number;
|
|
1508
|
+
readonly chunkStart: number;
|
|
1509
|
+
enterField(key: FieldKey): void;
|
|
1510
|
+
enterNode(childIndex: number): void;
|
|
1511
|
+
exitField(): void;
|
|
1512
|
+
exitNode(): void;
|
|
1513
|
+
readonly fieldIndex: number;
|
|
1514
|
+
firstField(): boolean;
|
|
1515
|
+
firstNode(): boolean;
|
|
1516
|
+
getFieldKey(): FieldKey;
|
|
1517
|
+
// (undocumented)
|
|
1518
|
+
getFieldLength(): number;
|
|
1519
|
+
getFieldPath(prefix?: PathRootPrefix): FieldUpPath;
|
|
1520
|
+
getPath(prefix?: PathRootPrefix): UpPath | undefined;
|
|
1521
|
+
readonly mode: CursorLocationType;
|
|
1522
|
+
nextField(): boolean;
|
|
1523
|
+
nextNode(): boolean;
|
|
1524
|
+
// (undocumented)
|
|
1525
|
+
readonly pending: boolean;
|
|
1526
|
+
seekNodes(offset: number): boolean;
|
|
1527
|
+
skipPendingFields(): boolean;
|
|
1528
|
+
readonly type: TreeType;
|
|
1529
|
+
readonly value: Value;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
// @internal
|
|
1533
|
+
export interface ITreeCursorSynchronous extends ITreeCursor {
|
|
1534
|
+
// (undocumented)
|
|
1535
|
+
readonly pending: false;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
// @internal
|
|
1539
|
+
export interface ITreeSubscriptionCursor extends ITreeCursor {
|
|
1540
|
+
buildAnchor(): Anchor;
|
|
1541
|
+
buildFieldAnchor(): FieldAnchor;
|
|
1542
|
+
clear(): void;
|
|
1543
|
+
// (undocumented)
|
|
1544
|
+
fork(): ITreeSubscriptionCursor;
|
|
1545
|
+
free(): void;
|
|
1546
|
+
readonly state: ITreeSubscriptionCursorState;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
// @internal (undocumented)
|
|
1550
|
+
export enum ITreeSubscriptionCursorState {
|
|
1551
|
+
Cleared = 1,
|
|
1552
|
+
Current = 0,
|
|
1553
|
+
Freed = 2
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
// @internal
|
|
1557
|
+
export interface ITreeViewFork<in out TRoot extends FlexFieldSchema> extends FlexTreeView<TRoot> {
|
|
1558
|
+
// (undocumented)
|
|
1559
|
+
readonly checkout: ITreeCheckoutFork;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
537
1562
|
// @alpha @sealed
|
|
538
1563
|
export interface IValueChanged {
|
|
539
1564
|
readonly key: string;
|
|
540
1565
|
readonly previousValue: any;
|
|
541
1566
|
}
|
|
542
1567
|
|
|
1568
|
+
// @internal
|
|
1569
|
+
export interface JsonableTree extends GenericTreeNode<JsonableTree> {
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
// @internal
|
|
1573
|
+
export function jsonableTreeFromCursor(cursor: ITreeCursor): JsonableTree;
|
|
1574
|
+
|
|
1575
|
+
// @internal
|
|
1576
|
+
export type JsonCompatible = string | number | boolean | null | JsonCompatible[] | JsonCompatibleObject;
|
|
1577
|
+
|
|
1578
|
+
// @internal
|
|
1579
|
+
export type JsonCompatibleObject = {
|
|
1580
|
+
[P in string]?: JsonCompatible;
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1583
|
+
// @internal
|
|
1584
|
+
export type JsonCompatibleReadOnly = string | number | boolean | null | readonly JsonCompatibleReadOnly[] | {
|
|
1585
|
+
readonly [P in string]?: JsonCompatibleReadOnly;
|
|
1586
|
+
};
|
|
1587
|
+
|
|
1588
|
+
// @internal
|
|
1589
|
+
export interface JsonValidator {
|
|
1590
|
+
compile<Schema extends TSchema>(schema: Schema): SchemaValidationFunction<Schema>;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
543
1593
|
// @public
|
|
544
1594
|
export type LazyItem<Item = unknown> = Item | (() => Item);
|
|
545
1595
|
|
|
1596
|
+
// @internal
|
|
1597
|
+
export type LazyTreeNodeSchema = FlexTreeNodeSchema | (() => FlexTreeNodeSchema);
|
|
1598
|
+
|
|
1599
|
+
// @internal
|
|
1600
|
+
export const leaf: {
|
|
1601
|
+
number: LeafNodeSchema_2<"com.fluidframework.leaf.number", ValueSchema.Number>;
|
|
1602
|
+
boolean: LeafNodeSchema_2<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>;
|
|
1603
|
+
string: LeafNodeSchema_2<"com.fluidframework.leaf.string", ValueSchema.String>;
|
|
1604
|
+
handle: LeafNodeSchema_2<"com.fluidframework.leaf.handle", ValueSchema.FluidHandle>;
|
|
1605
|
+
null: LeafNodeSchema_2<"com.fluidframework.leaf.null", ValueSchema.Null>;
|
|
1606
|
+
primitives: readonly [LeafNodeSchema_2<"com.fluidframework.leaf.number", ValueSchema.Number>, LeafNodeSchema_2<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, LeafNodeSchema_2<"com.fluidframework.leaf.string", ValueSchema.String>];
|
|
1607
|
+
all: readonly [LeafNodeSchema_2<"com.fluidframework.leaf.handle", ValueSchema.FluidHandle>, LeafNodeSchema_2<"com.fluidframework.leaf.null", ValueSchema.Null>, LeafNodeSchema_2<"com.fluidframework.leaf.number", ValueSchema.Number>, LeafNodeSchema_2<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, LeafNodeSchema_2<"com.fluidframework.leaf.string", ValueSchema.String>];
|
|
1608
|
+
library: SchemaLibrary_2;
|
|
1609
|
+
};
|
|
1610
|
+
|
|
1611
|
+
// @internal (undocumented)
|
|
1612
|
+
export class LeafNodeSchema<const out Name extends string = string, const out Specification extends Unenforced<ValueSchema> = ValueSchema> extends TreeNodeSchemaBase<Name, Specification> {
|
|
1613
|
+
// (undocumented)
|
|
1614
|
+
static create<const Name extends string, const Specification extends ValueSchema>(builder: Named<string>, name: TreeNodeSchemaIdentifier<Name>, specification: Specification): LeafNodeSchema<Name, Specification>;
|
|
1615
|
+
// (undocumented)
|
|
1616
|
+
getFieldSchema(field: FieldKey): FlexFieldSchema;
|
|
1617
|
+
// (undocumented)
|
|
1618
|
+
get leafValue(): ValueSchema;
|
|
1619
|
+
// (undocumented)
|
|
1620
|
+
protected _typeCheck2?: MakeNominal;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
// @internal (undocumented)
|
|
1624
|
+
export class LeafNodeStoredSchema extends TreeNodeStoredSchema {
|
|
1625
|
+
constructor(leafValue: ValueSchema);
|
|
1626
|
+
// (undocumented)
|
|
1627
|
+
encode(): ErasedTreeNodeSchemaDataFormat;
|
|
1628
|
+
// (undocumented)
|
|
1629
|
+
readonly leafValue: ValueSchema;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
546
1632
|
// @public
|
|
547
1633
|
export type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = ISharedObjectKind<T> | DataObjectClass<T>;
|
|
548
1634
|
|
|
549
1635
|
// @public
|
|
550
1636
|
export type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
|
|
551
1637
|
|
|
1638
|
+
// @internal
|
|
1639
|
+
export interface LocalNodeKey extends Opaque<Brand<SessionSpaceCompressedId, "Local Node Key">> {
|
|
1640
|
+
}
|
|
1641
|
+
|
|
552
1642
|
// @public
|
|
553
1643
|
export interface MakeNominal {
|
|
554
1644
|
}
|
|
@@ -563,26 +1653,87 @@ export class MapFactory implements IChannelFactory<ISharedMap> {
|
|
|
563
1653
|
get type(): string;
|
|
564
1654
|
}
|
|
565
1655
|
|
|
1656
|
+
// @internal (undocumented)
|
|
1657
|
+
export class MapNodeStoredSchema extends TreeNodeStoredSchema {
|
|
1658
|
+
constructor(mapFields: TreeFieldStoredSchema);
|
|
1659
|
+
// (undocumented)
|
|
1660
|
+
encode(): ErasedTreeNodeSchemaDataFormat;
|
|
1661
|
+
// (undocumented)
|
|
1662
|
+
readonly mapFields: TreeFieldStoredSchema;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
// @internal
|
|
1666
|
+
export interface MapTree extends NodeData {
|
|
1667
|
+
// (undocumented)
|
|
1668
|
+
fields: Map<FieldKey, MapTree[]>;
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
// @internal
|
|
1672
|
+
export interface MarkedArrayLike<TGet, TSet extends TGet = TGet> extends ArrayLikeMut<TGet, TSet> {
|
|
1673
|
+
// (undocumented)
|
|
1674
|
+
readonly [arrayLikeMarkerSymbol]: true;
|
|
1675
|
+
// (undocumented)
|
|
1676
|
+
[Symbol.iterator](): IterableIterator<TGet>;
|
|
1677
|
+
}
|
|
1678
|
+
|
|
566
1679
|
// @public
|
|
567
1680
|
export type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
|
|
568
1681
|
|
|
1682
|
+
// @internal
|
|
1683
|
+
export enum Multiplicity {
|
|
1684
|
+
Forbidden = 3,
|
|
1685
|
+
Optional = 1,
|
|
1686
|
+
Sequence = 2,
|
|
1687
|
+
Single = 0
|
|
1688
|
+
}
|
|
1689
|
+
|
|
569
1690
|
// @public
|
|
570
1691
|
export type Myself<M extends IMember = IMember> = M & {
|
|
571
1692
|
readonly currentConnection: string;
|
|
572
1693
|
};
|
|
573
1694
|
|
|
1695
|
+
// @internal
|
|
1696
|
+
export interface Named<TName> {
|
|
1697
|
+
// (undocumented)
|
|
1698
|
+
readonly name: TName;
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
// @internal
|
|
1702
|
+
export type NameFromBranded<T extends BrandedType<unknown, unknown>> = T extends BrandedType<unknown, infer Name> ? Name : never;
|
|
1703
|
+
|
|
1704
|
+
// @internal
|
|
1705
|
+
export type NestedMap<Key1, Key2, Value> = Map<Key1, Map<Key2, Value>>;
|
|
1706
|
+
|
|
1707
|
+
// @internal
|
|
1708
|
+
export type NewFieldContent = ITreeCursorSynchronous | readonly ITreeCursorSynchronous[] | ContextuallyTypedFieldData;
|
|
1709
|
+
|
|
574
1710
|
// @public
|
|
575
1711
|
export type NodeBuilderData<T extends TreeNodeSchema> = T extends TreeNodeSchema<string, NodeKind, unknown, infer TBuild> ? TBuild : never;
|
|
576
1712
|
|
|
577
1713
|
// @public
|
|
578
1714
|
export type NodeBuilderDataUnsafe<T extends Unenforced<TreeNodeSchema>> = T extends TreeNodeSchema<string, NodeKind, unknown, infer TBuild> ? TBuild : never;
|
|
579
1715
|
|
|
1716
|
+
// @internal
|
|
1717
|
+
export interface NodeData {
|
|
1718
|
+
readonly type: TreeNodeSchemaIdentifier;
|
|
1719
|
+
value?: TreeValue;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
// @internal (undocumented)
|
|
1723
|
+
export interface NodeExistsConstraint {
|
|
1724
|
+
// (undocumented)
|
|
1725
|
+
violated: boolean;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
580
1728
|
// @public
|
|
581
1729
|
export type NodeFromSchema<T extends TreeNodeSchema> = T extends TreeNodeSchema<string, NodeKind, infer TNode> ? TNode : never;
|
|
582
1730
|
|
|
583
1731
|
// @public
|
|
584
1732
|
export type NodeFromSchemaUnsafe<T extends Unenforced<TreeNodeSchema>> = T extends TreeNodeSchema<string, NodeKind, infer TNode> ? TNode : never;
|
|
585
1733
|
|
|
1734
|
+
// @internal
|
|
1735
|
+
export type NodeIndex = number;
|
|
1736
|
+
|
|
586
1737
|
// @public
|
|
587
1738
|
export interface NodeInDocumentConstraint {
|
|
588
1739
|
// (undocumented)
|
|
@@ -591,6 +1742,14 @@ export interface NodeInDocumentConstraint {
|
|
|
591
1742
|
type: "nodeInDocument";
|
|
592
1743
|
}
|
|
593
1744
|
|
|
1745
|
+
// @internal
|
|
1746
|
+
export interface NodeKeyManager {
|
|
1747
|
+
generateLocalNodeKey(): LocalNodeKey;
|
|
1748
|
+
localizeNodeKey(key: StableNodeKey): LocalNodeKey;
|
|
1749
|
+
stabilizeNodeKey(key: LocalNodeKey): StableNodeKey;
|
|
1750
|
+
tryLocalizeNodeKey(key: string): LocalNodeKey | undefined;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
594
1753
|
// @public
|
|
595
1754
|
export enum NodeKind {
|
|
596
1755
|
Array = 1,
|
|
@@ -599,6 +1758,26 @@ export enum NodeKind {
|
|
|
599
1758
|
Object = 2
|
|
600
1759
|
}
|
|
601
1760
|
|
|
1761
|
+
// @internal
|
|
1762
|
+
export type NoListenersCallback<E extends Events<E>> = (eventName: keyof Events<E>) => void;
|
|
1763
|
+
|
|
1764
|
+
// @internal
|
|
1765
|
+
export const noopValidator: JsonValidator;
|
|
1766
|
+
|
|
1767
|
+
// @internal
|
|
1768
|
+
export type NormalizeAllowedTypes<TSchema extends FlexImplicitAllowedTypes> = TSchema extends FlexTreeNodeSchema ? readonly [TSchema] : TSchema extends Any ? readonly [Any] : TSchema;
|
|
1769
|
+
|
|
1770
|
+
// @internal
|
|
1771
|
+
export type NormalizeField<TSchema extends FlexImplicitFieldSchema, TDefault extends FlexFieldKind> = TSchema extends FlexFieldSchema ? TSchema : FlexFieldSchema<TDefault, NormalizeAllowedTypes<Assume<TSchema, FlexImplicitAllowedTypes>>>;
|
|
1772
|
+
|
|
1773
|
+
// @internal
|
|
1774
|
+
export type NormalizeFieldSchema<T extends FlexFieldSchema | undefined> = T extends FlexFieldSchema ? T : FlexFieldSchema<typeof FieldKinds.forbidden, []>;
|
|
1775
|
+
|
|
1776
|
+
// @internal (undocumented)
|
|
1777
|
+
export type NormalizeObjectNodeFields<T extends FlexObjectNodeFields> = {
|
|
1778
|
+
readonly [Property in keyof T]: NormalizeFieldSchema<T[Property]>;
|
|
1779
|
+
};
|
|
1780
|
+
|
|
602
1781
|
// @public
|
|
603
1782
|
export type ObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = {
|
|
604
1783
|
-readonly [Property in keyof T]: TreeFieldFromImplicitField<T[Property]>;
|
|
@@ -609,6 +1788,124 @@ export type ObjectFromSchemaRecordUnsafe<T extends Unenforced<RestrictiveReadonl
|
|
|
609
1788
|
-readonly [Property in keyof T]: TreeFieldFromImplicitFieldUnsafe<T[Property]>;
|
|
610
1789
|
};
|
|
611
1790
|
|
|
1791
|
+
// @internal (undocumented)
|
|
1792
|
+
export class ObjectNodeStoredSchema extends TreeNodeStoredSchema {
|
|
1793
|
+
constructor(objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>);
|
|
1794
|
+
// (undocumented)
|
|
1795
|
+
encode(): ErasedTreeNodeSchemaDataFormat;
|
|
1796
|
+
// (undocumented)
|
|
1797
|
+
readonly objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
// @internal
|
|
1801
|
+
export function oneFromSet<T>(set: ReadonlySet<T> | undefined): T | undefined;
|
|
1802
|
+
|
|
1803
|
+
// @internal
|
|
1804
|
+
export type Opaque<T extends Brand<any, unknown>> = T extends BrandedType<infer ValueType, infer Name> ? BrandedType<ValueType, Name> : never;
|
|
1805
|
+
|
|
1806
|
+
// @internal (undocumented)
|
|
1807
|
+
export interface Optional extends FlexFieldKind<"Optional", Multiplicity.Optional> {
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
// @internal (undocumented)
|
|
1811
|
+
export interface OptionalFieldEditBuilder {
|
|
1812
|
+
set(newContent: ITreeCursorSynchronous | undefined, wasEmpty: boolean): void;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
// @internal
|
|
1816
|
+
export type OptionalFields<T> = [
|
|
1817
|
+
{
|
|
1818
|
+
[P in keyof T as undefined extends T[P] ? T[P] extends undefined ? never : P : never]?: T[P];
|
|
1819
|
+
}
|
|
1820
|
+
][_InlineTrick];
|
|
1821
|
+
|
|
1822
|
+
// @internal
|
|
1823
|
+
export interface PathRootPrefix {
|
|
1824
|
+
indexOffset?: number;
|
|
1825
|
+
parent?: UpPath | undefined;
|
|
1826
|
+
rootFieldOverride?: FieldKey;
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
// @internal
|
|
1830
|
+
export interface PathVisitor {
|
|
1831
|
+
afterAttach(source: DetachedPlaceUpPath, destination: RangeUpPath): void;
|
|
1832
|
+
afterCreate(content: DetachedRangeUpPath): void;
|
|
1833
|
+
afterDetach(source: PlaceUpPath, destination: DetachedRangeUpPath): void;
|
|
1834
|
+
afterReplace(newContentSource: DetachedPlaceUpPath, newContent: RangeUpPath, oldContent: DetachedRangeUpPath): void;
|
|
1835
|
+
beforeAttach(source: DetachedRangeUpPath, destination: PlaceUpPath): void;
|
|
1836
|
+
beforeDestroy(content: DetachedRangeUpPath): void;
|
|
1837
|
+
beforeDetach(source: RangeUpPath, destination: DetachedPlaceUpPath): void;
|
|
1838
|
+
beforeReplace(newContent: DetachedRangeUpPath, oldContent: RangeUpPath, oldContentDestination: DetachedPlaceUpPath): void;
|
|
1839
|
+
// @deprecated (undocumented)
|
|
1840
|
+
onInsert(path: UpPath, content: ProtoNodes): void;
|
|
1841
|
+
// @deprecated
|
|
1842
|
+
onRemove(path: UpPath, count: number): void;
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
// @internal
|
|
1846
|
+
export type PlaceIndex = number;
|
|
1847
|
+
|
|
1848
|
+
// @internal
|
|
1849
|
+
export interface PlaceUpPath<TUpPath extends UpPath = UpPath> extends FieldUpPath<TUpPath> {
|
|
1850
|
+
readonly index: PlaceIndex;
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
// @internal
|
|
1854
|
+
export function prefixFieldPath(prefix: PathRootPrefix | undefined, path: FieldUpPath): FieldUpPath;
|
|
1855
|
+
|
|
1856
|
+
// @internal
|
|
1857
|
+
export function prefixPath(prefix: PathRootPrefix | undefined, path: UpPath | undefined): UpPath | undefined;
|
|
1858
|
+
|
|
1859
|
+
// @internal
|
|
1860
|
+
export type PropertyNameFromFieldKey<T extends string> = T extends ReservedObjectNodeFieldPropertyNames ? `field${Capitalize<T>}` : T extends `${ReservedObjectNodeFieldPropertyNamePrefixes}${Capitalize<string>}` ? `field${Capitalize<T>}` : T;
|
|
1861
|
+
|
|
1862
|
+
// @internal
|
|
1863
|
+
export type ProtoNodes = readonly DeltaProtoNode[];
|
|
1864
|
+
|
|
1865
|
+
// @internal
|
|
1866
|
+
interface Range_2 {
|
|
1867
|
+
readonly end: PlaceIndex;
|
|
1868
|
+
readonly start: PlaceIndex;
|
|
1869
|
+
}
|
|
1870
|
+
export { Range_2 as Range }
|
|
1871
|
+
|
|
1872
|
+
// @internal
|
|
1873
|
+
export interface RangeQueryResult<T> {
|
|
1874
|
+
length: number;
|
|
1875
|
+
value: T | undefined;
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
// @internal
|
|
1879
|
+
export interface RangeUpPath<TUpPath extends UpPath = UpPath> extends FieldUpPath<TUpPath>, Range_2 {
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
// @internal
|
|
1883
|
+
export type _RecursiveTrick = never;
|
|
1884
|
+
|
|
1885
|
+
// @internal (undocumented)
|
|
1886
|
+
interface Required_2 extends FlexFieldKind<"Value", Multiplicity.Single> {
|
|
1887
|
+
}
|
|
1888
|
+
export { Required_2 as Required }
|
|
1889
|
+
|
|
1890
|
+
// @internal
|
|
1891
|
+
export type RequiredFields<T> = [
|
|
1892
|
+
{
|
|
1893
|
+
[P in keyof T as undefined extends T[P] ? never : P]: T[P];
|
|
1894
|
+
}
|
|
1895
|
+
][_InlineTrick];
|
|
1896
|
+
|
|
1897
|
+
// @internal
|
|
1898
|
+
export type ReservedObjectNodeFieldPropertyNamePrefixes = (typeof reservedObjectNodeFieldPropertyNamePrefixes)[number];
|
|
1899
|
+
|
|
1900
|
+
// @internal
|
|
1901
|
+
export const reservedObjectNodeFieldPropertyNamePrefixes: readonly ["set", "boxed", "field", "Field"];
|
|
1902
|
+
|
|
1903
|
+
// @internal
|
|
1904
|
+
export type ReservedObjectNodeFieldPropertyNames = (typeof reservedObjectNodeFieldPropertyNames)[number];
|
|
1905
|
+
|
|
1906
|
+
// @internal
|
|
1907
|
+
export const reservedObjectNodeFieldPropertyNames: readonly ["anchorNode", "constructor", "context", "is", "on", "parentField", "schema", "treeStatus", "tryGetField", "type", "value", "boxedIterator", "iterator", "getBoxed"];
|
|
1908
|
+
|
|
612
1909
|
// @public
|
|
613
1910
|
export type RestrictiveReadonlyRecord<K extends symbol | string, T> = {
|
|
614
1911
|
readonly [P in symbol | string]: P extends K ? T : never;
|
|
@@ -631,9 +1928,27 @@ export enum RevertibleStatus {
|
|
|
631
1928
|
Valid = 0
|
|
632
1929
|
}
|
|
633
1930
|
|
|
1931
|
+
// @internal
|
|
1932
|
+
export type RevisionTag = SessionSpaceCompressedId | "root";
|
|
1933
|
+
|
|
634
1934
|
// @public
|
|
635
1935
|
export const rollback: unique symbol;
|
|
636
1936
|
|
|
1937
|
+
// @internal
|
|
1938
|
+
export interface RootField {
|
|
1939
|
+
// (undocumented)
|
|
1940
|
+
readonly key: DetachedField;
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
// @internal (undocumented)
|
|
1944
|
+
export const rootField: DetachedField;
|
|
1945
|
+
|
|
1946
|
+
// @internal
|
|
1947
|
+
export const rootFieldKey: FieldKey;
|
|
1948
|
+
|
|
1949
|
+
// @internal
|
|
1950
|
+
export function runSynchronous(view: ITreeCheckout, transaction: (view: ITreeCheckout) => TransactionResult | void): TransactionResult;
|
|
1951
|
+
|
|
637
1952
|
// @public
|
|
638
1953
|
export interface RunTransaction {
|
|
639
1954
|
<TNode extends TreeNode, TResult>(node: TNode, transaction: (node: TNode) => TResult): TResult;
|
|
@@ -651,6 +1966,54 @@ export interface RunTransaction {
|
|
|
651
1966
|
readonly rollback: typeof rollback;
|
|
652
1967
|
}
|
|
653
1968
|
|
|
1969
|
+
// @internal
|
|
1970
|
+
export class SchemaBuilderBase<TScope extends string, TDefaultKind extends FlexFieldKind, TName extends number | string = string> {
|
|
1971
|
+
constructor(defaultKind: TDefaultKind, options: SchemaBuilderOptions<TScope>);
|
|
1972
|
+
// (undocumented)
|
|
1973
|
+
protected addNodeSchema<T extends FlexTreeNodeSchema>(schema: T): void;
|
|
1974
|
+
static field<Kind extends FlexFieldKind, T extends FlexImplicitAllowedTypes>(kind: Kind, allowedTypes: T): FlexFieldSchema<Kind, NormalizeAllowedTypes<T>>;
|
|
1975
|
+
fieldNode<Name extends TName, const T extends FlexImplicitFieldSchema>(name: Name, fieldSchema: T): FlexFieldNodeSchema<`${TScope}.${Name}`, NormalizeField<T, TDefaultKind>>;
|
|
1976
|
+
fieldNodeRecursive<Name extends TName, const T extends Unenforced<FlexImplicitFieldSchema>>(name: Name, t: T): FlexFieldNodeSchema<`${TScope}.${Name}`, T>;
|
|
1977
|
+
static fieldRecursive<Kind extends FlexFieldKind, T extends FlexList<Unenforced<FlexTreeNodeSchema>>>(kind: Kind, ...allowedTypes: T): FlexFieldSchema<Kind, T>;
|
|
1978
|
+
intoLibrary(): SchemaLibrary;
|
|
1979
|
+
intoSchema<const TSchema extends FlexImplicitFieldSchema>(root: TSchema): FlexTreeSchema<NormalizeField<TSchema, TDefaultKind>>;
|
|
1980
|
+
map<Name extends TName, const T extends FlexMapFieldSchema>(name: Name, fieldSchema: T): FlexMapNodeSchema<`${TScope}.${Name}`, T>;
|
|
1981
|
+
mapRecursive<Name extends TName, const T extends Unenforced<FlexMapFieldSchema>>(name: Name, t: T): FlexMapNodeSchema<`${TScope}.${Name}`, T>;
|
|
1982
|
+
readonly name: string;
|
|
1983
|
+
protected normalizeField<TSchema extends FlexImplicitFieldSchema>(schema: TSchema): NormalizeField<TSchema, TDefaultKind>;
|
|
1984
|
+
object<const Name extends TName, const T extends RestrictiveReadonlyRecord<string, FlexImplicitFieldSchema>>(name: Name, t: T): FlexObjectNodeSchema<`${TScope}.${Name}`, {
|
|
1985
|
+
[key in keyof T]: NormalizeField<T[key], TDefaultKind>;
|
|
1986
|
+
}>;
|
|
1987
|
+
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, FlexImplicitFieldSchema>>>(name: Name, t: T): FlexObjectNodeSchema<`${TScope}.${Name}`, T>;
|
|
1988
|
+
readonly scope: TScope;
|
|
1989
|
+
// (undocumented)
|
|
1990
|
+
protected scoped<Name extends TName>(name: Name): TreeNodeSchemaIdentifier<`${TScope}.${Name}`>;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
// @internal
|
|
1994
|
+
export interface SchemaBuilderOptions<TScope extends string = string> {
|
|
1995
|
+
libraries?: SchemaLibrary[];
|
|
1996
|
+
lint?: Partial<SchemaLintConfiguration>;
|
|
1997
|
+
name?: string;
|
|
1998
|
+
scope: TScope;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
// @internal
|
|
2002
|
+
export interface SchemaCollection {
|
|
2003
|
+
readonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, FlexTreeNodeSchema>;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
// @internal
|
|
2007
|
+
export interface SchemaConfiguration<TRoot extends FlexFieldSchema = FlexFieldSchema> {
|
|
2008
|
+
readonly schema: FlexTreeSchema<TRoot>;
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
// @internal
|
|
2012
|
+
export interface SchemaEvents {
|
|
2013
|
+
afterSchemaChange(newSchema: TreeStoredSchema): void;
|
|
2014
|
+
beforeSchemaChange(newSchema: TreeStoredSchema): void;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
654
2017
|
// @public @sealed
|
|
655
2018
|
export class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> {
|
|
656
2019
|
constructor(scope: TScope);
|
|
@@ -688,9 +2051,62 @@ export interface SchemaIncompatible {
|
|
|
688
2051
|
readonly canUpgrade: boolean;
|
|
689
2052
|
}
|
|
690
2053
|
|
|
2054
|
+
// @internal
|
|
2055
|
+
export function schemaIsFieldNode(schema: FlexTreeNodeSchema): schema is FlexFieldNodeSchema;
|
|
2056
|
+
|
|
2057
|
+
// @internal
|
|
2058
|
+
export function schemaIsLeaf(schema: FlexTreeNodeSchema): schema is LeafNodeSchema;
|
|
2059
|
+
|
|
2060
|
+
// @internal
|
|
2061
|
+
export function schemaIsMap(schema: FlexTreeNodeSchema): schema is FlexMapNodeSchema;
|
|
2062
|
+
|
|
2063
|
+
// @internal
|
|
2064
|
+
export function schemaIsObjectNode(schema: FlexTreeNodeSchema): schema is FlexObjectNodeSchema;
|
|
2065
|
+
|
|
2066
|
+
// @internal
|
|
2067
|
+
export interface SchemaLibrary extends SchemaCollection {
|
|
2068
|
+
readonly libraries: ReadonlySet<SchemaLibraryData>;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
// @internal
|
|
2072
|
+
export interface SchemaLibraryData extends SchemaCollection {
|
|
2073
|
+
// (undocumented)
|
|
2074
|
+
readonly adapters: Adapters;
|
|
2075
|
+
// (undocumented)
|
|
2076
|
+
readonly name: string;
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
// @internal
|
|
2080
|
+
export interface SchemaLintConfiguration {
|
|
2081
|
+
// (undocumented)
|
|
2082
|
+
readonly rejectEmpty: boolean;
|
|
2083
|
+
// (undocumented)
|
|
2084
|
+
readonly rejectForbidden: boolean;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
// @internal
|
|
2088
|
+
export interface SchemaPolicy {
|
|
2089
|
+
readonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindData>;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
// @internal
|
|
2093
|
+
export interface SchematizeConfiguration<TRoot extends FlexFieldSchema = FlexFieldSchema> extends SchemaConfiguration<TRoot> {
|
|
2094
|
+
readonly allowedSchemaModifications: AllowedUpdateType;
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
// @internal
|
|
2098
|
+
export interface SchemaValidationFunction<Schema extends TSchema> {
|
|
2099
|
+
// (undocumented)
|
|
2100
|
+
check(data: unknown): data is Static<Schema>;
|
|
2101
|
+
}
|
|
2102
|
+
|
|
691
2103
|
// @public
|
|
692
2104
|
export type ScopedSchemaName<TScope extends string | undefined, TName extends number | string> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;
|
|
693
2105
|
|
|
2106
|
+
// @internal (undocumented)
|
|
2107
|
+
export interface Sequence extends FlexFieldKind<"Sequence", Multiplicity.Sequence> {
|
|
2108
|
+
}
|
|
2109
|
+
|
|
694
2110
|
// @alpha
|
|
695
2111
|
export class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOperationType> {
|
|
696
2112
|
constructor(opArgs: IMergeTreeDeltaOpArgs, deltaArgs: IMergeTreeDeltaCallbackArgs, mergeTreeClient: Client);
|
|
@@ -712,6 +2128,13 @@ export abstract class SequenceEvent<TOperation extends MergeTreeDeltaOperationTy
|
|
|
712
2128
|
get ranges(): readonly Readonly<ISequenceDeltaRange<TOperation>>[];
|
|
713
2129
|
}
|
|
714
2130
|
|
|
2131
|
+
// @internal (undocumented)
|
|
2132
|
+
export interface SequenceFieldEditBuilder {
|
|
2133
|
+
insert(index: number, newContent: ITreeCursorSynchronous): void;
|
|
2134
|
+
move(sourceIndex: number, count: number, destIndex: number): void;
|
|
2135
|
+
remove(index: number, count: number): void;
|
|
2136
|
+
}
|
|
2137
|
+
|
|
715
2138
|
// @alpha
|
|
716
2139
|
export class SequenceInterval implements ISerializableInterval {
|
|
717
2140
|
constructor(client: Client,
|
|
@@ -842,6 +2265,33 @@ export type SharedStringSegment = TextSegment | Marker;
|
|
|
842
2265
|
// @public
|
|
843
2266
|
export const SharedTree: ISharedObjectKind<ITree>;
|
|
844
2267
|
|
|
2268
|
+
// @internal
|
|
2269
|
+
export interface SharedTreeContentSnapshot {
|
|
2270
|
+
readonly removed: [string | number | undefined, number, JsonableTree][];
|
|
2271
|
+
readonly schema: TreeStoredSchema;
|
|
2272
|
+
readonly tree: JsonableTree[];
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
// @internal
|
|
2276
|
+
export interface SharedTreeFormatOptions {
|
|
2277
|
+
formatVersion: SharedTreeFormatVersion[keyof SharedTreeFormatVersion];
|
|
2278
|
+
treeEncodeType: TreeCompressionStrategy;
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
// @internal
|
|
2282
|
+
export const SharedTreeFormatVersion: {
|
|
2283
|
+
readonly v1: 1;
|
|
2284
|
+
readonly v2: 2;
|
|
2285
|
+
};
|
|
2286
|
+
|
|
2287
|
+
// @internal
|
|
2288
|
+
export type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;
|
|
2289
|
+
|
|
2290
|
+
// @internal (undocumented)
|
|
2291
|
+
export type SharedTreeOptions = Partial<ICodecOptions> & Partial<SharedTreeFormatOptions> & {
|
|
2292
|
+
forest?: ForestType;
|
|
2293
|
+
};
|
|
2294
|
+
|
|
845
2295
|
// @alpha
|
|
846
2296
|
export enum Side {
|
|
847
2297
|
// (undocumented)
|
|
@@ -850,12 +2300,75 @@ export enum Side {
|
|
|
850
2300
|
Before = 0
|
|
851
2301
|
}
|
|
852
2302
|
|
|
2303
|
+
// @internal
|
|
2304
|
+
export function singletonSchema<TScope extends string, TName extends string | number>(factory: SchemaFactory<TScope, TName>, name: TName): TreeNodeSchemaClass<ScopedSchemaName<TScope, TName>, NodeKind.Object, object & TreeNode & ObjectFromSchemaRecord<EmptyObject> & {
|
|
2305
|
+
readonly value: TName;
|
|
2306
|
+
}, object & InsertableObjectFromSchemaRecord<EmptyObject>, true, unknown> & (new () => object & TreeNode & ObjectFromSchemaRecord<EmptyObject> & {
|
|
2307
|
+
readonly value: TName;
|
|
2308
|
+
});
|
|
2309
|
+
|
|
2310
|
+
// @internal
|
|
2311
|
+
export type StableNodeKey = Brand<StableId, "Stable Node Key">;
|
|
2312
|
+
|
|
2313
|
+
// @internal
|
|
2314
|
+
export function stackTreeFieldCursor<TNode>(adapter: CursorAdapter<TNode>, root: TNode, detachedField?: DetachedField): CursorWithNode<TNode>;
|
|
2315
|
+
|
|
2316
|
+
// @internal
|
|
2317
|
+
export function stackTreeNodeCursor<TNode>(adapter: CursorAdapter<TNode>, root: TNode): CursorWithNode<TNode>;
|
|
2318
|
+
|
|
2319
|
+
// @internal
|
|
2320
|
+
export interface StoredSchemaCollection {
|
|
2321
|
+
readonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2324
|
+
// @internal (undocumented)
|
|
2325
|
+
export class test_RecursiveObject extends test_RecursiveObject_base {
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
// @internal
|
|
2329
|
+
export const test_RecursiveObject_base: TreeNodeSchemaClass_2<"Test Recursive Domain.testObject", NodeKind.Object, TreeObjectNodeUnsafe_2< {
|
|
2330
|
+
readonly recursive: FieldSchemaUnsafe_2<FieldKind.Optional, readonly [() => typeof test_RecursiveObject]>;
|
|
2331
|
+
readonly number: TreeNodeSchema_2<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
|
|
2332
|
+
}, "Test Recursive Domain.testObject">, object & InsertableObjectFromSchemaRecordUnsafe_2< {
|
|
2333
|
+
readonly recursive: FieldSchemaUnsafe_2<FieldKind.Optional, readonly [() => typeof test_RecursiveObject]>;
|
|
2334
|
+
readonly number: TreeNodeSchema_2<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
|
|
2335
|
+
}>, false, {
|
|
2336
|
+
readonly recursive: FieldSchemaUnsafe_2<FieldKind.Optional, readonly [() => typeof test_RecursiveObject]>;
|
|
2337
|
+
readonly number: TreeNodeSchema_2<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
|
|
2338
|
+
}>;
|
|
2339
|
+
|
|
2340
|
+
// @internal
|
|
2341
|
+
export const test_RecursiveObjectPojoMode: TreeNodeSchemaClass_2<"Test Recursive Domain.testPOJOObject", NodeKind.Object, TreeObjectNodeUnsafe_2< {
|
|
2342
|
+
readonly recursive: FieldSchemaUnsafe_2<FieldKind.Optional, readonly [() => TreeNodeSchemaClass_2<"Test Recursive Domain.testPOJOObject", NodeKind.Object, TreeObjectNodeUnsafe_2<any, "Test Recursive Domain.testPOJOObject">, object & InsertableObjectFromSchemaRecordUnsafe_2<any>, false, any>]>;
|
|
2343
|
+
readonly number: TreeNodeSchema_2<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
|
|
2344
|
+
}, "Test Recursive Domain.testPOJOObject">, object & InsertableObjectFromSchemaRecordUnsafe_2< {
|
|
2345
|
+
readonly recursive: FieldSchemaUnsafe_2<FieldKind.Optional, readonly [() => TreeNodeSchemaClass_2<"Test Recursive Domain.testPOJOObject", NodeKind.Object, TreeObjectNodeUnsafe_2<any, "Test Recursive Domain.testPOJOObject">, object & InsertableObjectFromSchemaRecordUnsafe_2<any>, false, any>]>;
|
|
2346
|
+
readonly number: TreeNodeSchema_2<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
|
|
2347
|
+
}>, false, {
|
|
2348
|
+
readonly recursive: FieldSchemaUnsafe_2<FieldKind.Optional, readonly [() => TreeNodeSchemaClass_2<"Test Recursive Domain.testPOJOObject", NodeKind.Object, TreeObjectNodeUnsafe_2<any, "Test Recursive Domain.testPOJOObject">, object & InsertableObjectFromSchemaRecordUnsafe_2<any>, false, any>]>;
|
|
2349
|
+
readonly number: TreeNodeSchema_2<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
|
|
2350
|
+
}>;
|
|
2351
|
+
|
|
853
2352
|
// @public
|
|
854
2353
|
export type TransactionConstraint = NodeInDocumentConstraint;
|
|
855
2354
|
|
|
2355
|
+
// @internal
|
|
2356
|
+
export enum TransactionResult {
|
|
2357
|
+
Abort = 0,
|
|
2358
|
+
Commit = 1
|
|
2359
|
+
}
|
|
2360
|
+
|
|
856
2361
|
// @public
|
|
857
2362
|
export const Tree: TreeApi;
|
|
858
2363
|
|
|
2364
|
+
// @internal (undocumented)
|
|
2365
|
+
export interface TreeAdapter {
|
|
2366
|
+
// (undocumented)
|
|
2367
|
+
readonly input: TreeNodeSchemaIdentifier;
|
|
2368
|
+
// (undocumented)
|
|
2369
|
+
readonly output: TreeNodeSchemaIdentifier;
|
|
2370
|
+
}
|
|
2371
|
+
|
|
859
2372
|
// @public
|
|
860
2373
|
export interface TreeApi extends TreeNodeApi {
|
|
861
2374
|
contains(node: TreeNode, other: TreeNode): boolean;
|
|
@@ -902,6 +2415,12 @@ export interface TreeChangeEvents {
|
|
|
902
2415
|
treeChanged(): void;
|
|
903
2416
|
}
|
|
904
2417
|
|
|
2418
|
+
// @internal
|
|
2419
|
+
export enum TreeCompressionStrategy {
|
|
2420
|
+
Compressed = 0,
|
|
2421
|
+
Uncompressed = 1
|
|
2422
|
+
}
|
|
2423
|
+
|
|
905
2424
|
// @public
|
|
906
2425
|
export class TreeConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> {
|
|
907
2426
|
constructor(schema: TSchema, initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>);
|
|
@@ -911,15 +2430,41 @@ export class TreeConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFie
|
|
|
911
2430
|
readonly schema: TSchema;
|
|
912
2431
|
}
|
|
913
2432
|
|
|
2433
|
+
// @internal
|
|
2434
|
+
export interface TreeContent<TRoot extends FlexFieldSchema = FlexFieldSchema> extends SchemaConfiguration<TRoot> {
|
|
2435
|
+
readonly initialTree: InsertableFlexField<TRoot> | readonly ITreeCursorSynchronous[] | ITreeCursorSynchronous;
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
// @internal
|
|
2439
|
+
export interface TreeDataContext {
|
|
2440
|
+
fieldSource?(key: FieldKey, schema: TreeFieldStoredSchema): undefined | FieldGenerator;
|
|
2441
|
+
readonly schema: FlexTreeSchema;
|
|
2442
|
+
}
|
|
2443
|
+
|
|
914
2444
|
// @public
|
|
915
2445
|
export type TreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = FieldSchema> = TSchema extends FieldSchema<infer Kind, infer Types> ? ApplyKind<TreeNodeFromImplicitAllowedTypes<Types>, Kind, false> : TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : unknown;
|
|
916
2446
|
|
|
917
2447
|
// @public
|
|
918
2448
|
export type TreeFieldFromImplicitFieldUnsafe<TSchema extends Unenforced<ImplicitFieldSchema>> = TSchema extends FieldSchemaUnsafe<infer Kind, infer Types> ? ApplyKind<TreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind, false> : TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypesUnsafe<TSchema> : unknown;
|
|
919
2449
|
|
|
2450
|
+
// @internal
|
|
2451
|
+
export interface TreeFieldStoredSchema {
|
|
2452
|
+
// (undocumented)
|
|
2453
|
+
readonly kind: FieldKindIdentifier;
|
|
2454
|
+
readonly types?: TreeTypeSet;
|
|
2455
|
+
}
|
|
2456
|
+
|
|
920
2457
|
// @public
|
|
921
2458
|
export type TreeLeafValue = number | string | boolean | IFluidHandle | null;
|
|
922
2459
|
|
|
2460
|
+
// @internal (undocumented)
|
|
2461
|
+
export interface TreeLocation {
|
|
2462
|
+
// (undocumented)
|
|
2463
|
+
readonly index: number;
|
|
2464
|
+
// (undocumented)
|
|
2465
|
+
readonly range: FieldLocation | DetachedField;
|
|
2466
|
+
}
|
|
2467
|
+
|
|
923
2468
|
// @public
|
|
924
2469
|
export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>, TreeNode {
|
|
925
2470
|
delete(key: string): void;
|
|
@@ -932,6 +2477,13 @@ export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> e
|
|
|
932
2477
|
set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined): void;
|
|
933
2478
|
}
|
|
934
2479
|
|
|
2480
|
+
// @internal (undocumented)
|
|
2481
|
+
export const enum TreeNavigationResult {
|
|
2482
|
+
NotFound = -1,
|
|
2483
|
+
Ok = 1,
|
|
2484
|
+
Pending = 0
|
|
2485
|
+
}
|
|
2486
|
+
|
|
935
2487
|
// @public
|
|
936
2488
|
export abstract class TreeNode implements WithType {
|
|
937
2489
|
abstract get [type](): string;
|
|
@@ -958,6 +2510,23 @@ export type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<Im
|
|
|
958
2510
|
// @public
|
|
959
2511
|
export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode = unknown, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown> = TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info> | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>;
|
|
960
2512
|
|
|
2513
|
+
// @internal
|
|
2514
|
+
export abstract class TreeNodeSchemaBase<const out Name extends string = string, const out Specification = unknown> {
|
|
2515
|
+
protected constructor(builder: Named<string>, name: TreeNodeSchemaIdentifier<Name>, info: Specification, stored: TreeNodeStoredSchema);
|
|
2516
|
+
// (undocumented)
|
|
2517
|
+
readonly builder: Named<string>;
|
|
2518
|
+
// (undocumented)
|
|
2519
|
+
abstract getFieldSchema(field: FieldKey): FlexFieldSchema;
|
|
2520
|
+
// (undocumented)
|
|
2521
|
+
readonly info: Specification;
|
|
2522
|
+
// (undocumented)
|
|
2523
|
+
readonly name: TreeNodeSchemaIdentifier<Name>;
|
|
2524
|
+
// (undocumented)
|
|
2525
|
+
readonly stored: TreeNodeStoredSchema;
|
|
2526
|
+
// (undocumented)
|
|
2527
|
+
protected _typeCheck?: MakeNominal;
|
|
2528
|
+
}
|
|
2529
|
+
|
|
961
2530
|
// @public
|
|
962
2531
|
export interface TreeNodeSchemaClass<out Name extends string = string, out Kind extends NodeKind = NodeKind, out TNode = unknown, in TInsertable = never, out ImplicitlyConstructable extends boolean = boolean, out Info = unknown> extends TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info> {
|
|
963
2532
|
// @sealed
|
|
@@ -974,18 +2543,32 @@ export interface TreeNodeSchemaCore<out Name extends string, out Kind extends No
|
|
|
974
2543
|
readonly kind: Kind;
|
|
975
2544
|
}
|
|
976
2545
|
|
|
2546
|
+
// @internal
|
|
2547
|
+
export type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<TName, "tree.TreeNodeSchemaIdentifier">;
|
|
2548
|
+
|
|
977
2549
|
// @public
|
|
978
2550
|
export interface TreeNodeSchemaNonClass<out Name extends string = string, out Kind extends NodeKind = NodeKind, out TNode = unknown, in TInsertable = never, out ImplicitlyConstructable extends boolean = boolean, out Info = unknown> extends TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info> {
|
|
979
2551
|
// (undocumented)
|
|
980
2552
|
create(data: TInsertable): TNode;
|
|
981
2553
|
}
|
|
982
2554
|
|
|
2555
|
+
// @internal (undocumented)
|
|
2556
|
+
export abstract class TreeNodeStoredSchema {
|
|
2557
|
+
// (undocumented)
|
|
2558
|
+
abstract encode(): ErasedTreeNodeSchemaDataFormat;
|
|
2559
|
+
// (undocumented)
|
|
2560
|
+
protected _typeCheck: MakeNominal;
|
|
2561
|
+
}
|
|
2562
|
+
|
|
983
2563
|
// @public
|
|
984
2564
|
export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName>;
|
|
985
2565
|
|
|
986
2566
|
// @public
|
|
987
2567
|
export type TreeObjectNodeUnsafe<T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName>;
|
|
988
2568
|
|
|
2569
|
+
// @internal
|
|
2570
|
+
export function treeSchemaFromStoredSchema(schema: TreeStoredSchema): FlexTreeSchema;
|
|
2571
|
+
|
|
989
2572
|
// @public
|
|
990
2573
|
export enum TreeStatus {
|
|
991
2574
|
Deleted = 2,
|
|
@@ -993,6 +2576,32 @@ export enum TreeStatus {
|
|
|
993
2576
|
Removed = 1
|
|
994
2577
|
}
|
|
995
2578
|
|
|
2579
|
+
// @internal
|
|
2580
|
+
export interface TreeStoredSchema extends StoredSchemaCollection {
|
|
2581
|
+
readonly rootFieldSchema: TreeFieldStoredSchema;
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
// @internal
|
|
2585
|
+
export interface TreeStoredSchemaSubscription extends ISubscribable<SchemaEvents>, TreeStoredSchema {
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
// @internal (undocumented)
|
|
2589
|
+
export type TreeType = TreeNodeSchemaIdentifier;
|
|
2590
|
+
|
|
2591
|
+
// @internal
|
|
2592
|
+
export type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier> | undefined;
|
|
2593
|
+
|
|
2594
|
+
// @internal
|
|
2595
|
+
export type TreeValue<TSchema extends ValueSchema = ValueSchema> = [
|
|
2596
|
+
{
|
|
2597
|
+
[ValueSchema.Number]: number;
|
|
2598
|
+
[ValueSchema.String]: string;
|
|
2599
|
+
[ValueSchema.Boolean]: boolean;
|
|
2600
|
+
[ValueSchema.FluidHandle]: IFluidHandle;
|
|
2601
|
+
[ValueSchema.Null]: null;
|
|
2602
|
+
}[TSchema]
|
|
2603
|
+
][_InlineTrick];
|
|
2604
|
+
|
|
996
2605
|
// @public
|
|
997
2606
|
export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposable {
|
|
998
2607
|
readonly error?: SchemaIncompatible;
|
|
@@ -1012,12 +2621,47 @@ export interface TreeViewEvents {
|
|
|
1012
2621
|
// @public
|
|
1013
2622
|
export const type: unique symbol;
|
|
1014
2623
|
|
|
2624
|
+
// @internal
|
|
2625
|
+
export const typeboxValidator: JsonValidator;
|
|
2626
|
+
|
|
2627
|
+
// @internal
|
|
2628
|
+
export type TypedFields<TFields extends undefined | {
|
|
2629
|
+
readonly [key: string]: FlexFieldSchema;
|
|
2630
|
+
}> = [
|
|
2631
|
+
TFields extends {
|
|
2632
|
+
[key: string]: FlexFieldSchema;
|
|
2633
|
+
} ? {
|
|
2634
|
+
-readonly [key in keyof TFields]: InsertableFlexField<TFields[key]>;
|
|
2635
|
+
} : EmptyObject
|
|
2636
|
+
][_InlineTrick];
|
|
2637
|
+
|
|
2638
|
+
// @internal
|
|
2639
|
+
export function typedObjectValues<TKey extends string, TValues>(object: Record<TKey, TValues>): TValues[];
|
|
2640
|
+
|
|
2641
|
+
// @internal
|
|
2642
|
+
export const typeNameSymbol: unique symbol;
|
|
2643
|
+
|
|
2644
|
+
// @internal
|
|
2645
|
+
export type UnbrandedName<TName> = [
|
|
2646
|
+
TName extends TreeNodeSchemaIdentifier<infer S> ? S : string
|
|
2647
|
+
][_InlineTrick];
|
|
2648
|
+
|
|
1015
2649
|
// @public
|
|
1016
2650
|
export type Unenforced<_DesiredExtendsConstraint> = unknown;
|
|
1017
2651
|
|
|
1018
2652
|
// @public
|
|
1019
2653
|
export type Unhydrated<T> = T;
|
|
1020
2654
|
|
|
2655
|
+
// @internal
|
|
2656
|
+
export interface UpPath<TParent = UpPathDefault> {
|
|
2657
|
+
readonly parent: TParent | undefined;
|
|
2658
|
+
readonly parentField: FieldKey;
|
|
2659
|
+
readonly parentIndex: NodeIndex;
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
// @internal
|
|
2663
|
+
export type UpPathDefault = UpPath;
|
|
2664
|
+
|
|
1021
2665
|
// @public
|
|
1022
2666
|
export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"]>, {
|
|
1023
2667
|
[NodeKind.Object]: T["info"] extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema> ? InsertableObjectFromSchemaRecord<T["info"]> : unknown;
|
|
@@ -1029,6 +2673,34 @@ export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKi
|
|
|
1029
2673
|
[NodeKind.Map]: ImplicitAllowedTypes;
|
|
1030
2674
|
}[T["kind"]]>> = true;
|
|
1031
2675
|
|
|
2676
|
+
// @internal
|
|
2677
|
+
export type Value = undefined | TreeValue;
|
|
2678
|
+
|
|
2679
|
+
// @internal (undocumented)
|
|
2680
|
+
export interface ValueFieldEditBuilder {
|
|
2681
|
+
set(newContent: ITreeCursorSynchronous): void;
|
|
2682
|
+
}
|
|
2683
|
+
|
|
2684
|
+
// @internal
|
|
2685
|
+
export type ValueFromBranded<T extends BrandedType<unknown, unknown>> = T extends BrandedType<infer ValueType, unknown> ? ValueType : never;
|
|
2686
|
+
|
|
2687
|
+
// @internal
|
|
2688
|
+
export enum ValueSchema {
|
|
2689
|
+
// (undocumented)
|
|
2690
|
+
Boolean = 2,
|
|
2691
|
+
// (undocumented)
|
|
2692
|
+
FluidHandle = 3,
|
|
2693
|
+
// (undocumented)
|
|
2694
|
+
Null = 4,
|
|
2695
|
+
// (undocumented)
|
|
2696
|
+
Number = 0,
|
|
2697
|
+
// (undocumented)
|
|
2698
|
+
String = 1
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
// @internal
|
|
2702
|
+
export const valueSymbol: unique symbol;
|
|
2703
|
+
|
|
1032
2704
|
// @public
|
|
1033
2705
|
export interface WithType<TName extends string = string> {
|
|
1034
2706
|
get [type](): TName;
|