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