@fluidframework/tree 2.5.0 → 2.10.0-304831
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/tree.alpha.api.md +11 -13
- package/api-report/tree.beta.api.md +7 -12
- package/api-report/tree.legacy.alpha.api.md +7 -12
- package/api-report/tree.legacy.public.api.md +7 -12
- package/api-report/tree.public.api.md +7 -12
- package/dist/core/rebase/types.d.ts +3 -3
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +3 -3
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/revertible.d.ts +1 -1
- package/dist/core/revertible.js.map +1 -1
- package/dist/internalTypes.d.ts +1 -1
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +2 -2
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +4 -1
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +7 -10
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +7 -3
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +11 -1
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +2 -2
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +9 -15
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +3 -3
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +3 -3
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/revertible.d.ts +1 -1
- package/lib/core/revertible.js.map +1 -1
- package/lib/internalTypes.d.ts +1 -1
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +2 -2
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +4 -1
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +7 -10
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +7 -3
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +11 -1
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +2 -2
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +9 -15
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/package.json +25 -61
- package/src/core/rebase/types.ts +3 -3
- package/src/core/revertible.ts +1 -1
- package/src/internalTypes.ts +0 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizingTreeView.ts +8 -6
- package/src/shared-tree/treeCheckout.ts +13 -14
- package/src/simple-tree/api/tree.ts +13 -1
- package/src/simple-tree/api/typesUnsafe.ts +3 -2
- package/src/simple-tree/arrayNode.ts +17 -20
- package/src/simple-tree/index.ts +0 -1
- /package/docs/{main → user-facing}/merge-semantics.md +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/tree",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0-304831",
|
|
4
4
|
"description": "Distributed tree",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -89,17 +89,17 @@
|
|
|
89
89
|
"temp-directory": "nyc/.nyc_output"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@fluid-internal/client-utils": "
|
|
93
|
-
"@fluidframework/container-runtime": "
|
|
94
|
-
"@fluidframework/core-interfaces": "
|
|
95
|
-
"@fluidframework/core-utils": "
|
|
96
|
-
"@fluidframework/datastore-definitions": "
|
|
97
|
-
"@fluidframework/driver-definitions": "
|
|
98
|
-
"@fluidframework/id-compressor": "
|
|
99
|
-
"@fluidframework/runtime-definitions": "
|
|
100
|
-
"@fluidframework/runtime-utils": "
|
|
101
|
-
"@fluidframework/shared-object-base": "
|
|
102
|
-
"@fluidframework/telemetry-utils": "
|
|
92
|
+
"@fluid-internal/client-utils": "2.10.0-304831",
|
|
93
|
+
"@fluidframework/container-runtime": "2.10.0-304831",
|
|
94
|
+
"@fluidframework/core-interfaces": "2.10.0-304831",
|
|
95
|
+
"@fluidframework/core-utils": "2.10.0-304831",
|
|
96
|
+
"@fluidframework/datastore-definitions": "2.10.0-304831",
|
|
97
|
+
"@fluidframework/driver-definitions": "2.10.0-304831",
|
|
98
|
+
"@fluidframework/id-compressor": "2.10.0-304831",
|
|
99
|
+
"@fluidframework/runtime-definitions": "2.10.0-304831",
|
|
100
|
+
"@fluidframework/runtime-utils": "2.10.0-304831",
|
|
101
|
+
"@fluidframework/shared-object-base": "2.10.0-304831",
|
|
102
|
+
"@fluidframework/telemetry-utils": "2.10.0-304831",
|
|
103
103
|
"@sinclair/typebox": "^0.32.29",
|
|
104
104
|
"@tylerbu/sorted-btree-es6": "^1.8.0",
|
|
105
105
|
"@types/ungap__structured-clone": "^1.2.0",
|
|
@@ -109,20 +109,20 @@
|
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@arethetypeswrong/cli": "^0.16.4",
|
|
111
111
|
"@biomejs/biome": "~1.9.3",
|
|
112
|
-
"@fluid-internal/mocha-test-setup": "
|
|
113
|
-
"@fluid-private/stochastic-test-utils": "
|
|
114
|
-
"@fluid-private/test-dds-utils": "
|
|
115
|
-
"@fluid-private/test-drivers": "
|
|
112
|
+
"@fluid-internal/mocha-test-setup": "2.10.0-304831",
|
|
113
|
+
"@fluid-private/stochastic-test-utils": "2.10.0-304831",
|
|
114
|
+
"@fluid-private/test-dds-utils": "2.10.0-304831",
|
|
115
|
+
"@fluid-private/test-drivers": "2.10.0-304831",
|
|
116
116
|
"@fluid-tools/benchmark": "^0.50.0",
|
|
117
|
-
"@fluid-tools/build-cli": "^0.
|
|
117
|
+
"@fluid-tools/build-cli": "^0.50.0",
|
|
118
118
|
"@fluidframework/build-common": "^2.0.3",
|
|
119
|
-
"@fluidframework/build-tools": "^0.
|
|
120
|
-
"@fluidframework/container-definitions": "
|
|
121
|
-
"@fluidframework/container-loader": "
|
|
119
|
+
"@fluidframework/build-tools": "^0.50.0",
|
|
120
|
+
"@fluidframework/container-definitions": "2.10.0-304831",
|
|
121
|
+
"@fluidframework/container-loader": "2.10.0-304831",
|
|
122
122
|
"@fluidframework/eslint-config-fluid": "^5.4.0",
|
|
123
|
-
"@fluidframework/test-runtime-utils": "
|
|
124
|
-
"@fluidframework/test-utils": "
|
|
125
|
-
"@fluidframework/tree-previous": "npm:@fluidframework/tree
|
|
123
|
+
"@fluidframework/test-runtime-utils": "2.10.0-304831",
|
|
124
|
+
"@fluidframework/test-utils": "2.10.0-304831",
|
|
125
|
+
"@fluidframework/tree-previous": "npm:@fluidframework/tree@2.5.0",
|
|
126
126
|
"@microsoft/api-extractor": "7.47.8",
|
|
127
127
|
"@types/diff": "^3.5.1",
|
|
128
128
|
"@types/easy-table": "^0.0.32",
|
|
@@ -164,48 +164,12 @@
|
|
|
164
164
|
},
|
|
165
165
|
"typeValidation": {
|
|
166
166
|
"broken": {
|
|
167
|
-
"
|
|
167
|
+
"TypeAlias_Input": {
|
|
168
168
|
"backCompat": false,
|
|
169
169
|
"forwardCompat": false
|
|
170
170
|
},
|
|
171
|
-
"
|
|
171
|
+
"Interface_InternalTypes_TreeArrayNodeBase": {
|
|
172
172
|
"backCompat": false
|
|
173
|
-
},
|
|
174
|
-
"TypeAlias_InsertableTreeNodeFromImplicitAllowedTypes": {
|
|
175
|
-
"backCompat": false,
|
|
176
|
-
"forwardCompat": false
|
|
177
|
-
},
|
|
178
|
-
"TypeAlias_NodeFromSchema": {
|
|
179
|
-
"backCompat": false
|
|
180
|
-
},
|
|
181
|
-
"TypeAlias_TreeFieldFromImplicitField": {
|
|
182
|
-
"backCompat": false
|
|
183
|
-
},
|
|
184
|
-
"TypeAlias_TreeNodeFromImplicitAllowedTypes": {
|
|
185
|
-
"backCompat": false
|
|
186
|
-
},
|
|
187
|
-
"TypeAlias_InternalTypes_ApplyKind": {
|
|
188
|
-
"forwardCompat": false,
|
|
189
|
-
"backCompat": false
|
|
190
|
-
},
|
|
191
|
-
"TypeAlias_InternalTypes_InsertableObjectFromSchemaRecord": {
|
|
192
|
-
"forwardCompat": false,
|
|
193
|
-
"backCompat": false
|
|
194
|
-
},
|
|
195
|
-
"TypeAlias_InsertableTreeFieldFromImplicitFieldUnsafe": {
|
|
196
|
-
"forwardCompat": false
|
|
197
|
-
},
|
|
198
|
-
"TypeAlias_InternalTypes_InsertableTreeFieldFromImplicitFieldUnsafe": {
|
|
199
|
-
"forwardCompat": false
|
|
200
|
-
},
|
|
201
|
-
"Interface_ITreeViewConfiguration": {
|
|
202
|
-
"forwardCompat": false
|
|
203
|
-
},
|
|
204
|
-
"TypeAlias_ImplicitAllowedTypes": {
|
|
205
|
-
"forwardCompat": false
|
|
206
|
-
},
|
|
207
|
-
"TypeAlias_ImplicitFieldSchema": {
|
|
208
|
-
"forwardCompat": false
|
|
209
173
|
}
|
|
210
174
|
},
|
|
211
175
|
"entrypoint": "public"
|
package/src/core/rebase/types.ts
CHANGED
|
@@ -161,11 +161,11 @@ export interface GraphCommit<TChange> {
|
|
|
161
161
|
* @public
|
|
162
162
|
*/
|
|
163
163
|
export enum CommitKind {
|
|
164
|
-
/** A commit corresponding to a change that is not the result of an undo/redo. */
|
|
164
|
+
/** A commit corresponding to a change that is not the result of an undo/redo from this client. */
|
|
165
165
|
Default,
|
|
166
|
-
/** A commit that is the result of an undo. */
|
|
166
|
+
/** A commit that is the result of an undo from this client. */
|
|
167
167
|
Undo,
|
|
168
|
-
/** A commit that is the result of a redo. */
|
|
168
|
+
/** A commit that is the result of a redo from this client. */
|
|
169
169
|
Redo,
|
|
170
170
|
}
|
|
171
171
|
|
package/src/core/revertible.ts
CHANGED
|
@@ -50,7 +50,7 @@ export enum RevertibleStatus {
|
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Factory for creating a {@link Revertible}.
|
|
53
|
-
* Will error if invoked outside the scope of the `
|
|
53
|
+
* Will error if invoked outside the scope of the `changed` event that provides it, or if invoked multiple times.
|
|
54
54
|
*
|
|
55
55
|
* @param onRevertibleDisposed - A callback that will be invoked when the `Revertible` generated by this factory is disposed.
|
|
56
56
|
* This happens when the `Revertible` is disposed manually, or when the `TreeView` that the `Revertible` belongs to is disposed,
|
package/src/internalTypes.ts
CHANGED
package/src/packageVersion.ts
CHANGED
|
@@ -47,6 +47,7 @@ import {
|
|
|
47
47
|
type ReadSchema,
|
|
48
48
|
type UnsafeUnknownSchema,
|
|
49
49
|
type TreeBranch,
|
|
50
|
+
type TreeBranchEvents,
|
|
50
51
|
} from "../simple-tree/index.js";
|
|
51
52
|
import { Breakable, breakingClass, disposeSymbol, type WithBreakable } from "../util/index.js";
|
|
52
53
|
|
|
@@ -84,9 +85,9 @@ export class SchematizingSimpleTreeView<
|
|
|
84
85
|
*/
|
|
85
86
|
private currentCompatibility: SchemaCompatibilityStatus | undefined;
|
|
86
87
|
private readonly schemaPolicy: SchemaPolicy;
|
|
87
|
-
public readonly events: Listenable<TreeViewEvents> &
|
|
88
|
-
IEmitter<TreeViewEvents> &
|
|
89
|
-
HasListeners<TreeViewEvents> = createEmitter();
|
|
88
|
+
public readonly events: Listenable<TreeViewEvents & TreeBranchEvents> &
|
|
89
|
+
IEmitter<TreeViewEvents & TreeBranchEvents> &
|
|
90
|
+
HasListeners<TreeViewEvents & TreeBranchEvents> = createEmitter();
|
|
90
91
|
|
|
91
92
|
private readonly viewSchema: ViewSchema;
|
|
92
93
|
|
|
@@ -133,9 +134,10 @@ export class SchematizingSimpleTreeView<
|
|
|
133
134
|
this.update();
|
|
134
135
|
|
|
135
136
|
this.unregisterCallbacks.add(
|
|
136
|
-
this.checkout.events.on("
|
|
137
|
-
this.events.emit("
|
|
138
|
-
|
|
137
|
+
this.checkout.events.on("changed", (data, getRevertible) => {
|
|
138
|
+
this.events.emit("changed", data, getRevertible);
|
|
139
|
+
this.events.emit("commitApplied", data, getRevertible);
|
|
140
|
+
}),
|
|
139
141
|
);
|
|
140
142
|
}
|
|
141
143
|
|
|
@@ -85,18 +85,14 @@ export interface CheckoutEvents {
|
|
|
85
85
|
afterBatch(): void;
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
|
-
* Fired when a
|
|
88
|
+
* Fired when a change is made to the branch. Includes data about the change that is made which listeners
|
|
89
|
+
* can use to filter on changes they care about e.g. local vs remote changes.
|
|
89
90
|
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* @param revertible - The revertible that can be used to revert the change.
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* {@inheritdoc TreeViewEvents.commitApplied}
|
|
91
|
+
* @param data - information about the change
|
|
92
|
+
* @param getRevertible - a function provided that allows users to get a revertible for the change. If not provided,
|
|
93
|
+
* this change is not revertible.
|
|
98
94
|
*/
|
|
99
|
-
|
|
95
|
+
changed(data: CommitMetadata, getRevertible?: RevertibleFactory): void;
|
|
100
96
|
}
|
|
101
97
|
|
|
102
98
|
/**
|
|
@@ -118,7 +114,7 @@ export interface BranchableTree extends ViewableTree {
|
|
|
118
114
|
* @param view - a branch which was created by a call to `branch()`.
|
|
119
115
|
* It is automatically disposed after the merge completes.
|
|
120
116
|
* @remarks All ongoing transactions (if any) in `branch` will be committed before the merge.
|
|
121
|
-
* A "
|
|
117
|
+
* A "changed" event and a corresponding {@link Revertible} will be emitted on this branch for each new change merged from 'branch'.
|
|
122
118
|
*/
|
|
123
119
|
merge(branch: TreeBranchFork): void;
|
|
124
120
|
|
|
@@ -532,12 +528,12 @@ export class TreeCheckout implements ITreeCheckoutFork {
|
|
|
532
528
|
: (onRevertibleDisposed?: (revertible: Revertible) => void) => {
|
|
533
529
|
if (!withinEventContext) {
|
|
534
530
|
throw new UsageError(
|
|
535
|
-
"Cannot get a revertible outside of the context of a
|
|
531
|
+
"Cannot get a revertible outside of the context of a changed event.",
|
|
536
532
|
);
|
|
537
533
|
}
|
|
538
534
|
if (this.revertibleCommitBranches.get(revision) !== undefined) {
|
|
539
535
|
throw new UsageError(
|
|
540
|
-
"Cannot generate the same revertible more than once. Note that this can happen when multiple
|
|
536
|
+
"Cannot generate the same revertible more than once. Note that this can happen when multiple changed event listeners are registered.",
|
|
541
537
|
);
|
|
542
538
|
}
|
|
543
539
|
const revertibleCommits = this.revertibleCommitBranches;
|
|
@@ -582,9 +578,12 @@ export class TreeCheckout implements ITreeCheckoutFork {
|
|
|
582
578
|
};
|
|
583
579
|
|
|
584
580
|
let withinEventContext = true;
|
|
585
|
-
this.events.emit("
|
|
581
|
+
this.events.emit("changed", { isLocal: true, kind }, getRevertible);
|
|
586
582
|
withinEventContext = false;
|
|
587
583
|
}
|
|
584
|
+
} else if (event.type === "replace") {
|
|
585
|
+
// TODO: figure out how to plumb through commit kind info for remote changes
|
|
586
|
+
this.events.emit("changed", { isLocal: false, kind: CommitKind.Default });
|
|
588
587
|
}
|
|
589
588
|
}
|
|
590
589
|
});
|
|
@@ -522,11 +522,13 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
522
522
|
export interface TreeViewAlpha<
|
|
523
523
|
in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema,
|
|
524
524
|
> extends Omit<TreeView<ReadSchema<TSchema>>, "root" | "initialize">,
|
|
525
|
-
|
|
525
|
+
TreeBranch {
|
|
526
526
|
get root(): ReadableField<TSchema>;
|
|
527
527
|
|
|
528
528
|
set root(newRoot: InsertableField<TSchema>);
|
|
529
529
|
|
|
530
|
+
readonly events: Listenable<TreeViewEvents & TreeBranchEvents>;
|
|
531
|
+
|
|
530
532
|
initialize(content: InsertableField<TSchema>): void;
|
|
531
533
|
|
|
532
534
|
// Override the base branch method to return a typed view rather than merely a branch.
|
|
@@ -619,6 +621,16 @@ export interface TreeBranchEvents {
|
|
|
619
621
|
*/
|
|
620
622
|
schemaChanged(): void;
|
|
621
623
|
|
|
624
|
+
/**
|
|
625
|
+
* Fired when a change is made to the branch. Includes data about the change that is made which listeners
|
|
626
|
+
* can use to filter on changes they care about (e.g. local vs. remote changes).
|
|
627
|
+
*
|
|
628
|
+
* @param data - information about the change
|
|
629
|
+
* @param getRevertible - a function that allows users to get a revertible for the change. If not provided,
|
|
630
|
+
* this change is not revertible.
|
|
631
|
+
*/
|
|
632
|
+
changed(data: CommitMetadata, getRevertible?: RevertibleFactory): void;
|
|
633
|
+
|
|
622
634
|
/**
|
|
623
635
|
* Fired when:
|
|
624
636
|
* - a local commit is applied outside of a transaction
|
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
TreeNodeSchema,
|
|
24
24
|
TreeNodeSchemaCore,
|
|
25
25
|
} from "../core/index.js";
|
|
26
|
-
import type {
|
|
26
|
+
import type { TreeArrayNode } from "../arrayNode.js";
|
|
27
27
|
import type { FlexListToUnion, LazyItem } from "../flexList.js";
|
|
28
28
|
|
|
29
29
|
/*
|
|
@@ -238,7 +238,8 @@ export type NodeBuilderDataUnsafe<T extends Unenforced<TreeNodeSchema>> =
|
|
|
238
238
|
* @system @sealed @public
|
|
239
239
|
*/
|
|
240
240
|
export interface TreeArrayNodeUnsafe<TAllowedTypes extends Unenforced<ImplicitAllowedTypes>>
|
|
241
|
-
extends
|
|
241
|
+
extends TreeArrayNode<
|
|
242
|
+
TAllowedTypes,
|
|
242
243
|
TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>,
|
|
243
244
|
InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>
|
|
244
245
|
> {}
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
} from "./core/index.js";
|
|
47
47
|
import { TreeNodeValid, type MostDerivedData } from "./treeNodeValid.js";
|
|
48
48
|
import { getUnhydratedContext } from "./createContext.js";
|
|
49
|
+
import type { Unenforced } from "./api/index.js";
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* A covariant base type for {@link (TreeArrayNode:interface)}.
|
|
@@ -61,15 +62,25 @@ export interface ReadonlyArrayNode<out T = TreeNode | TreeLeafValue>
|
|
|
61
62
|
Awaited<TreeNode & WithType<string, NodeKind.Array>> {}
|
|
62
63
|
|
|
63
64
|
/**
|
|
64
|
-
* A
|
|
65
|
+
* A {@link TreeNode} which implements 'readonly T[]' and the array mutation APIs.
|
|
65
66
|
*
|
|
66
|
-
* @
|
|
67
|
-
*
|
|
67
|
+
* @typeParam TAllowedTypes - Schema for types which are allowed as members of this array.
|
|
68
|
+
* @typeParam T - Use Default: Do not specify. Type of values to read from the array.
|
|
69
|
+
* @typeParam TNew - Use Default: Do not specify. Type of values to write into the array.
|
|
70
|
+
* @typeParam TMoveFrom - Use Default: Do not specify. Type of node from which children can be moved into this array.
|
|
68
71
|
*
|
|
69
|
-
* @
|
|
72
|
+
* @sealed @public
|
|
70
73
|
*/
|
|
71
|
-
export interface
|
|
72
|
-
extends
|
|
74
|
+
export interface TreeArrayNode<
|
|
75
|
+
TAllowedTypes extends Unenforced<ImplicitAllowedTypes> = ImplicitAllowedTypes,
|
|
76
|
+
out T = [TAllowedTypes] extends [ImplicitAllowedTypes]
|
|
77
|
+
? TreeNodeFromImplicitAllowedTypes<TAllowedTypes>
|
|
78
|
+
: TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>,
|
|
79
|
+
in TNew = [TAllowedTypes] extends [ImplicitAllowedTypes]
|
|
80
|
+
? InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes>
|
|
81
|
+
: InsertableTreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>,
|
|
82
|
+
in TMoveFrom = ReadonlyArrayNode,
|
|
83
|
+
> extends ReadonlyArrayNode<T> {
|
|
73
84
|
/**
|
|
74
85
|
* Inserts new item(s) at a specified location.
|
|
75
86
|
* @param index - The index at which to insert `value`.
|
|
@@ -369,20 +380,6 @@ export interface TreeArrayNodeBase<out T, in TNew, in TMoveFrom = ReadonlyArrayN
|
|
|
369
380
|
values(): IterableIterator<T>;
|
|
370
381
|
}
|
|
371
382
|
|
|
372
|
-
/**
|
|
373
|
-
* A {@link TreeNode} which implements 'readonly T[]' and the array mutation APIs.
|
|
374
|
-
*
|
|
375
|
-
* @typeParam TAllowedTypes - Schema for types which are allowed as members of this array.
|
|
376
|
-
*
|
|
377
|
-
* @sealed @public
|
|
378
|
-
*/
|
|
379
|
-
export interface TreeArrayNode<
|
|
380
|
-
TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes,
|
|
381
|
-
> extends TreeArrayNodeBase<
|
|
382
|
-
TreeNodeFromImplicitAllowedTypes<TAllowedTypes>,
|
|
383
|
-
InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes>
|
|
384
|
-
> {}
|
|
385
|
-
|
|
386
383
|
/**
|
|
387
384
|
* A {@link TreeNode} which implements 'readonly T[]' and the array mutation APIs.
|
|
388
385
|
* @public
|
package/src/simple-tree/index.ts
CHANGED
|
File without changes
|