@fluidframework/tree 2.71.0 → 2.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +125 -40
- package/api-report/tree.alpha.api.md +44 -48
- package/api-report/tree.beta.api.md +42 -0
- package/api-report/tree.legacy.beta.api.md +42 -0
- package/dist/alpha.d.ts +12 -8
- package/dist/api.d.ts +6 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +2 -11
- package/dist/api.js.map +1 -1
- package/dist/beta.d.ts +7 -0
- package/dist/codec/codec.d.ts +23 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +23 -3
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +2 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +7 -2
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +24 -1
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/index.d.ts +1 -1
- package/dist/codec/versioned/index.d.ts.map +1 -1
- package/dist/codec/versioned/index.js +2 -1
- package/dist/codec/versioned/index.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/index.d.ts +1 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +2 -2
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +18 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +6 -7
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +31 -8
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +8 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
- package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.js +3 -3
- package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -1
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/external-utilities/typeboxValidator.js +1 -1
- package/dist/external-utilities/typeboxValidator.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +1 -0
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +39 -21
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +163 -6
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +13 -4
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +23 -6
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +20 -4
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +2 -2
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -25
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +54 -74
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -3
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -8
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +4 -5
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +15 -4
- package/dist/feature-libraries/forest-summary/codec.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/forest-summary/format.d.ts +9 -2
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +11 -4
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -1
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +6 -5
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +9 -8
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +1 -2
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +29 -11
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +3 -2
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +0 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +1 -3
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +3 -2
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/index.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
- package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/index.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +5 -4
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +10 -10
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +24 -18
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
- package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -2
- package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -0
- package/dist/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
- package/dist/feature-libraries/schemaChecker.js.map +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +7 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +22 -15
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +1 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +12 -60
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +68 -159
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +8 -7
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +10 -11
- package/dist/shared-tree/sharedTreeChangeCodecs.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/treeAlpha.d.ts +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +4 -2
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +1 -3
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +19 -6
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +42 -18
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +36 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +40 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -4
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.js +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +5 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +12 -3
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts +2 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV5.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +19 -6
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +49 -21
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +48 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -0
- package/dist/shared-tree-core/messageFormat.js +53 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -8
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +3 -3
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +2 -0
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +10 -0
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +2 -2
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +4 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +8 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -52
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js +61 -7
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +13 -4
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
- package/dist/simple-tree/api/simpleSchemaCodec.js +290 -0
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +128 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
- package/dist/simple-tree/api/storedSchema.d.ts +2 -2
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +8 -6
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +3 -3
- package/dist/simple-tree/api/tree.js +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +6 -6
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +78 -35
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +3 -3
- package/dist/simple-tree/core/allowedTypes.js +2 -2
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +3 -3
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +3 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +12 -5
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js +26 -10
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNode.js +1 -1
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -6
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js +1 -2
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +1 -8
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +3 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +12 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +0 -1
- package/dist/simple-tree/leafNodeSchema.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 +14 -50
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +2 -6
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +4 -12
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +3 -7
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +25 -5
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
- package/dist/simple-tree/simpleSchemaFormatV1.js +115 -0
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -0
- package/dist/simple-tree/toStoredSchema.d.ts +20 -8
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +27 -22
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +18 -15
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/tableSchema.d.ts +22 -52
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +141 -277
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts +3 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +26 -2
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/arrayUtilities.d.ts +45 -0
- package/dist/util/arrayUtilities.d.ts.map +1 -0
- package/dist/util/arrayUtilities.js +76 -0
- package/dist/util/arrayUtilities.js.map +1 -0
- package/dist/util/brand.d.ts +31 -2
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +28 -2
- package/dist/util/brand.js.map +1 -1
- package/dist/util/brandedMap.d.ts +3 -1
- package/dist/util/brandedMap.d.ts.map +1 -1
- package/dist/util/brandedMap.js.map +1 -1
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +8 -2
- package/dist/util/index.js.map +1 -1
- package/lib/alpha.d.ts +12 -8
- package/lib/api.d.ts +6 -2
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js +2 -13
- package/lib/api.js.map +1 -1
- package/lib/beta.d.ts +7 -0
- package/lib/codec/codec.d.ts +23 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +23 -3
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +7 -2
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +22 -0
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/index.d.ts +1 -1
- package/lib/codec/versioned/index.d.ts.map +1 -1
- package/lib/codec/versioned/index.js +1 -1
- package/lib/codec/versioned/index.js.map +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/schema-stored/index.d.ts +1 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +1 -1
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +18 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +6 -7
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -2
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +31 -8
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js +7 -0
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV1.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -1
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/external-utilities/typeboxValidator.js +1 -1
- package/lib/external-utilities/typeboxValidator.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +2 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +42 -23
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +5 -3
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +163 -6
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +12 -3
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -6
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +17 -2
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -25
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +56 -76
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -3
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -3
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +4 -5
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +16 -5
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +9 -2
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +9 -2
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +1 -0
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +6 -5
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -4
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +1 -2
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +29 -11
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +3 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +0 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +0 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +2 -1
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/index.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
- package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/index.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -5
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +10 -10
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +26 -20
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
- package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.js +2 -2
- package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -2
- package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.js +2 -2
- package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -0
- package/lib/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
- package/lib/feature-libraries/schemaChecker.js.map +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +7 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +11 -4
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +12 -60
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +70 -161
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +8 -7
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +5 -6
- package/lib/shared-tree/sharedTreeChangeCodecs.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/treeAlpha.d.ts +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +5 -3
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +1 -3
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +19 -6
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +39 -17
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +36 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +39 -0
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +5 -5
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV5.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV5.js +2 -2
- package/lib/shared-tree-core/editManagerFormatV5.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +5 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +4 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts +2 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV5.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +19 -6
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +46 -20
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +48 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -0
- package/lib/shared-tree-core/messageFormat.js +50 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -8
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +3 -3
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +2 -0
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +10 -0
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +2 -2
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +4 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -52
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js +58 -4
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +14 -5
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
- package/lib/simple-tree/api/simpleSchemaCodec.js +262 -0
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +122 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
- package/lib/simple-tree/api/storedSchema.d.ts +2 -2
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +5 -3
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +3 -3
- package/lib/simple-tree/api/tree.js +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +6 -6
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +75 -34
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +3 -3
- package/lib/simple-tree/core/allowedTypes.js +2 -2
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +3 -3
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +2 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/toStored.d.ts +12 -5
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js +25 -9
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNode.js +1 -1
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -6
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js +1 -2
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +2 -9
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +3 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +1 -2
- package/lib/simple-tree/leafNodeSchema.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 +17 -53
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +5 -9
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +6 -14
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +6 -10
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +25 -5
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
- package/lib/simple-tree/simpleSchemaFormatV1.js +112 -0
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -0
- package/lib/simple-tree/toStoredSchema.d.ts +20 -8
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +28 -24
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +20 -17
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/tableSchema.d.ts +22 -52
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +143 -279
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts +3 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +23 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/arrayUtilities.d.ts +45 -0
- package/lib/util/arrayUtilities.d.ts.map +1 -0
- package/lib/util/arrayUtilities.js +69 -0
- package/lib/util/arrayUtilities.js.map +1 -0
- package/lib/util/brand.d.ts +31 -2
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +26 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/brandedMap.d.ts +3 -1
- package/lib/util/brandedMap.d.ts.map +1 -1
- package/lib/util/brandedMap.js.map +1 -1
- package/lib/util/index.d.ts +2 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -1
- package/lib/util/index.js.map +1 -1
- package/package.json +24 -24
- package/src/api.ts +22 -11
- package/src/codec/codec.ts +25 -3
- package/src/codec/index.ts +1 -0
- package/src/codec/versioned/codec.ts +40 -2
- package/src/codec/versioned/index.ts +1 -0
- package/src/core/index.ts +1 -2
- package/src/core/schema-stored/index.ts +1 -2
- package/src/core/schema-stored/schema.ts +22 -8
- package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
- package/src/core/tree/detachedFieldIndexCodecV1.ts +4 -2
- package/src/core/tree/detachedFieldIndexCodecV2.ts +4 -6
- package/src/core/tree/detachedFieldIndexCodecs.ts +40 -11
- package/src/core/tree/detachedFieldIndexFormatCommon.ts +17 -2
- package/src/core/tree/detachedFieldIndexFormatV1.ts +6 -4
- package/src/core/tree/detachedFieldIndexFormatV2.ts +6 -4
- package/src/core/tree/index.ts +2 -4
- package/src/external-utilities/typeboxValidator.ts +1 -1
- package/src/feature-libraries/README.md +1 -1
- package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -3
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +5 -0
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -1
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +65 -27
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +9 -4
- package/src/feature-libraries/chunked-forest/codec/format.ts +26 -5
- package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +7 -2
- package/src/feature-libraries/chunked-forest/codec/index.ts +1 -2
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +62 -9
- package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +24 -2
- package/src/feature-libraries/chunked-forest/index.ts +1 -2
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +88 -103
- package/src/feature-libraries/default-schema/index.ts +1 -9
- package/src/feature-libraries/forest-summary/codec.ts +24 -9
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
- package/src/feature-libraries/forest-summary/format.ts +25 -9
- package/src/feature-libraries/forest-summary/index.ts +2 -1
- package/src/feature-libraries/index.ts +8 -7
- package/src/feature-libraries/modular-schema/comparison.ts +2 -3
- package/src/feature-libraries/modular-schema/fieldKind.ts +90 -13
- package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +2 -3
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +6 -6
- package/src/feature-libraries/modular-schema/index.ts +0 -1
- package/src/feature-libraries/modular-schema/isNeverTree.ts +7 -8
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +13 -13
- package/src/feature-libraries/object-forest/objectForest.ts +2 -6
- package/src/feature-libraries/optional-field/index.ts +1 -0
- package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
- package/src/feature-libraries/schema-edits/index.ts +0 -1
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +16 -16
- package/src/feature-libraries/schema-index/codec.ts +41 -22
- package/src/feature-libraries/schema-index/formatV1.ts +2 -2
- package/src/feature-libraries/schema-index/formatV2.ts +2 -2
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +2 -1
- package/src/feature-libraries/{default-schema/schemaChecker.ts → schemaChecker.ts} +4 -4
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +0 -2
- package/src/index.ts +6 -2
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +16 -5
- package/src/shared-tree/index.ts +0 -1
- package/src/shared-tree/sharedTree.ts +92 -222
- package/src/shared-tree/sharedTreeChangeCodecs.ts +14 -13
- package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
- package/src/shared-tree/treeAlpha.ts +6 -5
- package/src/shared-tree/treeCheckout.ts +1 -3
- package/src/shared-tree-core/editManagerCodecs.ts +69 -20
- package/src/shared-tree-core/editManagerFormatCommons.ts +46 -0
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +10 -5
- package/src/shared-tree-core/editManagerFormatV5.ts +3 -3
- package/src/shared-tree-core/index.ts +15 -5
- package/src/shared-tree-core/messageCodecV1ToV4.ts +6 -1
- package/src/shared-tree-core/messageCodecV5.ts +2 -1
- package/src/shared-tree-core/messageCodecs.ts +77 -28
- package/src/shared-tree-core/messageFormat.ts +58 -0
- package/src/shared-tree-core/sharedTreeCore.ts +11 -13
- package/src/simple-tree/api/configuration.ts +17 -4
- package/src/simple-tree/api/discrepancies.ts +2 -2
- package/src/simple-tree/api/incrementalAllowedTypes.ts +1 -1
- package/src/simple-tree/api/index.ts +11 -2
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -168
- package/src/simple-tree/api/schemaFactoryBeta.ts +180 -14
- package/src/simple-tree/api/schemaFromSimple.ts +20 -9
- package/src/simple-tree/api/simpleSchemaCodec.ts +361 -0
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +135 -0
- package/src/simple-tree/api/storedSchema.ts +8 -5
- package/src/simple-tree/api/tree.ts +3 -3
- package/src/simple-tree/api/typesUnsafe.ts +6 -6
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +80 -47
- package/src/simple-tree/core/allowedTypes.ts +4 -4
- package/src/simple-tree/core/index.ts +3 -1
- package/src/simple-tree/core/toStored.ts +42 -18
- package/src/simple-tree/core/treeNode.ts +2 -2
- package/src/simple-tree/core/treeNodeSchema.ts +1 -7
- package/src/simple-tree/core/treeNodeValid.ts +0 -2
- package/src/simple-tree/fieldSchema.ts +2 -11
- package/src/simple-tree/index.ts +11 -2
- package/src/simple-tree/leafNodeSchema.ts +1 -2
- package/src/simple-tree/node-kinds/array/arrayNode.ts +28 -77
- package/src/simple-tree/node-kinds/map/mapNode.ts +3 -17
- package/src/simple-tree/node-kinds/object/objectNode.ts +5 -20
- package/src/simple-tree/node-kinds/record/recordNode.ts +4 -18
- package/src/simple-tree/simpleSchema.ts +27 -5
- package/src/simple-tree/simpleSchemaFormatV1.ts +179 -0
- package/src/simple-tree/toStoredSchema.ts +54 -38
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +22 -17
- package/src/tableSchema.ts +110 -331
- package/src/treeFactory.ts +33 -1
- package/src/util/arrayUtilities.ts +88 -0
- package/src/util/brand.ts +40 -2
- package/src/util/brandedMap.ts +3 -1
- package/src/util/index.ts +7 -0
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +0 -15
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +0 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +0 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -76
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -158
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -245
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +0 -12
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +0 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +0 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -71
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -154
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -241
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
- package/src/feature-libraries/default-schema/defaultSchema.ts +0 -15
- package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +0 -108
- package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +0 -208
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +0 -344
package/src/tableSchema.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { fail } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { TreeAlpha } from "./shared-tree/index.js";
|
|
10
10
|
import {
|
|
11
11
|
type FieldHasDefault,
|
|
12
12
|
type ImplicitAllowedTypes,
|
|
@@ -26,10 +26,10 @@ import {
|
|
|
26
26
|
type InternalTreeNode,
|
|
27
27
|
SchemaFactory,
|
|
28
28
|
type ImplicitFieldSchema,
|
|
29
|
-
isArrayNodeSchema,
|
|
30
|
-
type InsertableField,
|
|
31
29
|
withBufferedTreeEvents,
|
|
30
|
+
type TreeRecordNode,
|
|
32
31
|
} from "./simple-tree/index.js";
|
|
32
|
+
import { validateIndex, validateIndexRange } from "./util/index.js";
|
|
33
33
|
|
|
34
34
|
// Future improvement TODOs:
|
|
35
35
|
// - Omit `cells` property from Row insertion type.
|
|
@@ -44,52 +44,31 @@ import {
|
|
|
44
44
|
*/
|
|
45
45
|
const tableSchemaFactorySubScope = "table";
|
|
46
46
|
|
|
47
|
-
/**
|
|
48
|
-
* Gets the table containing the provided row/column node, if the node is part of a table.
|
|
49
|
-
* @remarks Assumes that the table is the grandparent of the row/column node.
|
|
50
|
-
*/
|
|
51
|
-
function getParentTable(
|
|
52
|
-
rowOrColumnNode: TreeNode,
|
|
53
|
-
):
|
|
54
|
-
| (TreeNode &
|
|
55
|
-
TableSchema.Table<
|
|
56
|
-
string | undefined,
|
|
57
|
-
ImplicitAllowedTypes,
|
|
58
|
-
System_TableSchema.ColumnSchemaBase,
|
|
59
|
-
System_TableSchema.RowSchemaBase
|
|
60
|
-
>)
|
|
61
|
-
| undefined {
|
|
62
|
-
const rowListNode = Tree.parent(rowOrColumnNode);
|
|
63
|
-
if (rowListNode === undefined || !isArrayNodeSchema(Tree.schema(rowListNode))) {
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
const tableNode = Tree.parent(rowListNode);
|
|
67
|
-
if (tableNode === undefined || !isTableNode(tableNode)) {
|
|
68
|
-
return undefined;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return tableNode;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
47
|
/**
|
|
75
48
|
* A private symbol put on table schema to help identify them.
|
|
76
49
|
*/
|
|
77
50
|
const tableSchemaSymbol: unique symbol = Symbol("tableNode");
|
|
78
51
|
|
|
79
52
|
/**
|
|
80
|
-
*
|
|
81
|
-
* @
|
|
53
|
+
* A row in a table.
|
|
54
|
+
* @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
|
|
55
|
+
* @typeParam TProps - Additional properties to associate with the row.
|
|
56
|
+
* @privateRemarks Private counterpart to the {@link TableSchema.Row}.
|
|
57
|
+
* Exposes internal properties needed for table operations (publicly exposed via {@link TableSchema.Table}).
|
|
58
|
+
* @sealed
|
|
82
59
|
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
60
|
+
export interface RowPrivate<
|
|
61
|
+
TCell extends ImplicitAllowedTypes,
|
|
62
|
+
TProps extends ImplicitFieldSchema = ImplicitFieldSchema,
|
|
63
|
+
> extends TableSchema.Row<TCell, TProps> {
|
|
64
|
+
/**
|
|
65
|
+
* The row's cells.
|
|
66
|
+
* @remarks This is a user-defined schema that can be used to store additional information about the row.
|
|
67
|
+
* @privateRemarks
|
|
68
|
+
* Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createRowSchema}.
|
|
69
|
+
* If you update the docs here, please also update the inline type definitions.
|
|
70
|
+
*/
|
|
71
|
+
readonly cells: TreeRecordNode<TCell>;
|
|
93
72
|
}
|
|
94
73
|
|
|
95
74
|
/**
|
|
@@ -161,16 +140,10 @@ export namespace System_TableSchema {
|
|
|
161
140
|
const TInputScope extends string | undefined,
|
|
162
141
|
const TCellSchema extends ImplicitAllowedTypes,
|
|
163
142
|
const TPropsSchema extends ImplicitFieldSchema,
|
|
164
|
-
>(
|
|
165
|
-
inputSchemaFactory: SchemaFactoryBeta<TInputScope>,
|
|
166
|
-
cellSchema: TCellSchema,
|
|
167
|
-
propsSchema: TPropsSchema,
|
|
168
|
-
) {
|
|
143
|
+
>(inputSchemaFactory: SchemaFactoryBeta<TInputScope>, propsSchema: TPropsSchema) {
|
|
169
144
|
const schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);
|
|
170
145
|
type Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;
|
|
171
146
|
|
|
172
|
-
type CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;
|
|
173
|
-
|
|
174
147
|
// Note: `columnFields` is broken into two parts to work around a TypeScript bug
|
|
175
148
|
// that results in broken `.d.ts` output.
|
|
176
149
|
// See definition of `ColumnInsertableType` below.
|
|
@@ -205,33 +178,7 @@ export namespace System_TableSchema {
|
|
|
205
178
|
// Will make it easier to evolve this schema in the future.
|
|
206
179
|
allowUnknownOptionalFields: true,
|
|
207
180
|
})
|
|
208
|
-
implements TableSchema.Column<TCellSchema, TPropsSchema>
|
|
209
|
-
{
|
|
210
|
-
public getCells(): {
|
|
211
|
-
rowId: string;
|
|
212
|
-
cell: CellValueType;
|
|
213
|
-
}[] {
|
|
214
|
-
const tableNode = getParentTable(this);
|
|
215
|
-
if (tableNode === undefined) {
|
|
216
|
-
throw new UsageError(`Column with ID "${this.id}" is not contained in a table.`);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
const result = [];
|
|
220
|
-
for (const row of tableNode.rows) {
|
|
221
|
-
const cell = row.getCell(this.id);
|
|
222
|
-
if (cell !== undefined) {
|
|
223
|
-
if (!Tree.is(cell, cellSchema)) {
|
|
224
|
-
throw new UsageError(
|
|
225
|
-
"Parent table contains a cell with incompatible with this column.",
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
result.push({ rowId: row.id, cell: cell as CellValueType });
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return result;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
181
|
+
implements TableSchema.Column<TCellSchema, TPropsSchema> {}
|
|
235
182
|
|
|
236
183
|
type ColumnValueType = TreeNode &
|
|
237
184
|
TableSchema.Column<TCellSchema, TPropsSchema> &
|
|
@@ -341,9 +288,6 @@ export namespace System_TableSchema {
|
|
|
341
288
|
const schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);
|
|
342
289
|
type Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;
|
|
343
290
|
|
|
344
|
-
type CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;
|
|
345
|
-
type CellInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TCellSchema>;
|
|
346
|
-
|
|
347
291
|
// Note: `rowFields` is broken into two parts to work around a TypeScript bug
|
|
348
292
|
// that results in broken `.d.ts` output.
|
|
349
293
|
// See definition of `RowInsertableType` below.
|
|
@@ -365,7 +309,7 @@ export namespace System_TableSchema {
|
|
|
365
309
|
} as const;
|
|
366
310
|
|
|
367
311
|
/**
|
|
368
|
-
* {@link
|
|
312
|
+
* {@link RowSchema} fields.
|
|
369
313
|
* @remarks Extracted for re-use in returned type signature defined later in this function.
|
|
370
314
|
* The implicit typing is intentional.
|
|
371
315
|
* Note: ideally we would add a satisfies clause here to ensure that this satisfies
|
|
@@ -380,75 +324,12 @@ export namespace System_TableSchema {
|
|
|
380
324
|
/**
|
|
381
325
|
* The Row schema - this is a map of Cells where the key is the column id
|
|
382
326
|
*/
|
|
383
|
-
class
|
|
327
|
+
class RowSchema
|
|
384
328
|
extends schemaFactory.object("Row", rowFields, {
|
|
385
329
|
// Will make it easier to evolve this schema in the future.
|
|
386
330
|
allowUnknownOptionalFields: true,
|
|
387
331
|
})
|
|
388
|
-
implements
|
|
389
|
-
{
|
|
390
|
-
public getCell(
|
|
391
|
-
columnOrId: TableSchema.Column<TCellSchema> | string,
|
|
392
|
-
): CellValueType | undefined {
|
|
393
|
-
const columnId = typeof columnOrId === "string" ? columnOrId : columnOrId.id;
|
|
394
|
-
// Unlike most objects, RecordNodes don't have the default inherited object properties, so this is safe
|
|
395
|
-
return this.cells[columnId];
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
public setCell(
|
|
399
|
-
columnOrId: TableSchema.Column<TCellSchema> | string,
|
|
400
|
-
value: CellInsertableType | undefined,
|
|
401
|
-
): void {
|
|
402
|
-
// TODO: throw if column does not exist in the owning table.
|
|
403
|
-
|
|
404
|
-
if (value === undefined) {
|
|
405
|
-
this.removeCell(columnOrId);
|
|
406
|
-
} else {
|
|
407
|
-
const columnId = typeof columnOrId === "string" ? columnOrId : columnOrId.id;
|
|
408
|
-
|
|
409
|
-
// TypeScript is unable to narrow the types correctly here, hence the casts.
|
|
410
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
411
|
-
this.cells[columnId] = TreeAlpha.create(
|
|
412
|
-
cellSchema,
|
|
413
|
-
value as InsertableField<TCellSchema>,
|
|
414
|
-
) as CellValueType;
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
public removeCell(
|
|
419
|
-
columnOrId: TableSchema.Column<TCellSchema> | string,
|
|
420
|
-
): CellValueType | undefined {
|
|
421
|
-
// TODO: throw if column does not exist in the owning table.
|
|
422
|
-
|
|
423
|
-
const columnId = typeof columnOrId === "string" ? columnOrId : columnOrId.id;
|
|
424
|
-
|
|
425
|
-
const cell: CellValueType | undefined = this.getCell(columnId);
|
|
426
|
-
if (cell === undefined) {
|
|
427
|
-
return undefined;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- The record's values are non-optional, so setting `undefined` as a means to remove the cell is not supported.
|
|
431
|
-
delete this.cells[columnId];
|
|
432
|
-
|
|
433
|
-
return cell;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
public getCells(): {
|
|
437
|
-
columnId: string;
|
|
438
|
-
cell: CellValueType;
|
|
439
|
-
}[] {
|
|
440
|
-
const result = [];
|
|
441
|
-
for (const [columnId, cell] of Object.entries(this.cells)) {
|
|
442
|
-
if (cell !== undefined) {
|
|
443
|
-
result.push({
|
|
444
|
-
columnId,
|
|
445
|
-
cell,
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
return result;
|
|
450
|
-
}
|
|
451
|
-
}
|
|
332
|
+
implements RowPrivate<TCellSchema, TPropsSchema> {}
|
|
452
333
|
|
|
453
334
|
type RowValueType = TreeNode &
|
|
454
335
|
TableSchema.Row<TCellSchema, TPropsSchema> &
|
|
@@ -491,14 +372,14 @@ export namespace System_TableSchema {
|
|
|
491
372
|
type RowSchemaModifiedType = Omit<
|
|
492
373
|
// Use mapped type to omit the constructor
|
|
493
374
|
{
|
|
494
|
-
[Property in keyof typeof
|
|
375
|
+
[Property in keyof typeof RowSchema]: (typeof RowSchema)[Property];
|
|
495
376
|
},
|
|
496
377
|
"createFromInsertable"
|
|
497
378
|
> &
|
|
498
379
|
(new (
|
|
499
380
|
parameters: InternalTreeNode | RowInsertableType,
|
|
500
|
-
) =>
|
|
501
|
-
createFromInsertable(parameters: RowInsertableType):
|
|
381
|
+
) => RowSchema) & {
|
|
382
|
+
createFromInsertable(parameters: RowInsertableType): RowSchema;
|
|
502
383
|
};
|
|
503
384
|
|
|
504
385
|
// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly "__#124291@#brand": unknown;`
|
|
@@ -513,7 +394,7 @@ export namespace System_TableSchema {
|
|
|
513
394
|
/* TInsertable */ object & RowInsertableType,
|
|
514
395
|
/* ImplicitlyConstructable */ true,
|
|
515
396
|
/* Info */ typeof rowFields
|
|
516
|
-
> =
|
|
397
|
+
> = RowSchema as RowSchemaModifiedType;
|
|
517
398
|
|
|
518
399
|
return RowSchemaType;
|
|
519
400
|
}
|
|
@@ -565,6 +446,9 @@ export namespace System_TableSchema {
|
|
|
565
446
|
type ColumnValueType = TreeNodeFromImplicitAllowedTypes<TColumnSchema>;
|
|
566
447
|
type RowValueType = TreeNodeFromImplicitAllowedTypes<TRowSchema>;
|
|
567
448
|
|
|
449
|
+
// Internal version of RowValueType that exposes the `cells` property for use within Table methods.
|
|
450
|
+
type RowValueInternalType = RowValueType & RowPrivate<TCellSchema>;
|
|
451
|
+
|
|
568
452
|
/**
|
|
569
453
|
* {@link Table} fields.
|
|
570
454
|
* @remarks Extracted for re-use in returned type signature defined later in this function.
|
|
@@ -592,45 +476,43 @@ export namespace System_TableSchema {
|
|
|
592
476
|
}
|
|
593
477
|
|
|
594
478
|
public getColumn(indexOrId: number | string): ColumnValueType | undefined {
|
|
595
|
-
return this
|
|
479
|
+
return this.#tryGetColumn(indexOrId);
|
|
596
480
|
}
|
|
597
481
|
|
|
598
482
|
public getRow(indexOrId: number | string): RowValueType | undefined {
|
|
599
|
-
return this
|
|
483
|
+
return this.#tryGetRow(indexOrId);
|
|
600
484
|
}
|
|
601
485
|
|
|
602
486
|
public getCell(
|
|
603
487
|
key: TableSchema.CellKey<TColumnSchema, TRowSchema>,
|
|
604
488
|
): CellValueType | undefined {
|
|
605
489
|
const { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;
|
|
606
|
-
const row = this
|
|
490
|
+
const row = this.#tryGetRow(rowOrIdOrIndex);
|
|
607
491
|
if (row === undefined) {
|
|
608
492
|
return undefined;
|
|
609
493
|
}
|
|
610
494
|
|
|
611
|
-
const column = this
|
|
495
|
+
const column = this.#tryGetColumn(columnOrIdOrIndex);
|
|
612
496
|
if (column === undefined) {
|
|
613
497
|
return undefined;
|
|
614
498
|
}
|
|
615
499
|
|
|
616
|
-
return row.
|
|
500
|
+
return (row as RowValueInternalType).cells[column.id];
|
|
617
501
|
}
|
|
618
502
|
|
|
619
503
|
public insertColumns({
|
|
620
504
|
columns,
|
|
621
505
|
index,
|
|
622
506
|
}: TableSchema.InsertColumnsParameters<TColumnSchema>): ColumnValueType[] {
|
|
623
|
-
// Ensure index is valid
|
|
624
|
-
if (index !== undefined) {
|
|
625
|
-
Table.validateInsertionIndex(index, this.columns);
|
|
626
|
-
}
|
|
627
|
-
|
|
628
507
|
// TypeScript is unable to narrow the column type correctly here, hence the casts below.
|
|
629
508
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
630
509
|
if (index === undefined) {
|
|
631
510
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
632
511
|
this.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);
|
|
633
512
|
} else {
|
|
513
|
+
// Ensure specified index is valid
|
|
514
|
+
validateIndex(index, this.columns, "Table.insertColumns", true);
|
|
515
|
+
|
|
634
516
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
635
517
|
this.columns.insertAt(index, TreeArrayNode.spread(columns) as any);
|
|
636
518
|
}
|
|
@@ -645,9 +527,9 @@ export namespace System_TableSchema {
|
|
|
645
527
|
}: TableSchema.InsertRowsParameters<TRowSchema>): RowValueType[] {
|
|
646
528
|
// #region Input validation
|
|
647
529
|
|
|
648
|
-
// Ensure index is valid
|
|
530
|
+
// Ensure specified index is valid
|
|
649
531
|
if (index !== undefined) {
|
|
650
|
-
|
|
532
|
+
validateIndex(index, this.rows, "Table.insertRows", true);
|
|
651
533
|
}
|
|
652
534
|
|
|
653
535
|
// Note: TypeScript is unable to narrow the type of the row type correctly here, hence the casts below.
|
|
@@ -660,7 +542,7 @@ export namespace System_TableSchema {
|
|
|
660
542
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
661
543
|
const keys: string[] = Object.keys((newRow as any).cells);
|
|
662
544
|
for (const key of keys) {
|
|
663
|
-
if (!this
|
|
545
|
+
if (!this.#containsColumnWithId(key)) {
|
|
664
546
|
throw new UsageError(
|
|
665
547
|
`Attempted to insert row a cell under column ID "${key}", but the table does not contain a column with that ID.`,
|
|
666
548
|
);
|
|
@@ -691,10 +573,10 @@ export namespace System_TableSchema {
|
|
|
691
573
|
}: TableSchema.SetCellParameters<TCellSchema, TColumnSchema, TRowSchema>): void {
|
|
692
574
|
const { column: columnOrId, row: rowOrId } = key;
|
|
693
575
|
|
|
694
|
-
const row = this
|
|
695
|
-
const column = this
|
|
576
|
+
const row = this.#getRow(rowOrId);
|
|
577
|
+
const column = this.#getColumn(columnOrId);
|
|
696
578
|
|
|
697
|
-
row.
|
|
579
|
+
(row as RowValueInternalType).cells[column.id] = cell as CellValueType;
|
|
698
580
|
}
|
|
699
581
|
|
|
700
582
|
public removeColumns(
|
|
@@ -704,34 +586,28 @@ export namespace System_TableSchema {
|
|
|
704
586
|
if (typeof indexOrColumns === "number" || indexOrColumns === undefined) {
|
|
705
587
|
let removedColumns: ColumnValueType[] | undefined;
|
|
706
588
|
const startIndex = indexOrColumns ?? 0;
|
|
707
|
-
const
|
|
589
|
+
const endIndex = count === undefined ? this.columns.length : startIndex + count;
|
|
708
590
|
|
|
709
591
|
// If there are no columns to remove, do nothing
|
|
710
|
-
if (
|
|
592
|
+
if (startIndex === endIndex) {
|
|
711
593
|
return [];
|
|
712
594
|
}
|
|
713
595
|
|
|
714
|
-
|
|
596
|
+
validateIndexRange(startIndex, endIndex, this.columns, "Table.removeColumns");
|
|
715
597
|
|
|
716
|
-
this
|
|
598
|
+
this.#applyEditsInBatch(() => {
|
|
717
599
|
const columnsToRemove = this.columns.slice(
|
|
718
600
|
startIndex,
|
|
719
|
-
|
|
601
|
+
endIndex,
|
|
720
602
|
) as ColumnValueType[];
|
|
721
603
|
|
|
722
604
|
// First, remove all cells that correspond to each column from each row:
|
|
723
605
|
for (const column of columnsToRemove) {
|
|
724
|
-
this
|
|
606
|
+
this.#removeCells(column);
|
|
725
607
|
}
|
|
726
608
|
|
|
727
609
|
// Second, remove the column nodes:
|
|
728
|
-
Table.
|
|
729
|
-
{
|
|
730
|
-
index: startIndex,
|
|
731
|
-
count: _count,
|
|
732
|
-
},
|
|
733
|
-
this.columns,
|
|
734
|
-
);
|
|
610
|
+
removeRangeFromArray(startIndex, endIndex, this.columns, "Table.removeColumns");
|
|
735
611
|
removedColumns = columnsToRemove;
|
|
736
612
|
});
|
|
737
613
|
return removedColumns ?? fail(0xc1f /* Transaction did not complete. */);
|
|
@@ -746,10 +622,10 @@ export namespace System_TableSchema {
|
|
|
746
622
|
// This improves user-facing error experience.
|
|
747
623
|
const columnsToRemove: ColumnValueType[] = [];
|
|
748
624
|
for (const columnOrIdToRemove of indexOrColumns) {
|
|
749
|
-
columnsToRemove.push(this
|
|
625
|
+
columnsToRemove.push(this.#getColumn(columnOrIdToRemove));
|
|
750
626
|
}
|
|
751
627
|
|
|
752
|
-
this
|
|
628
|
+
this.#applyEditsInBatch(() => {
|
|
753
629
|
// Note, throwing an error within a transaction will abort the entire transaction.
|
|
754
630
|
// So if we throw an error here for any column, no columns will be removed.
|
|
755
631
|
for (const columnToRemove of columnsToRemove) {
|
|
@@ -757,7 +633,10 @@ export namespace System_TableSchema {
|
|
|
757
633
|
for (const row of this.rows) {
|
|
758
634
|
// TypeScript is unable to narrow the row type correctly here, hence the cast.
|
|
759
635
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
760
|
-
|
|
636
|
+
this.removeCell({
|
|
637
|
+
column: columnToRemove,
|
|
638
|
+
row: row as RowValueType,
|
|
639
|
+
});
|
|
761
640
|
}
|
|
762
641
|
|
|
763
642
|
// We have already validated that all of the columns exist above, so this is safe.
|
|
@@ -774,20 +653,14 @@ export namespace System_TableSchema {
|
|
|
774
653
|
): RowValueType[] {
|
|
775
654
|
if (typeof indexOrRows === "number" || indexOrRows === undefined) {
|
|
776
655
|
const startIndex = indexOrRows ?? 0;
|
|
777
|
-
const
|
|
656
|
+
const endIndex = count === undefined ? this.columns.length : startIndex + count;
|
|
778
657
|
|
|
779
658
|
// If there are no rows to remove, do nothing
|
|
780
|
-
if (
|
|
659
|
+
if (startIndex === endIndex) {
|
|
781
660
|
return [];
|
|
782
661
|
}
|
|
783
662
|
|
|
784
|
-
return Table.
|
|
785
|
-
{
|
|
786
|
-
index: startIndex,
|
|
787
|
-
count: _count,
|
|
788
|
-
},
|
|
789
|
-
this.rows,
|
|
790
|
-
);
|
|
663
|
+
return removeRangeFromArray(startIndex, endIndex, this.rows, "Table.removeRows");
|
|
791
664
|
}
|
|
792
665
|
|
|
793
666
|
// If there are no rows to remove, do nothing
|
|
@@ -800,10 +673,10 @@ export namespace System_TableSchema {
|
|
|
800
673
|
// This improves user-facing error experience.
|
|
801
674
|
const rowsToRemove: RowValueType[] = [];
|
|
802
675
|
for (const rowToRemove of indexOrRows) {
|
|
803
|
-
rowsToRemove.push(this
|
|
676
|
+
rowsToRemove.push(this.#getRow(rowToRemove));
|
|
804
677
|
}
|
|
805
678
|
|
|
806
|
-
this
|
|
679
|
+
this.#applyEditsInBatch(() => {
|
|
807
680
|
// Note, throwing an error within a transaction will abort the entire transaction.
|
|
808
681
|
// So if we throw an error here for any row, no rows will be removed.
|
|
809
682
|
for (const rowToRemove of rowsToRemove) {
|
|
@@ -819,48 +692,30 @@ export namespace System_TableSchema {
|
|
|
819
692
|
key: TableSchema.CellKey<TColumnSchema, TRowSchema>,
|
|
820
693
|
): CellValueType | undefined {
|
|
821
694
|
const { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;
|
|
822
|
-
const row = this
|
|
823
|
-
const column = this
|
|
695
|
+
const row = this.#getRow(rowOrIdOrIndex) as RowValueInternalType;
|
|
696
|
+
const column = this.#getColumn(columnOrIdOrIndex);
|
|
824
697
|
|
|
825
|
-
const cell: CellValueType | undefined = row.
|
|
698
|
+
const cell: CellValueType | undefined = row.cells[column.id];
|
|
826
699
|
if (cell === undefined) {
|
|
827
700
|
return undefined;
|
|
828
701
|
}
|
|
829
702
|
|
|
830
|
-
|
|
703
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
704
|
+
delete row.cells[column.id];
|
|
831
705
|
return cell;
|
|
832
706
|
}
|
|
833
707
|
|
|
834
708
|
/**
|
|
835
709
|
* Removes the cell corresponding with the specified column from each row in the table.
|
|
836
710
|
*/
|
|
837
|
-
|
|
711
|
+
#removeCells(column: ColumnValueType): void {
|
|
838
712
|
for (const row of this.rows) {
|
|
839
713
|
// TypeScript is unable to narrow the row type correctly here, hence the cast.
|
|
840
714
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
private static _assertValidRange<T>(
|
|
846
|
-
range: { index: number; count: number },
|
|
847
|
-
array: readonly T[],
|
|
848
|
-
): void {
|
|
849
|
-
const { index, count } = range;
|
|
850
|
-
if (index < 0 || index >= array.length) {
|
|
851
|
-
throw new UsageError(
|
|
852
|
-
`Start index out of bounds. Expected index to be on [0, ${array.length - 1}], but got ${index}.`,
|
|
853
|
-
);
|
|
854
|
-
}
|
|
855
|
-
if (count < 0) {
|
|
856
|
-
throw new UsageError(`Expected non-negative count. Got ${count}.`);
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
const end = index + count; // exclusive
|
|
860
|
-
if (end > array.length) {
|
|
861
|
-
throw new UsageError(
|
|
862
|
-
`End index out of bounds. Expected end to be on [${index}, ${array.length}], but got ${end}.`,
|
|
863
|
-
);
|
|
715
|
+
this.removeCell({
|
|
716
|
+
column,
|
|
717
|
+
row: row as RowValueType,
|
|
718
|
+
});
|
|
864
719
|
}
|
|
865
720
|
}
|
|
866
721
|
|
|
@@ -873,7 +728,7 @@ export namespace System_TableSchema {
|
|
|
873
728
|
* Transactions are not supported for unhydrated trees, so we cannot run a transaction in that case.
|
|
874
729
|
* But since there are no collaborators, this is not an issue.
|
|
875
730
|
*/
|
|
876
|
-
|
|
731
|
+
#applyEditsInBatch(applyEdits: () => void): void {
|
|
877
732
|
const branch = TreeAlpha.branch(this);
|
|
878
733
|
|
|
879
734
|
// Ensure events are paused until all of the edits are applied.
|
|
@@ -898,7 +753,7 @@ export namespace System_TableSchema {
|
|
|
898
753
|
* Returns `undefined` if there is no match.
|
|
899
754
|
* @remarks Searches for a match based strictly on the ID and returns that result.
|
|
900
755
|
*/
|
|
901
|
-
|
|
756
|
+
#tryGetColumn(
|
|
902
757
|
columnOrIdOrIndex: ColumnValueType | string | number,
|
|
903
758
|
): ColumnValueType | undefined {
|
|
904
759
|
if (typeof columnOrIdOrIndex === "number") {
|
|
@@ -932,10 +787,8 @@ export namespace System_TableSchema {
|
|
|
932
787
|
* @throws Throws a `UsageError` if there is no match.
|
|
933
788
|
* @remarks Searches for a match based strictly on the ID and returns that result.
|
|
934
789
|
*/
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
): ColumnValueType {
|
|
938
|
-
const column = this._tryGetColumn(columnOrIdOrIndex);
|
|
790
|
+
#getColumn(columnOrIdOrIndex: ColumnValueType | string | number): ColumnValueType {
|
|
791
|
+
const column = this.#tryGetColumn(columnOrIdOrIndex);
|
|
939
792
|
if (column === undefined) {
|
|
940
793
|
Table._throwMissingColumnError(columnOrIdOrIndex);
|
|
941
794
|
}
|
|
@@ -945,8 +798,8 @@ export namespace System_TableSchema {
|
|
|
945
798
|
/**
|
|
946
799
|
* Checks if a Column with the specified ID exists in the table.
|
|
947
800
|
*/
|
|
948
|
-
|
|
949
|
-
return this
|
|
801
|
+
#containsColumnWithId(columnId: string): boolean {
|
|
802
|
+
return this.#tryGetColumn(columnId) !== undefined;
|
|
950
803
|
}
|
|
951
804
|
|
|
952
805
|
/**
|
|
@@ -975,9 +828,7 @@ export namespace System_TableSchema {
|
|
|
975
828
|
* Returns `undefined` if there is no match.
|
|
976
829
|
* @remarks Searches for a match based strictly on the ID and returns that result.
|
|
977
830
|
*/
|
|
978
|
-
|
|
979
|
-
rowOrIdOrIndex: RowValueType | string | number,
|
|
980
|
-
): RowValueType | undefined {
|
|
831
|
+
#tryGetRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType | undefined {
|
|
981
832
|
if (typeof rowOrIdOrIndex === "number") {
|
|
982
833
|
if (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.rows.length) {
|
|
983
834
|
return undefined;
|
|
@@ -1009,8 +860,8 @@ export namespace System_TableSchema {
|
|
|
1009
860
|
* @throws Throws a `UsageError` if there is no match.
|
|
1010
861
|
* @remarks Searches for a match based strictly on the ID and returns that result.
|
|
1011
862
|
*/
|
|
1012
|
-
|
|
1013
|
-
const row = this
|
|
863
|
+
#getRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType {
|
|
864
|
+
const row = this.#tryGetRow(rowOrIdOrIndex);
|
|
1014
865
|
if (row === undefined) {
|
|
1015
866
|
Table._throwMissingRowError(rowOrIdOrIndex);
|
|
1016
867
|
}
|
|
@@ -1035,47 +886,6 @@ export namespace System_TableSchema {
|
|
|
1035
886
|
`The specified row node with ID "${rowOrIdOrIndex.id}" does not exist in the table.`,
|
|
1036
887
|
);
|
|
1037
888
|
}
|
|
1038
|
-
|
|
1039
|
-
private static _removeRange<TNodeSchema extends ImplicitAllowedTypes>(
|
|
1040
|
-
range: { index: number; count: number },
|
|
1041
|
-
array: TreeArrayNode<TNodeSchema>,
|
|
1042
|
-
): TreeNodeFromImplicitAllowedTypes<TNodeSchema>[] {
|
|
1043
|
-
Table._assertValidRange(range, array);
|
|
1044
|
-
|
|
1045
|
-
const { index, count } = range;
|
|
1046
|
-
const end = index + count; // exclusive
|
|
1047
|
-
|
|
1048
|
-
// TypeScript is unable to narrow the array element type correctly here, hence the cast.
|
|
1049
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
1050
|
-
const removedRows = array.slice(
|
|
1051
|
-
index,
|
|
1052
|
-
end,
|
|
1053
|
-
) as TreeNodeFromImplicitAllowedTypes<TNodeSchema>[];
|
|
1054
|
-
array.removeRange(index, end);
|
|
1055
|
-
|
|
1056
|
-
return removedRows;
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
/**
|
|
1060
|
-
* Ensure that the specified index is a valid location for item insertion in the destination list.
|
|
1061
|
-
* @throws Throws a usage error if the destination is invalid.
|
|
1062
|
-
*/
|
|
1063
|
-
private static validateInsertionIndex(
|
|
1064
|
-
index: number,
|
|
1065
|
-
destinationList: readonly unknown[],
|
|
1066
|
-
): void {
|
|
1067
|
-
if (index < 0) {
|
|
1068
|
-
throw new UsageError("The index must be greater than or equal to 0.");
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
if (index > destinationList.length) {
|
|
1072
|
-
throw new UsageError("The index specified for insertion is out of bounds.");
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
if (!Number.isInteger(index)) {
|
|
1076
|
-
throw new UsageError("The index must be an integer.");
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
889
|
}
|
|
1080
890
|
|
|
1081
891
|
// Set a private symbol on the schema class that marks it as having been generated by this factory.
|
|
@@ -1128,6 +938,29 @@ export namespace System_TableSchema {
|
|
|
1128
938
|
// #endregion
|
|
1129
939
|
}
|
|
1130
940
|
|
|
941
|
+
/**
|
|
942
|
+
* Removes the specified range of elements from the array.
|
|
943
|
+
* @returns The removed elements.
|
|
944
|
+
*/
|
|
945
|
+
function removeRangeFromArray<TNodeSchema extends ImplicitAllowedTypes>(
|
|
946
|
+
startIndex: number,
|
|
947
|
+
endIndex: number,
|
|
948
|
+
array: TreeArrayNode<TNodeSchema>,
|
|
949
|
+
methodName: string,
|
|
950
|
+
): TreeNodeFromImplicitAllowedTypes<TNodeSchema>[] {
|
|
951
|
+
validateIndexRange(startIndex, endIndex, array, methodName);
|
|
952
|
+
|
|
953
|
+
// TypeScript is unable to narrow the array element type correctly here, hence the cast.
|
|
954
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
955
|
+
const removedRows = array.slice(
|
|
956
|
+
startIndex,
|
|
957
|
+
endIndex,
|
|
958
|
+
) as TreeNodeFromImplicitAllowedTypes<TNodeSchema>[];
|
|
959
|
+
array.removeRange(startIndex, endIndex);
|
|
960
|
+
|
|
961
|
+
return removedRows;
|
|
962
|
+
}
|
|
963
|
+
|
|
1131
964
|
/**
|
|
1132
965
|
* Contains types and factories for creating schema to represent dynamic tabular data.
|
|
1133
966
|
*
|
|
@@ -1253,6 +1086,7 @@ export namespace TableSchema {
|
|
|
1253
1086
|
* @sealed @alpha
|
|
1254
1087
|
*/
|
|
1255
1088
|
export interface Column<
|
|
1089
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Reserving this for future use.
|
|
1256
1090
|
TCell extends ImplicitAllowedTypes,
|
|
1257
1091
|
TProps extends ImplicitFieldSchema = ImplicitFieldSchema,
|
|
1258
1092
|
> {
|
|
@@ -1271,15 +1105,6 @@ export namespace TableSchema {
|
|
|
1271
1105
|
*/
|
|
1272
1106
|
get props(): TreeFieldFromImplicitField<TProps>;
|
|
1273
1107
|
set props(value: InsertableTreeFieldFromImplicitField<TProps>);
|
|
1274
|
-
|
|
1275
|
-
/**
|
|
1276
|
-
* Gets all of the populated cells in the column, keyed by their associated row IDs.
|
|
1277
|
-
* @throws Throws an error if the column is not in a table.
|
|
1278
|
-
*/
|
|
1279
|
-
getCells(): readonly {
|
|
1280
|
-
rowId: string;
|
|
1281
|
-
cell: TreeNodeFromImplicitAllowedTypes<TCell>;
|
|
1282
|
-
}[];
|
|
1283
1108
|
}
|
|
1284
1109
|
|
|
1285
1110
|
/**
|
|
@@ -1323,7 +1148,7 @@ export namespace TableSchema {
|
|
|
1323
1148
|
}: System_TableSchema.CreateColumnOptionsBase & {
|
|
1324
1149
|
readonly props?: ImplicitFieldSchema;
|
|
1325
1150
|
}): TreeNodeSchema {
|
|
1326
|
-
return System_TableSchema.createColumnSchema(schemaFactory,
|
|
1151
|
+
return System_TableSchema.createColumnSchema(schemaFactory, props);
|
|
1327
1152
|
}
|
|
1328
1153
|
|
|
1329
1154
|
// #endregion
|
|
@@ -1338,6 +1163,7 @@ export namespace TableSchema {
|
|
|
1338
1163
|
* @sealed @alpha
|
|
1339
1164
|
*/
|
|
1340
1165
|
export interface Row<
|
|
1166
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Reserving this for future use.
|
|
1341
1167
|
TCell extends ImplicitAllowedTypes,
|
|
1342
1168
|
TProps extends ImplicitFieldSchema = ImplicitFieldSchema,
|
|
1343
1169
|
> {
|
|
@@ -1347,53 +1173,6 @@ export namespace TableSchema {
|
|
|
1347
1173
|
*/
|
|
1348
1174
|
readonly id: string;
|
|
1349
1175
|
|
|
1350
|
-
/**
|
|
1351
|
-
* Gets the cell in the specified column.
|
|
1352
|
-
* @returns The cell if it exists, otherwise undefined.
|
|
1353
|
-
* @privateRemarks TODO: throw if the column does not belong to the same table as the row.
|
|
1354
|
-
*/
|
|
1355
|
-
getCell(column: Column<TCell>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
1356
|
-
/**
|
|
1357
|
-
* Gets the cell in the specified column, denoted by column ID.
|
|
1358
|
-
* @returns The cell if it exists, otherwise undefined.
|
|
1359
|
-
*/
|
|
1360
|
-
getCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
1361
|
-
|
|
1362
|
-
/**
|
|
1363
|
-
* Gets all of the populated cells in the row, keyed by their associated column IDs.
|
|
1364
|
-
*/
|
|
1365
|
-
getCells(): readonly {
|
|
1366
|
-
columnId: string;
|
|
1367
|
-
cell: TreeNodeFromImplicitAllowedTypes<TCell>;
|
|
1368
|
-
}[];
|
|
1369
|
-
|
|
1370
|
-
/**
|
|
1371
|
-
* Sets the cell in the specified column.
|
|
1372
|
-
* @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:1)} instead.
|
|
1373
|
-
* @privateRemarks TODO: Throw an error if the column does not exist in the table.
|
|
1374
|
-
*/
|
|
1375
|
-
setCell(
|
|
1376
|
-
column: Column<TCell>,
|
|
1377
|
-
value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>,
|
|
1378
|
-
): void;
|
|
1379
|
-
/**
|
|
1380
|
-
* Sets the cell in the specified column, denoted by column ID.
|
|
1381
|
-
* @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:2)} instead.
|
|
1382
|
-
*/
|
|
1383
|
-
setCell(columnId: string, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
|
|
1384
|
-
|
|
1385
|
-
/**
|
|
1386
|
-
* Removes the cell in the specified column.
|
|
1387
|
-
* @returns The cell if it exists, otherwise undefined.
|
|
1388
|
-
* @privateRemarks TODO: Throw if the column does not belong to the same table as the row.
|
|
1389
|
-
*/
|
|
1390
|
-
removeCell(column: Column<TCell>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
1391
|
-
/**
|
|
1392
|
-
* Removes the cell in the specified column, denoted by column ID.
|
|
1393
|
-
* @returns The cell if it exists, otherwise undefined.
|
|
1394
|
-
*/
|
|
1395
|
-
removeCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
1396
|
-
|
|
1397
1176
|
/**
|
|
1398
1177
|
* The row's properties.
|
|
1399
1178
|
* @remarks This is a user-defined schema that can be used to store additional information about the row.
|