@fluidframework/tree 2.73.0 → 2.74.0-365691
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 +15 -1
- package/dist/alpha.d.ts +4 -0
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +1 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.js +1 -0
- package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/dist/feature-libraries/treeCompressionUtils.d.ts +2 -12
- package/dist/feature-libraries/treeCompressionUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCompressionUtils.js +4 -14
- package/dist/feature-libraries/treeCompressionUtils.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.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/sharedTree.d.ts +7 -10
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +1 -0
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +2 -2
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +1 -1
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +15 -12
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +17 -14
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +1 -0
- package/dist/simple-tree/core/treeNodeKernel.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 +2 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +1 -0
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +1 -0
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/treeFactory.d.ts +5 -0
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +12 -5
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/breakable.js +3 -3
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/typeCheckTests.d.ts.map +1 -1
- package/dist/util/typeCheckTests.js.map +1 -1
- package/lib/alpha.d.ts +4 -0
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -2
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.js +1 -0
- package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/lib/feature-libraries/treeCompressionUtils.d.ts +2 -12
- package/lib/feature-libraries/treeCompressionUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCompressionUtils.js +3 -13
- package/lib/feature-libraries/treeCompressionUtils.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.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/sharedTree.d.ts +7 -10
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +1 -0
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +2 -2
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +1 -1
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +15 -12
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +15 -12
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +1 -0
- package/lib/simple-tree/core/treeNodeKernel.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 +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +1 -0
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +1 -0
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/treeFactory.d.ts +5 -0
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +10 -4
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/breakable.js +3 -3
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/typeCheckTests.d.ts.map +1 -1
- package/lib/util/typeCheckTests.js.map +1 -1
- package/package.json +22 -22
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +3 -7
- package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +5 -6
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +2 -2
- package/src/feature-libraries/index.ts +1 -5
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +3 -6
- package/src/feature-libraries/sequence-field/formatV2.ts +1 -0
- package/src/feature-libraries/treeCompressionUtils.ts +1 -15
- package/src/index.ts +4 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/sharedTree.ts +12 -18
- package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
- package/src/shared-tree/treeCheckout.ts +2 -2
- package/src/shared-tree-core/index.ts +1 -1
- package/src/simple-tree/api/incrementalAllowedTypes.ts +20 -18
- package/src/simple-tree/api/index.ts +1 -1
- package/src/simple-tree/api/tree.ts +1 -1
- package/src/simple-tree/core/treeNodeKernel.ts +1 -0
- package/src/simple-tree/index.ts +1 -1
- package/src/simple-tree/node-kinds/array/arrayNode.ts +2 -0
- package/src/simple-tree/node-kinds/object/objectNode.ts +2 -1
- package/src/treeFactory.ts +13 -4
- package/src/util/breakable.ts +4 -4
- package/src/util/typeCheckTests.ts +0 -1
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
ModularChangeFamily,
|
|
24
24
|
type ModularChangeset,
|
|
25
25
|
type TreeChunk,
|
|
26
|
-
type
|
|
26
|
+
type TreeCompressionStrategy,
|
|
27
27
|
fieldKindConfigurations,
|
|
28
28
|
fieldKinds,
|
|
29
29
|
makeModularChangeCodecFamily,
|
|
@@ -61,7 +61,7 @@ export class SharedTreeChangeFamily
|
|
|
61
61
|
revisionTagCodec: RevisionTagCodec,
|
|
62
62
|
fieldBatchCodec: FieldBatchCodec,
|
|
63
63
|
codecOptions: CodecWriteOptions,
|
|
64
|
-
chunkCompressionStrategy?:
|
|
64
|
+
chunkCompressionStrategy?: TreeCompressionStrategy,
|
|
65
65
|
private readonly idCompressor?: IIdCompressor,
|
|
66
66
|
) {
|
|
67
67
|
const modularChangeCodec = makeModularChangeCodecFamily(
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
} from "../core/index.js";
|
|
52
52
|
import {
|
|
53
53
|
type FieldBatchCodec,
|
|
54
|
-
type
|
|
54
|
+
type TreeCompressionStrategy,
|
|
55
55
|
allowsRepoSuperset,
|
|
56
56
|
buildForest,
|
|
57
57
|
createNodeIdentifierManager,
|
|
@@ -287,7 +287,7 @@ export function createTreeCheckout(
|
|
|
287
287
|
forest?: IEditableForest;
|
|
288
288
|
fieldBatchCodec?: FieldBatchCodec;
|
|
289
289
|
removedRoots?: DetachedFieldIndex;
|
|
290
|
-
chunkCompressionStrategy?:
|
|
290
|
+
chunkCompressionStrategy?: TreeCompressionStrategy;
|
|
291
291
|
logger?: ITelemetryLoggerExt;
|
|
292
292
|
breaker?: Breakable;
|
|
293
293
|
disposeForksAfterTransaction?: boolean;
|
|
@@ -27,7 +27,7 @@ export {
|
|
|
27
27
|
type SummaryElementParser,
|
|
28
28
|
type SummaryElementStringifier,
|
|
29
29
|
type ClonableSchemaAndPolicy,
|
|
30
|
-
type SharedTreeCoreOptionsInternal
|
|
30
|
+
type SharedTreeCoreOptionsInternal,
|
|
31
31
|
} from "./sharedTreeCore.js";
|
|
32
32
|
|
|
33
33
|
export type { ResubmitMachine } from "./resubmitMachine.js";
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { FieldKey, TreeNodeSchemaIdentifier } from "../../core/index.js";
|
|
7
6
|
import { getTreeNodeSchemaPrivateData, type AllowedTypesFull } from "../core/index.js";
|
|
8
7
|
import { isObjectNodeSchema } from "../node-kinds/index.js";
|
|
9
8
|
import type { TreeSchema } from "./configuration.js";
|
|
10
9
|
import type { IncrementalEncodingPolicy } from "../../feature-libraries/index.js";
|
|
11
10
|
import { oneFromIterable } from "../../util/index.js";
|
|
12
11
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
12
|
+
import type { FieldKey } from "../../core/index.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* A symbol when present in the {@link AnnotatedAllowedTypes.metadata
|
|
15
|
+
* A symbol when present in the {@link AnnotatedAllowedTypes.metadata}'s `custom` property as true, opts in the allowed
|
|
16
16
|
* types to incremental summary optimization.
|
|
17
17
|
* These allowed types will be optimized during summary such that if they don't change across summaries,
|
|
18
18
|
* they will not be encoded and their content will not be included in the summary that is uploaded to the service.
|
|
19
19
|
* @remarks
|
|
20
|
-
* See {@link
|
|
20
|
+
* See {@link incrementalEncodingPolicyForAllowedTypes} for more details.
|
|
21
21
|
*
|
|
22
22
|
* Use {@link SchemaStaticsBeta.types} to add this metadata to allowed types in a schema.
|
|
23
23
|
* @example
|
|
@@ -29,6 +29,7 @@ import { assert } from "@fluidframework/core-utils/internal";
|
|
|
29
29
|
* }),
|
|
30
30
|
* }) {}
|
|
31
31
|
* ```
|
|
32
|
+
* @alpha
|
|
32
33
|
*/
|
|
33
34
|
export const incrementalSummaryHint: unique symbol = Symbol("IncrementalSummaryHint");
|
|
34
35
|
|
|
@@ -44,31 +45,30 @@ function isIncrementalSummaryHintInAllowedTypes(allowedTypes: AllowedTypesFull):
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
/**
|
|
47
|
-
* This helper function {@link
|
|
48
|
-
* of type {@link IncrementalEncodingPolicy}.
|
|
49
|
-
*
|
|
48
|
+
* This helper function {@link incrementalEncodingPolicyForAllowedTypes} can be used to generate a callback function
|
|
49
|
+
* of type {@link IncrementalEncodingPolicy}. It determines if each {@link AllowedTypes} in a schema should be
|
|
50
|
+
* incrementally summarized.
|
|
51
|
+
* This callback can be passed as the value for {@link SharedTreeOptions.shouldEncodeIncrementally} parameter
|
|
50
52
|
* when creating the tree.
|
|
51
|
-
* It will be called for each {@link AllowedTypes} in the schema to determine if it should be incrementally summarized.
|
|
52
53
|
*
|
|
53
54
|
* @param rootSchema - The schema for the root of the tree.
|
|
54
|
-
* @returns A callback function of type {@link IncrementalEncodingPolicy} which
|
|
55
|
-
*
|
|
56
|
-
* {@link incrementalAllowedTypesMetadata} metadata.
|
|
55
|
+
* @returns A callback function of type {@link IncrementalEncodingPolicy} which determines if allowed types should
|
|
56
|
+
* be incrementally summarized based on whether they have opted in via the {@link incrementalSummaryHint} metadata.
|
|
57
57
|
*
|
|
58
58
|
* @remarks
|
|
59
59
|
* This only works for forest type {@link ForestTypeOptimized} and compression strategy
|
|
60
|
-
* {@link
|
|
60
|
+
* {@link TreeCompressionStrategy.CompressedIncremental}.
|
|
61
61
|
*
|
|
62
|
-
*
|
|
62
|
+
* @privateRemarks
|
|
63
|
+
* The {@link incrementalSummaryHint} will be replaced with a specialized metadata property once the
|
|
63
64
|
* incremental summary feature and APIs are stabilized.
|
|
65
|
+
*
|
|
66
|
+
* @alpha
|
|
64
67
|
*/
|
|
65
|
-
export function
|
|
68
|
+
export function incrementalEncodingPolicyForAllowedTypes(
|
|
66
69
|
rootSchema: TreeSchema,
|
|
67
70
|
): IncrementalEncodingPolicy {
|
|
68
|
-
return (
|
|
69
|
-
targetNodeIdentifier: TreeNodeSchemaIdentifier | undefined,
|
|
70
|
-
targetFieldKey: FieldKey,
|
|
71
|
-
) => {
|
|
71
|
+
return (targetNodeIdentifier: string | undefined, targetFieldKey: string) => {
|
|
72
72
|
if (targetNodeIdentifier === undefined) {
|
|
73
73
|
// Root fields cannot be allowed types, so we don't incrementally summarize them.
|
|
74
74
|
return false;
|
|
@@ -85,7 +85,9 @@ export function getShouldIncrementallySummarizeAllowedTypes(
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
if (isObjectNodeSchema(targetNode)) {
|
|
88
|
-
const targetPropertyKey = targetNode.storedKeyToPropertyKey.get(
|
|
88
|
+
const targetPropertyKey = targetNode.storedKeyToPropertyKey.get(
|
|
89
|
+
targetFieldKey as FieldKey,
|
|
90
|
+
);
|
|
89
91
|
if (targetPropertyKey !== undefined) {
|
|
90
92
|
const fieldSchema = targetNode.fields.get(targetPropertyKey);
|
|
91
93
|
if (fieldSchema !== undefined) {
|
|
@@ -164,7 +164,7 @@ export { generateSchemaFromSimpleSchema } from "./schemaFromSimple.js";
|
|
|
164
164
|
export { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
|
|
165
165
|
export type { TreeChangeEvents } from "./treeChangeEvents.js";
|
|
166
166
|
export {
|
|
167
|
-
|
|
167
|
+
incrementalEncodingPolicyForAllowedTypes,
|
|
168
168
|
incrementalSummaryHint,
|
|
169
169
|
} from "./incrementalAllowedTypes.js";
|
|
170
170
|
export {
|
|
@@ -449,7 +449,7 @@ export interface SchemaCompatibilityStatus {
|
|
|
449
449
|
*
|
|
450
450
|
* In these cases `canUpgrade` and `isEquivalent` will be false.
|
|
451
451
|
*
|
|
452
|
-
* When the documents allowed by the view schema is a strict superset of those by the stored schema,
|
|
452
|
+
* When the set of documents allowed by the view schema is a strict superset of those allowed by the stored schema,
|
|
453
453
|
* `canView` is false because writes to the document using the view schema could make the document violate its stored schema.
|
|
454
454
|
* In this case, the stored schema could be updated to match the provided view schema, allowing read-write access to the tree.
|
|
455
455
|
* See {@link SchemaCompatibilityStatus.canUpgrade}.
|
|
@@ -294,6 +294,7 @@ export class TreeNodeKernel {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
297
298
|
const kernelEvents = ["childrenChangedAfterBatch", "subtreeChangedAfterBatch"] as const;
|
|
298
299
|
|
|
299
300
|
type KernelEvents = Pick<AnchorEvents, (typeof kernelEvents)[number]>;
|
package/src/simple-tree/index.ts
CHANGED
|
@@ -186,7 +186,7 @@ export {
|
|
|
186
186
|
KeyEncodingOptions,
|
|
187
187
|
type TreeParsingOptions,
|
|
188
188
|
incrementalSummaryHint,
|
|
189
|
-
|
|
189
|
+
incrementalEncodingPolicyForAllowedTypes,
|
|
190
190
|
type SchemaFactory_base,
|
|
191
191
|
} from "./api/index.js";
|
|
192
192
|
export type {
|
|
@@ -578,6 +578,7 @@ const TreeNodeWithArrayFeatures = (() => {
|
|
|
578
578
|
*/
|
|
579
579
|
/* eslint-disable @typescript-eslint/explicit-member-accessibility, @typescript-eslint/no-explicit-any */
|
|
580
580
|
// prettier-ignore
|
|
581
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
581
582
|
declare abstract class NodeWithArrayFeatures<Input, T>
|
|
582
583
|
extends TreeNodeValid<Input>
|
|
583
584
|
implements Pick<readonly T[], (typeof arrayPrototypeKeys)[number]>
|
|
@@ -1326,6 +1327,7 @@ function arrayChildToFlexTree(
|
|
|
1326
1327
|
*/
|
|
1327
1328
|
function arrayToFlexContent(data: FactoryContent, schema: ArrayNodeSchema): FlexContent {
|
|
1328
1329
|
if (!(typeof data === "object" && data !== null && Symbol.iterator in data)) {
|
|
1330
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
1329
1331
|
throw new UsageError(`Input data is incompatible with Array schema: ${data}`);
|
|
1330
1332
|
}
|
|
1331
1333
|
|
|
@@ -99,7 +99,7 @@ import type { ObjectSchemaOptionsAlpha } from "../../api/index.js";
|
|
|
99
99
|
*/
|
|
100
100
|
export type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> =
|
|
101
101
|
RestrictiveStringRecord<ImplicitFieldSchema> extends T
|
|
102
|
-
? // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
102
|
+
? // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
103
103
|
{}
|
|
104
104
|
: {
|
|
105
105
|
-readonly [Property in keyof T]: Property extends string
|
|
@@ -651,6 +651,7 @@ function objectToFlexContent(
|
|
|
651
651
|
Symbol.iterator in data ||
|
|
652
652
|
isFluidHandle(data)
|
|
653
653
|
) {
|
|
654
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
654
655
|
throw new UsageError(`Input data is incompatible with Object schema: ${data}`);
|
|
655
656
|
}
|
|
656
657
|
|
package/src/treeFactory.ts
CHANGED
|
@@ -148,6 +148,16 @@ export function configuredSharedTreeBetaLegacy(
|
|
|
148
148
|
return configuredSharedTree(options);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
/**
|
|
152
|
+
* {@link configuredSharedTreeBeta} but including the alpha {@link SharedTreeOptions}.
|
|
153
|
+
* @alpha
|
|
154
|
+
*/
|
|
155
|
+
export function configuredSharedTreeAlpha(
|
|
156
|
+
options: SharedTreeOptions,
|
|
157
|
+
): SharedObjectKind<ITree> {
|
|
158
|
+
return configuredSharedTree(options);
|
|
159
|
+
}
|
|
160
|
+
|
|
151
161
|
/**
|
|
152
162
|
* {@link configuredSharedTreeBetaLegacy} but including `@alpha` options.
|
|
153
163
|
*
|
|
@@ -195,10 +205,9 @@ export function resolveOptions(options: SharedTreeOptions): SharedTreeOptionsInt
|
|
|
195
205
|
const internal: SharedTreeOptionsInternal = {
|
|
196
206
|
...resolveSharedBranchesOptions(options.enableSharedBranches),
|
|
197
207
|
};
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
copyProperty(options, "treeEncodeType", internal);
|
|
208
|
+
for (const optionName of Object.keys(options)) {
|
|
209
|
+
copyProperty(options, optionName, internal);
|
|
210
|
+
}
|
|
202
211
|
return internal;
|
|
203
212
|
}
|
|
204
213
|
|
package/src/util/breakable.ts
CHANGED
|
@@ -171,10 +171,10 @@ export function throwIfBroken<
|
|
|
171
171
|
return replacementMethod as Target;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
174
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
175
175
|
type PossiblyNamedFunction = Function & { displayName?: undefined | string };
|
|
176
176
|
|
|
177
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
177
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
178
178
|
function nameFunctionFrom(toName: Function, nameFrom: Function): void {
|
|
179
179
|
(toName as PossiblyNamedFunction).displayName =
|
|
180
180
|
(nameFrom as PossiblyNamedFunction).displayName ?? nameFrom.name;
|
|
@@ -183,13 +183,13 @@ function nameFunctionFrom(toName: Function, nameFrom: Function): void {
|
|
|
183
183
|
const isBreakerSymbol: unique symbol = Symbol("isBreaker");
|
|
184
184
|
|
|
185
185
|
// Accepting any function like value is desired and safe here as this does not call the provided function.
|
|
186
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
186
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
187
187
|
function markBreaker(f: Function): void {
|
|
188
188
|
(f as unknown as Record<typeof isBreakerSymbol, true>)[isBreakerSymbol] = true;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
// Accepting any function like value is desired and safe here as this does not call the provided function.
|
|
192
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
192
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
193
193
|
function isBreaker(f: Function): boolean {
|
|
194
194
|
return isBreakerSymbol in (f as unknown as Record<typeof isBreakerSymbol, true>);
|
|
195
195
|
}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
// These tests include making sure some banned types (like `{}`) work correctly,
|
|
7
7
|
// and are authored with awareness of the issues with these types.
|
|
8
8
|
|
|
9
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
10
9
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11
10
|
/* eslint-disable @typescript-eslint/no-extraneous-class */
|
|
12
11
|
|