@fluidframework/tree 2.74.0-365691 → 2.74.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/.vscode/settings.json +4 -2
- package/CHANGELOG.md +11 -0
- package/api-report/tree.alpha.api.md +125 -87
- package/api-report/tree.beta.api.md +0 -1
- package/api-report/tree.legacy.beta.api.md +0 -1
- package/api-report/tree.legacy.public.api.md +0 -1
- package/api-report/tree.public.api.md +0 -1
- package/assertTagging.config.mjs +1 -1
- package/dist/alpha.d.ts +6 -2
- package/dist/codec/codec.d.ts +41 -13
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +46 -19
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +1 -1
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/format.d.ts +4 -1
- package/dist/codec/versioned/format.d.ts.map +1 -1
- package/dist/codec/versioned/format.js +4 -1
- package/dist/codec/versioned/format.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +4 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +20 -1
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +4 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +2 -2
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +34 -13
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +12 -12
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -2
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/index.d.ts +3 -2
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +3 -0
- package/dist/core/tree/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +4 -4
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
- 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/chunked-forest/codec/schemaBasedEncode.js +7 -2
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +22 -26
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +7 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +13 -11
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -13
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +35 -31
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatCommon.js +27 -0
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV1.d.ts +51 -0
- package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV1.js +11 -0
- package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV2.d.ts +51 -0
- package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV2.js +11 -0
- package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -0
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +18 -24
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +21 -43
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -4
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.js +43 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js +14 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.js +21 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +17 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.js +35 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
- 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 +3 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +54 -3
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +4 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +2 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +4 -4
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- 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/independentView.d.ts +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +1 -1
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +2 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +3 -0
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +2 -2
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +4 -4
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +2 -2
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +25 -11
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +1 -1
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +10 -5
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +72 -17
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +10 -8
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +8 -30
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +18 -9
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +1 -1
- package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +5 -2
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +7 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +12 -10
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +9 -36
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +19 -9
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/{lib/shared-tree-core/messageFormatV5.d.ts → dist/shared-tree-core/messageFormatVSharedBranches.d.ts} +5 -7
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts +13 -47
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +29 -17
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
- package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
- package/dist/shared-tree-core/summaryTypes.js +47 -0
- package/dist/shared-tree-core/summaryTypes.js.map +1 -0
- package/dist/shared-tree-core/versionedSummarizer.d.ts +72 -0
- package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
- package/dist/shared-tree-core/versionedSummarizer.js +64 -0
- package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
- package/dist/simple-tree/api/configuration.d.ts +3 -26
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +10 -21
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
- package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.js +7 -0
- package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
- package/dist/simple-tree/api/eraseSchemaDetails.js +97 -0
- package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -0
- package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js +9 -3
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +4 -4
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +8 -5
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +5 -0
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +1 -2
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +15 -2
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +3 -3
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
- package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -3
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +17 -15
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js +5 -40
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNode.js +1 -0
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +4 -0
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js +20 -5
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +3 -3
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +6 -5
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +16 -11
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
- package/dist/simple-tree/leafNodeSchema.d.ts.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.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.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.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.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.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +55 -23
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js +17 -0
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +58 -11
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +205 -30
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeSchema.d.ts +23 -0
- package/dist/simple-tree/treeSchema.d.ts.map +1 -0
- package/dist/simple-tree/treeSchema.js +25 -0
- package/dist/simple-tree/treeSchema.js.map +1 -0
- package/dist/tableSchema.d.ts +107 -64
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +161 -60
- package/dist/tableSchema.js.map +1 -1
- package/dist/util/brand.d.ts +49 -0
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +47 -1
- package/dist/util/brand.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 +6 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/readSnapshotBlob.d.ts +13 -0
- package/dist/util/readSnapshotBlob.d.ts.map +1 -0
- package/dist/util/readSnapshotBlob.js +18 -0
- package/dist/util/readSnapshotBlob.js.map +1 -0
- package/eslint.config.mts +98 -0
- package/lib/alpha.d.ts +6 -2
- package/lib/codec/codec.d.ts +41 -13
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +40 -13
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +1 -1
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/format.d.ts +4 -1
- package/lib/codec/versioned/format.d.ts.map +1 -1
- package/lib/codec/versioned/format.js +4 -1
- package/lib/codec/versioned/format.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- 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/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +20 -1
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +4 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -3
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +34 -13
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +12 -12
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/lib/core/tree/index.d.ts +3 -2
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +2 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +5 -5
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
- 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/chunked-forest/codec/schemaBasedEncode.js +7 -2
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +23 -27
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +7 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +12 -11
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -13
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +33 -29
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatCommon.js +23 -0
- package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV1.d.ts +51 -0
- package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV1.js +8 -0
- package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV2.d.ts +51 -0
- package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV2.js +8 -0
- package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -0
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +18 -24
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +20 -42
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +2 -2
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.js +40 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js +11 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.js +18 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +17 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.js +30 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
- 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/comparison.d.ts +18 -2
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +55 -5
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +4 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +5 -5
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- 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/independentView.d.ts +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +2 -2
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +2 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +3 -0
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +2 -2
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +4 -4
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +2 -2
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +25 -11
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +2 -2
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +10 -5
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +73 -18
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +11 -9
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +8 -30
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +19 -10
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +1 -1
- package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +5 -2
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +3 -1
- package/lib/shared-tree-core/index.js.map +1 -1
- package/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +13 -11
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +9 -36
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +19 -9
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/{dist/shared-tree-core/messageFormatV5.d.ts → lib/shared-tree-core/messageFormatVSharedBranches.d.ts} +5 -7
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts +13 -47
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +27 -15
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
- package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
- package/lib/shared-tree-core/summaryTypes.js +43 -0
- package/lib/shared-tree-core/summaryTypes.js.map +1 -0
- package/lib/shared-tree-core/versionedSummarizer.d.ts +72 -0
- package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
- package/lib/shared-tree-core/versionedSummarizer.js +60 -0
- package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
- package/lib/simple-tree/api/configuration.d.ts +3 -26
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +14 -25
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
- package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
- package/lib/simple-tree/api/dirtyIndex.js +7 -0
- package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
- package/lib/simple-tree/api/eraseSchemaDetails.js +92 -0
- package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -0
- package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js +9 -3
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +4 -4
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +3 -3
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +5 -0
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +1 -2
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +15 -2
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +3 -3
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
- package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/toStored.d.ts +17 -15
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js +4 -37
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNode.js +1 -0
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/walkSchema.js +5 -1
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js +20 -5
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +3 -3
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +6 -5
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +5 -4
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
- package/lib/simple-tree/leafNodeSchema.d.ts.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.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.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.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.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.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +55 -23
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js +16 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +58 -11
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +204 -31
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeSchema.d.ts +23 -0
- package/lib/simple-tree/treeSchema.d.ts.map +1 -0
- package/lib/simple-tree/treeSchema.js +21 -0
- package/lib/simple-tree/treeSchema.js.map +1 -0
- package/lib/tableSchema.d.ts +107 -64
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +162 -61
- package/lib/tableSchema.js.map +1 -1
- package/lib/util/brand.d.ts +49 -0
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +44 -0
- package/lib/util/brand.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/lib/util/readSnapshotBlob.d.ts +13 -0
- package/lib/util/readSnapshotBlob.d.ts.map +1 -0
- package/lib/util/readSnapshotBlob.js +14 -0
- package/lib/util/readSnapshotBlob.js.map +1 -0
- package/package.json +24 -23
- package/src/codec/codec.ts +44 -14
- package/src/codec/versioned/codec.ts +1 -1
- package/src/codec/versioned/format.ts +4 -1
- package/src/core/index.ts +4 -1
- package/src/core/rebase/index.ts +1 -0
- package/src/core/rebase/types.ts +25 -0
- package/src/core/schema-stored/schema.ts +5 -7
- package/src/core/tree/detachedFieldIndex.ts +54 -13
- package/src/core/tree/detachedFieldIndexFormatCommon.ts +4 -7
- package/src/core/tree/index.ts +7 -2
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +3 -2
- package/src/feature-libraries/chunked-forest/codec/format.ts +6 -9
- package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +22 -33
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
- package/src/feature-libraries/forest-summary/codec.ts +22 -10
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +77 -44
- package/src/feature-libraries/forest-summary/{format.ts → formatCommon.ts} +12 -13
- package/src/feature-libraries/forest-summary/formatV1.ts +12 -0
- package/src/feature-libraries/forest-summary/formatV2.ts +12 -0
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +37 -56
- package/src/feature-libraries/forest-summary/index.ts +2 -2
- package/src/feature-libraries/forest-summary/summaryFormatCommon.ts +41 -0
- package/src/feature-libraries/forest-summary/summaryFormatV1ToV2.ts +11 -0
- package/src/feature-libraries/forest-summary/summaryFormatV3.ts +18 -0
- package/src/feature-libraries/forest-summary/summaryTypes.ts +41 -0
- package/src/feature-libraries/index.ts +1 -1
- package/src/feature-libraries/modular-schema/comparison.ts +64 -5
- package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -1
- package/src/feature-libraries/modular-schema/index.ts +1 -0
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +2 -3
- package/src/feature-libraries/schema-index/codec.ts +7 -9
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
- package/src/index.ts +6 -2
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +2 -3
- package/src/shared-tree/schematizingTreeView.ts +5 -0
- package/src/shared-tree/sharedTree.ts +20 -9
- package/src/shared-tree/sharedTreeChangeCodecs.ts +2 -2
- package/src/shared-tree/sharedTreeChangeEnricher.ts +31 -11
- package/src/shared-tree/treeAlpha.ts +2 -3
- package/src/shared-tree/treeCheckout.ts +103 -20
- package/src/shared-tree-core/editManagerCodecs.ts +11 -9
- package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
- package/src/shared-tree-core/editManagerFormatCommons.ts +22 -16
- package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
- package/src/shared-tree-core/index.ts +12 -3
- package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
- package/src/shared-tree-core/messageCodecs.ts +13 -11
- package/src/shared-tree-core/messageFormat.ts +23 -16
- package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
- package/src/shared-tree-core/sharedTreeCore.ts +63 -75
- package/src/shared-tree-core/summaryTypes.ts +122 -0
- package/src/shared-tree-core/versionedSummarizer.ts +114 -0
- package/src/simple-tree/api/configuration.ts +21 -68
- package/src/simple-tree/api/dirtyIndex.ts +11 -0
- package/src/simple-tree/api/discrepancies.ts +1 -1
- package/src/simple-tree/api/eraseSchemaDetails.ts +123 -0
- package/src/simple-tree/api/getSimpleSchema.ts +13 -6
- package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
- package/src/simple-tree/api/index.ts +7 -4
- package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
- package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
- package/src/simple-tree/api/schemaFromSimple.ts +11 -5
- package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
- package/src/simple-tree/api/storedSchema.ts +2 -2
- package/src/simple-tree/api/tree.ts +16 -1
- package/src/simple-tree/api/typesUnsafe.ts +7 -3
- package/src/simple-tree/core/allowedTypes.ts +3 -3
- package/src/simple-tree/core/index.ts +2 -2
- package/src/simple-tree/core/toStored.ts +22 -55
- package/src/simple-tree/core/treeNode.ts +1 -0
- package/src/simple-tree/core/walkSchema.ts +6 -0
- package/src/simple-tree/createContext.ts +29 -11
- package/src/simple-tree/fieldSchema.ts +10 -3
- package/src/simple-tree/index.ts +12 -10
- package/src/simple-tree/node-kinds/array/arrayNode.ts +5 -2
- package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
- package/src/simple-tree/node-kinds/map/mapNode.ts +5 -2
- package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
- package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
- package/src/simple-tree/node-kinds/record/recordNode.ts +5 -2
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
- package/src/simple-tree/simpleSchema.ts +79 -32
- package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
- package/src/simple-tree/toStoredSchema.ts +319 -61
- package/src/simple-tree/treeSchema.ts +54 -0
- package/src/tableSchema.ts +487 -173
- package/src/util/brand.ts +61 -0
- package/src/util/index.ts +5 -0
- package/src/util/readSnapshotBlob.ts +23 -0
- package/dist/feature-libraries/forest-summary/format.d.ts +0 -23
- package/dist/feature-libraries/forest-summary/format.d.ts.map +0 -1
- package/dist/feature-libraries/forest-summary/format.js +0 -24
- package/dist/feature-libraries/forest-summary/format.js.map +0 -1
- package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
- package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
- package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
- package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
- package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
- package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
- package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +0 -23
- package/lib/feature-libraries/forest-summary/format.d.ts.map +0 -1
- package/lib/feature-libraries/forest-summary/format.js +0 -21
- package/lib/feature-libraries/forest-summary/format.js.map +0 -1
- package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
- package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
- package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
- package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
- package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
- package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
- package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
package/src/tableSchema.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
type InsertableObjectFromSchemaRecord,
|
|
14
14
|
type InsertableTreeNodeFromImplicitAllowedTypes,
|
|
15
15
|
type NodeKind,
|
|
16
|
-
|
|
16
|
+
SchemaFactoryBeta,
|
|
17
17
|
type ScopedSchemaName,
|
|
18
18
|
TreeArrayNode,
|
|
19
19
|
type TreeNode,
|
|
@@ -25,11 +25,17 @@ import {
|
|
|
25
25
|
type InsertableTreeFieldFromImplicitField,
|
|
26
26
|
type InternalTreeNode,
|
|
27
27
|
SchemaFactory,
|
|
28
|
+
scoped,
|
|
28
29
|
type ImplicitFieldSchema,
|
|
29
30
|
withBufferedTreeEvents,
|
|
30
31
|
type TreeRecordNode,
|
|
32
|
+
objectSchema,
|
|
33
|
+
eraseSchemaDetailsSubclassable,
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports -- This makes the API report slightly cleaner.
|
|
35
|
+
TreeNodeSchemaCore,
|
|
31
36
|
} from "./simple-tree/index.js";
|
|
32
37
|
import { validateIndex, validateIndexRange } from "./util/index.js";
|
|
38
|
+
import { EmptyKey } from "./core/index.js";
|
|
33
39
|
|
|
34
40
|
// Future improvement TODOs:
|
|
35
41
|
// - Omit `cells` property from Row insertion type.
|
|
@@ -40,9 +46,10 @@ import { validateIndex, validateIndexRange } from "./util/index.js";
|
|
|
40
46
|
// - Add constraint APIs to make it possible to avoid situations that could yield "orphaned" cells.
|
|
41
47
|
|
|
42
48
|
/**
|
|
43
|
-
*
|
|
49
|
+
* Scope for table schema built-in types.
|
|
50
|
+
* @remarks User-provided factory scoping will be applied as `com.fluidframework.table<user-scope>`.
|
|
44
51
|
*/
|
|
45
|
-
const
|
|
52
|
+
const baseSchemaScope = "com.fluidframework.table";
|
|
46
53
|
|
|
47
54
|
/**
|
|
48
55
|
* A private symbol put on table schema to help identify them.
|
|
@@ -51,16 +58,16 @@ const tableSchemaSymbol: unique symbol = Symbol("tableNode");
|
|
|
51
58
|
|
|
52
59
|
/**
|
|
53
60
|
* A row in a table.
|
|
54
|
-
* @typeParam
|
|
55
|
-
* @typeParam
|
|
61
|
+
* @typeParam TCellSchema - The type of the cells in the {@link TableSchema.Table}.
|
|
62
|
+
* @typeParam TPropsSchema - Additional properties to associate with the row.
|
|
56
63
|
* @privateRemarks Private counterpart to the {@link TableSchema.Row}.
|
|
57
64
|
* Exposes internal properties needed for table operations (publicly exposed via {@link TableSchema.Table}).
|
|
58
65
|
* @sealed
|
|
59
66
|
*/
|
|
60
67
|
export interface RowPrivate<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
> extends TableSchema.Row<
|
|
68
|
+
TCellSchema extends ImplicitAllowedTypes,
|
|
69
|
+
TPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,
|
|
70
|
+
> extends TableSchema.Row<TCellSchema, TPropsSchema> {
|
|
64
71
|
/**
|
|
65
72
|
* The row's cells.
|
|
66
73
|
* @remarks This is a user-defined schema that can be used to store additional information about the row.
|
|
@@ -68,7 +75,7 @@ export interface RowPrivate<
|
|
|
68
75
|
* Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createRowSchema}.
|
|
69
76
|
* If you update the docs here, please also update the inline type definitions.
|
|
70
77
|
*/
|
|
71
|
-
readonly cells: TreeRecordNode<
|
|
78
|
+
readonly cells: TreeRecordNode<TCellSchema>;
|
|
72
79
|
}
|
|
73
80
|
|
|
74
81
|
/**
|
|
@@ -82,6 +89,36 @@ export interface RowPrivate<
|
|
|
82
89
|
* @system @alpha
|
|
83
90
|
*/
|
|
84
91
|
export namespace System_TableSchema {
|
|
92
|
+
/**
|
|
93
|
+
* A list of items in a table whose elements may be rearranged, but not inserted or removed.
|
|
94
|
+
*
|
|
95
|
+
* @privateRemarks Used by {@link TableSchema.Table} for its `rows` and `columns` properties to allow basic rearrangement operations on the underlying sequences without permitting mutation operations that might violate table invariants.
|
|
96
|
+
*
|
|
97
|
+
* Note: this can't reasonably be implemented via `Pick<ArrayNode<...>>` because we only want to include the
|
|
98
|
+
* subset of its method overloads which do not support moving items between lists.
|
|
99
|
+
*
|
|
100
|
+
* @alpha @system
|
|
101
|
+
*/
|
|
102
|
+
export type RearrangeableList<TItemSchema extends ImplicitAllowedTypes> = TreeNode &
|
|
103
|
+
readonly TreeNodeFromImplicitAllowedTypes<TItemSchema>[] & {
|
|
104
|
+
// #region Capture the subset of item rearrangement methods from `TreeArrayNode` that do not allow moving between lists.
|
|
105
|
+
|
|
106
|
+
/** {@inheritDoc (TreeArrayNode:interface).(moveToEnd:1)} */
|
|
107
|
+
moveToEnd(sourceIndex: number): void;
|
|
108
|
+
/** {@inheritDoc (TreeArrayNode:interface).(moveToStart:1)} */
|
|
109
|
+
moveToStart(sourceIndex: number): void;
|
|
110
|
+
/** {@inheritDoc (TreeArrayNode:interface).(moveToIndex:1)} */
|
|
111
|
+
moveToIndex(sourceIndex: number, destinationIndex: number): void;
|
|
112
|
+
/** {@inheritDoc (TreeArrayNode:interface).(moveRangeToEnd:1)} */
|
|
113
|
+
moveRangeToEnd(startIndex: number, endIndex: number): void;
|
|
114
|
+
/** {@inheritDoc (TreeArrayNode:interface).(moveRangeToStart:1)} */
|
|
115
|
+
moveRangeToStart(startIndex: number, endIndex: number): void;
|
|
116
|
+
/** {@inheritDoc (TreeArrayNode:interface).(moveRangeToIndex:1)} */
|
|
117
|
+
moveRangeToIndex(startIndex: number, endIndex: number, destinationIndex: number): void;
|
|
118
|
+
|
|
119
|
+
// #endregion
|
|
120
|
+
};
|
|
121
|
+
|
|
85
122
|
/**
|
|
86
123
|
* Default type used for column and row "props" fields.
|
|
87
124
|
* @privateRemarks
|
|
@@ -102,6 +139,7 @@ export namespace System_TableSchema {
|
|
|
102
139
|
/**
|
|
103
140
|
* Schema factory with which the Column schema will be associated.
|
|
104
141
|
* @remarks Can be used to associate the resulting schema with an existing {@link SchemaFactory.scope|scope}.
|
|
142
|
+
* The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.<Column|Row|Table>`.
|
|
105
143
|
*/
|
|
106
144
|
readonly schemaFactory: TSchemaFactory;
|
|
107
145
|
}
|
|
@@ -122,14 +160,15 @@ export namespace System_TableSchema {
|
|
|
122
160
|
// #region Column
|
|
123
161
|
|
|
124
162
|
/**
|
|
125
|
-
* Base options for creating table
|
|
163
|
+
* Base options for creating table column schema.
|
|
126
164
|
* @remarks Includes parameters common to all column factory overloads.
|
|
127
165
|
* @system @alpha
|
|
128
166
|
*/
|
|
129
167
|
export type CreateColumnOptionsBase<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
168
|
+
TUserScope extends string = string,
|
|
169
|
+
TSchemaFactory extends SchemaFactoryBeta<TUserScope> = SchemaFactoryBeta<TUserScope>,
|
|
170
|
+
TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,
|
|
171
|
+
> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCellSchema>;
|
|
133
172
|
|
|
134
173
|
/**
|
|
135
174
|
* Factory for creating column schema.
|
|
@@ -137,12 +176,12 @@ export namespace System_TableSchema {
|
|
|
137
176
|
*/
|
|
138
177
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
|
|
139
178
|
export function createColumnSchema<
|
|
140
|
-
const
|
|
179
|
+
const TUserScope extends string,
|
|
141
180
|
const TCellSchema extends ImplicitAllowedTypes,
|
|
142
181
|
const TPropsSchema extends ImplicitFieldSchema,
|
|
143
|
-
>(inputSchemaFactory: SchemaFactoryBeta<
|
|
144
|
-
const schemaFactory = inputSchemaFactory
|
|
145
|
-
type Scope =
|
|
182
|
+
>(inputSchemaFactory: SchemaFactoryBeta<TUserScope>, propsSchema: TPropsSchema) {
|
|
183
|
+
const schemaFactory = createTableScopedFactory(inputSchemaFactory);
|
|
184
|
+
type Scope = typeof schemaFactory.scope;
|
|
146
185
|
|
|
147
186
|
// Note: `columnFields` is broken into two parts to work around a TypeScript bug
|
|
148
187
|
// that results in broken `.d.ts` output.
|
|
@@ -252,10 +291,10 @@ export namespace System_TableSchema {
|
|
|
252
291
|
* @sealed @system @alpha
|
|
253
292
|
*/
|
|
254
293
|
export type ColumnSchemaBase<
|
|
255
|
-
|
|
294
|
+
TUserScope extends string = string,
|
|
256
295
|
TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,
|
|
257
296
|
TPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,
|
|
258
|
-
> = ReturnType<typeof createColumnSchema<
|
|
297
|
+
> = ReturnType<typeof createColumnSchema<TUserScope, TCellSchema, TPropsSchema>>;
|
|
259
298
|
|
|
260
299
|
// #endregion
|
|
261
300
|
|
|
@@ -267,9 +306,10 @@ export namespace System_TableSchema {
|
|
|
267
306
|
* @system @alpha
|
|
268
307
|
*/
|
|
269
308
|
export type CreateRowOptionsBase<
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
309
|
+
TUserScope extends string = string,
|
|
310
|
+
TSchemaFactory extends SchemaFactoryBeta<TUserScope> = SchemaFactoryBeta<TUserScope>,
|
|
311
|
+
TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,
|
|
312
|
+
> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCellSchema>;
|
|
273
313
|
|
|
274
314
|
/**
|
|
275
315
|
* Factory for creating row schema.
|
|
@@ -277,16 +317,16 @@ export namespace System_TableSchema {
|
|
|
277
317
|
*/
|
|
278
318
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
|
|
279
319
|
export function createRowSchema<
|
|
280
|
-
const
|
|
320
|
+
const TUserScope extends string,
|
|
281
321
|
const TCellSchema extends ImplicitAllowedTypes,
|
|
282
322
|
const TPropsSchema extends ImplicitFieldSchema,
|
|
283
323
|
>(
|
|
284
|
-
inputSchemaFactory: SchemaFactoryBeta<
|
|
324
|
+
inputSchemaFactory: SchemaFactoryBeta<TUserScope>,
|
|
285
325
|
cellSchema: TCellSchema,
|
|
286
326
|
propsSchema: TPropsSchema,
|
|
287
327
|
) {
|
|
288
|
-
const schemaFactory = inputSchemaFactory
|
|
289
|
-
type Scope =
|
|
328
|
+
const schemaFactory = createTableScopedFactory(inputSchemaFactory);
|
|
329
|
+
type Scope = typeof schemaFactory.scope;
|
|
290
330
|
|
|
291
331
|
// Note: `rowFields` is broken into two parts to work around a TypeScript bug
|
|
292
332
|
// that results in broken `.d.ts` output.
|
|
@@ -404,10 +444,10 @@ export namespace System_TableSchema {
|
|
|
404
444
|
* @sealed @system @alpha
|
|
405
445
|
*/
|
|
406
446
|
export type RowSchemaBase<
|
|
407
|
-
|
|
447
|
+
TUserScope extends string = string,
|
|
408
448
|
TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,
|
|
409
449
|
TPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,
|
|
410
|
-
> = ReturnType<typeof createRowSchema<
|
|
450
|
+
> = ReturnType<typeof createRowSchema<TUserScope, TCellSchema, TPropsSchema>>;
|
|
411
451
|
|
|
412
452
|
// #endregion
|
|
413
453
|
|
|
@@ -419,9 +459,10 @@ export namespace System_TableSchema {
|
|
|
419
459
|
* @system @alpha
|
|
420
460
|
*/
|
|
421
461
|
export type TableFactoryOptionsBase<
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
462
|
+
TUserScope extends string = string,
|
|
463
|
+
TSchemaFactory extends SchemaFactoryBeta<TUserScope> = SchemaFactoryBeta<TUserScope>,
|
|
464
|
+
TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,
|
|
465
|
+
> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCellSchema>;
|
|
425
466
|
|
|
426
467
|
/**
|
|
427
468
|
* Factory for creating table schema.
|
|
@@ -429,50 +470,134 @@ export namespace System_TableSchema {
|
|
|
429
470
|
*/
|
|
430
471
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
|
|
431
472
|
export function createTableSchema<
|
|
432
|
-
const
|
|
473
|
+
const TUserScope extends string,
|
|
433
474
|
const TCellSchema extends ImplicitAllowedTypes,
|
|
434
|
-
const TColumnSchema extends ColumnSchemaBase<
|
|
435
|
-
const TRowSchema extends RowSchemaBase<
|
|
475
|
+
const TColumnSchema extends ColumnSchemaBase<TUserScope, TCellSchema>,
|
|
476
|
+
const TRowSchema extends RowSchemaBase<TUserScope, TCellSchema>,
|
|
436
477
|
>(
|
|
437
|
-
inputSchemaFactory: SchemaFactoryBeta<
|
|
478
|
+
inputSchemaFactory: SchemaFactoryBeta<TUserScope>,
|
|
438
479
|
_cellSchema: TCellSchema,
|
|
439
480
|
columnSchema: TColumnSchema,
|
|
440
481
|
rowSchema: TRowSchema,
|
|
441
482
|
) {
|
|
442
|
-
const schemaFactory = inputSchemaFactory
|
|
443
|
-
type Scope =
|
|
483
|
+
const schemaFactory = createTableScopedFactory(inputSchemaFactory);
|
|
484
|
+
type Scope = typeof schemaFactory.scope;
|
|
444
485
|
|
|
445
486
|
type CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;
|
|
446
487
|
type ColumnValueType = TreeNodeFromImplicitAllowedTypes<TColumnSchema>;
|
|
488
|
+
type ColumnInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>;
|
|
447
489
|
type RowValueType = TreeNodeFromImplicitAllowedTypes<TRowSchema>;
|
|
490
|
+
type RowInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>;
|
|
448
491
|
|
|
449
492
|
// Internal version of RowValueType that exposes the `cells` property for use within Table methods.
|
|
450
493
|
type RowValueInternalType = RowValueType & RowPrivate<TCellSchema>;
|
|
451
494
|
|
|
495
|
+
/**
|
|
496
|
+
* {@link Table} inner fields.
|
|
497
|
+
* @remarks Extracted for re-use as construction parameters.
|
|
498
|
+
* @see {@link Table.create}.
|
|
499
|
+
*/
|
|
500
|
+
const tableInnerFields = {
|
|
501
|
+
rows: schemaFactory.array("Table.rows", rowSchema),
|
|
502
|
+
columns: schemaFactory.array("Table.columns", columnSchema),
|
|
503
|
+
} as const satisfies Record<string, ImplicitFieldSchema>;
|
|
504
|
+
|
|
452
505
|
/**
|
|
453
506
|
* {@link Table} fields.
|
|
454
507
|
* @remarks Extracted for re-use in returned type signature defined later in this function.
|
|
455
508
|
* The implicit typing is intentional.
|
|
456
509
|
*/
|
|
457
510
|
const tableFields = {
|
|
458
|
-
|
|
459
|
-
|
|
511
|
+
table: schemaFactory.required(schemaFactory.object("Table", tableInnerFields), {
|
|
512
|
+
// Use an empty key in the stored schema format to help prevent schema-unaware edits from being
|
|
513
|
+
// made to the table, which may violate intended invariants.
|
|
514
|
+
key: EmptyKey,
|
|
515
|
+
}),
|
|
460
516
|
} as const satisfies Record<string, ImplicitFieldSchema>;
|
|
461
517
|
|
|
518
|
+
type TableValueType = TreeNode &
|
|
519
|
+
TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema> &
|
|
520
|
+
WithType<ScopedSchemaName<Scope, "TableRoot">>;
|
|
521
|
+
type TableConstructorType = new (data?: InternalTreeNode | undefined) => TableValueType;
|
|
522
|
+
|
|
462
523
|
/**
|
|
463
524
|
* The Table schema
|
|
464
525
|
*/
|
|
465
526
|
class Table
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
527
|
+
// Calling the objectSchema factory directly rather than using the schemaFactory so we can specify
|
|
528
|
+
// `implicitlyConstructable: false`, which the SchemaFactory APIs do not yet support.
|
|
529
|
+
// TODO: when support for configuring `implicitlyConstructable` is added to SchemaFactory, switch to
|
|
530
|
+
// using that instead.
|
|
531
|
+
extends objectSchema(
|
|
532
|
+
/* identifier: */ scoped(schemaFactory as SchemaFactory<Scope>, "TableRoot"),
|
|
533
|
+
/* info: */ tableFields,
|
|
534
|
+
/* implicitlyConstructable: */ false,
|
|
535
|
+
/* nodeOptions: */ {
|
|
536
|
+
// Will make it easier to evolve this schema in the future.
|
|
537
|
+
allowUnknownOptionalFields: true,
|
|
538
|
+
},
|
|
539
|
+
)
|
|
540
|
+
implements TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema>
|
|
471
541
|
{
|
|
472
|
-
public
|
|
542
|
+
public constructor(node?: InternalTreeNode | undefined) {
|
|
543
|
+
super(node ?? { table: { columns: [], rows: [] } });
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
public static create<TThis extends TableConstructorType>(
|
|
473
547
|
this: TThis,
|
|
548
|
+
initialContents?:
|
|
549
|
+
| TableSchema.TableFactoryMethodParameters<
|
|
550
|
+
TUserScope,
|
|
551
|
+
TCellSchema,
|
|
552
|
+
TColumnSchema,
|
|
553
|
+
TRowSchema
|
|
554
|
+
>
|
|
555
|
+
| undefined,
|
|
474
556
|
): InstanceType<TThis> {
|
|
475
|
-
|
|
557
|
+
// #region Input validation
|
|
558
|
+
|
|
559
|
+
const columns =
|
|
560
|
+
(initialContents?.columns as Iterable<ColumnInsertableType> | undefined) ?? [];
|
|
561
|
+
|
|
562
|
+
const columnIds = new Set<string>();
|
|
563
|
+
for (const column of columns) {
|
|
564
|
+
columnIds.add((column as ColumnValueType).id);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
const rows = (initialContents?.rows as Iterable<RowInsertableType> | undefined) ?? [];
|
|
568
|
+
|
|
569
|
+
Table._validateNewColumns(
|
|
570
|
+
columns,
|
|
571
|
+
// New table, so no existing columns to validate against
|
|
572
|
+
new Set(),
|
|
573
|
+
);
|
|
574
|
+
|
|
575
|
+
Table._validateNewRows(
|
|
576
|
+
rows,
|
|
577
|
+
// New table, so no existing rows to validate against
|
|
578
|
+
new Set(),
|
|
579
|
+
// No existing columns to validate cells against, but we do need to validate the new rows against the new columns
|
|
580
|
+
columnIds,
|
|
581
|
+
);
|
|
582
|
+
|
|
583
|
+
// #endregion
|
|
584
|
+
return new this(
|
|
585
|
+
initialContents === undefined
|
|
586
|
+
? undefined
|
|
587
|
+
: ({
|
|
588
|
+
table: initialContents,
|
|
589
|
+
// We have typed our constructor to prevent users from calling it directly with insertable contents.
|
|
590
|
+
// But the base constructor still allows it. Cast to work around this.
|
|
591
|
+
} as unknown as InternalTreeNode),
|
|
592
|
+
) as InstanceType<TThis>;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
public get columns(): RearrangeableList<TColumnSchema> {
|
|
596
|
+
return this.table.columns as RearrangeableList<TColumnSchema>;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
public get rows(): RearrangeableList<TRowSchema> {
|
|
600
|
+
return this.table.rows as RearrangeableList<TRowSchema>;
|
|
476
601
|
}
|
|
477
602
|
|
|
478
603
|
public getColumn(indexOrId: number | string): ColumnValueType | undefined {
|
|
@@ -504,17 +629,26 @@ export namespace System_TableSchema {
|
|
|
504
629
|
columns,
|
|
505
630
|
index,
|
|
506
631
|
}: TableSchema.InsertColumnsParameters<TColumnSchema>): ColumnValueType[] {
|
|
632
|
+
// #region Input validation
|
|
633
|
+
|
|
634
|
+
// Ensure specified index is valid
|
|
635
|
+
if (index !== undefined) {
|
|
636
|
+
validateIndex(index, this.table.columns, "Table.insertColumns", true);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
// Ensure the new columns being inserted are valid
|
|
640
|
+
this.#validateNewColumns(columns);
|
|
641
|
+
|
|
642
|
+
// #endregion
|
|
643
|
+
|
|
507
644
|
// TypeScript is unable to narrow the column type correctly here, hence the casts below.
|
|
508
645
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
509
646
|
if (index === undefined) {
|
|
510
647
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
511
|
-
this.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);
|
|
648
|
+
this.table.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);
|
|
512
649
|
} else {
|
|
513
|
-
// Ensure specified index is valid
|
|
514
|
-
validateIndex(index, this.columns, "Table.insertColumns", true);
|
|
515
|
-
|
|
516
650
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
517
|
-
this.columns.insertAt(index, TreeArrayNode.spread(columns) as any);
|
|
651
|
+
this.table.columns.insertAt(index, TreeArrayNode.spread(columns) as any);
|
|
518
652
|
}
|
|
519
653
|
|
|
520
654
|
// Inserting the input nodes into the tree hydrates them, making them usable as nodes.
|
|
@@ -529,27 +663,11 @@ export namespace System_TableSchema {
|
|
|
529
663
|
|
|
530
664
|
// Ensure specified index is valid
|
|
531
665
|
if (index !== undefined) {
|
|
532
|
-
validateIndex(index, this.rows, "Table.insertRows", true);
|
|
666
|
+
validateIndex(index, this.table.rows, "Table.insertRows", true);
|
|
533
667
|
}
|
|
534
668
|
|
|
535
|
-
//
|
|
536
|
-
|
|
537
|
-
for (const newRow of rows) {
|
|
538
|
-
// If the row contains cells, verify that the table contains the columns for those cells.
|
|
539
|
-
// Note: we intentionally hide `cells` on `IRow` to avoid leaking the internal data representation as much as possible, so we have to cast here.
|
|
540
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
541
|
-
if ((newRow as any).cells !== undefined) {
|
|
542
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
543
|
-
const keys: string[] = Object.keys((newRow as any).cells);
|
|
544
|
-
for (const key of keys) {
|
|
545
|
-
if (!this.#containsColumnWithId(key)) {
|
|
546
|
-
throw new UsageError(
|
|
547
|
-
`Attempted to insert row a cell under column ID "${key}", but the table does not contain a column with that ID.`,
|
|
548
|
-
);
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
}
|
|
669
|
+
// Ensure the new rows being inserted are valid
|
|
670
|
+
this.#validateNewRows(rows);
|
|
553
671
|
|
|
554
672
|
// #endregion
|
|
555
673
|
|
|
@@ -557,10 +675,10 @@ export namespace System_TableSchema {
|
|
|
557
675
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
558
676
|
if (index === undefined) {
|
|
559
677
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
560
|
-
this.rows.insertAtEnd(TreeArrayNode.spread(rows) as any);
|
|
678
|
+
this.table.rows.insertAtEnd(TreeArrayNode.spread(rows) as any);
|
|
561
679
|
} else {
|
|
562
680
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
563
|
-
this.rows.insertAt(index, TreeArrayNode.spread(rows) as any);
|
|
681
|
+
this.table.rows.insertAt(index, TreeArrayNode.spread(rows) as any);
|
|
564
682
|
}
|
|
565
683
|
|
|
566
684
|
// Inserting the input nodes into the tree hydrates them, making them usable as nodes.
|
|
@@ -586,17 +704,18 @@ export namespace System_TableSchema {
|
|
|
586
704
|
if (typeof indexOrColumns === "number" || indexOrColumns === undefined) {
|
|
587
705
|
let removedColumns: ColumnValueType[] | undefined;
|
|
588
706
|
const startIndex = indexOrColumns ?? 0;
|
|
589
|
-
const endIndex =
|
|
707
|
+
const endIndex =
|
|
708
|
+
count === undefined ? this.table.columns.length : startIndex + count;
|
|
590
709
|
|
|
591
710
|
// If there are no columns to remove, do nothing
|
|
592
711
|
if (startIndex === endIndex) {
|
|
593
712
|
return [];
|
|
594
713
|
}
|
|
595
714
|
|
|
596
|
-
validateIndexRange(startIndex, endIndex, this.columns, "Table.removeColumns");
|
|
715
|
+
validateIndexRange(startIndex, endIndex, this.table.columns, "Table.removeColumns");
|
|
597
716
|
|
|
598
717
|
this.#applyEditsInBatch(() => {
|
|
599
|
-
const columnsToRemove = this.columns.slice(
|
|
718
|
+
const columnsToRemove = this.table.columns.slice(
|
|
600
719
|
startIndex,
|
|
601
720
|
endIndex,
|
|
602
721
|
) as ColumnValueType[];
|
|
@@ -607,7 +726,12 @@ export namespace System_TableSchema {
|
|
|
607
726
|
}
|
|
608
727
|
|
|
609
728
|
// Second, remove the column nodes:
|
|
610
|
-
removeRangeFromArray(
|
|
729
|
+
removeRangeFromArray(
|
|
730
|
+
startIndex,
|
|
731
|
+
endIndex,
|
|
732
|
+
this.table.columns,
|
|
733
|
+
"Table.removeColumns",
|
|
734
|
+
);
|
|
611
735
|
removedColumns = columnsToRemove;
|
|
612
736
|
});
|
|
613
737
|
return removedColumns ?? fail(0xc1f /* Transaction did not complete. */);
|
|
@@ -630,7 +754,7 @@ export namespace System_TableSchema {
|
|
|
630
754
|
// So if we throw an error here for any column, no columns will be removed.
|
|
631
755
|
for (const columnToRemove of columnsToRemove) {
|
|
632
756
|
// Remove the corresponding cell from all rows.
|
|
633
|
-
for (const row of this.rows) {
|
|
757
|
+
for (const row of this.table.rows) {
|
|
634
758
|
// TypeScript is unable to narrow the row type correctly here, hence the cast.
|
|
635
759
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
636
760
|
this.removeCell({
|
|
@@ -640,7 +764,7 @@ export namespace System_TableSchema {
|
|
|
640
764
|
}
|
|
641
765
|
|
|
642
766
|
// We have already validated that all of the columns exist above, so this is safe.
|
|
643
|
-
this.columns.removeAt(this.columns.indexOf(columnToRemove));
|
|
767
|
+
this.table.columns.removeAt(this.table.columns.indexOf(columnToRemove));
|
|
644
768
|
}
|
|
645
769
|
});
|
|
646
770
|
return columnsToRemove;
|
|
@@ -653,14 +777,19 @@ export namespace System_TableSchema {
|
|
|
653
777
|
): RowValueType[] {
|
|
654
778
|
if (typeof indexOrRows === "number" || indexOrRows === undefined) {
|
|
655
779
|
const startIndex = indexOrRows ?? 0;
|
|
656
|
-
const endIndex = count === undefined ? this.
|
|
780
|
+
const endIndex = count === undefined ? this.table.rows.length : startIndex + count;
|
|
657
781
|
|
|
658
782
|
// If there are no rows to remove, do nothing
|
|
659
783
|
if (startIndex === endIndex) {
|
|
660
784
|
return [];
|
|
661
785
|
}
|
|
662
786
|
|
|
663
|
-
return removeRangeFromArray(
|
|
787
|
+
return removeRangeFromArray(
|
|
788
|
+
startIndex,
|
|
789
|
+
endIndex,
|
|
790
|
+
this.table.rows,
|
|
791
|
+
"Table.removeRows",
|
|
792
|
+
);
|
|
664
793
|
}
|
|
665
794
|
|
|
666
795
|
// If there are no rows to remove, do nothing
|
|
@@ -681,8 +810,8 @@ export namespace System_TableSchema {
|
|
|
681
810
|
// So if we throw an error here for any row, no rows will be removed.
|
|
682
811
|
for (const rowToRemove of rowsToRemove) {
|
|
683
812
|
// We have already validated that all of the rows exist above, so this is safe.
|
|
684
|
-
const index = this.rows.indexOf(rowToRemove);
|
|
685
|
-
this.rows.removeAt(index);
|
|
813
|
+
const index = this.table.rows.indexOf(rowToRemove);
|
|
814
|
+
this.table.rows.removeAt(index);
|
|
686
815
|
}
|
|
687
816
|
});
|
|
688
817
|
return rowsToRemove;
|
|
@@ -709,7 +838,7 @@ export namespace System_TableSchema {
|
|
|
709
838
|
* Removes the cell corresponding with the specified column from each row in the table.
|
|
710
839
|
*/
|
|
711
840
|
#removeCells(column: ColumnValueType): void {
|
|
712
|
-
for (const row of this.rows) {
|
|
841
|
+
for (const row of this.table.rows) {
|
|
713
842
|
// TypeScript is unable to narrow the row type correctly here, hence the cast.
|
|
714
843
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
715
844
|
this.removeCell({
|
|
@@ -757,25 +886,25 @@ export namespace System_TableSchema {
|
|
|
757
886
|
columnOrIdOrIndex: ColumnValueType | string | number,
|
|
758
887
|
): ColumnValueType | undefined {
|
|
759
888
|
if (typeof columnOrIdOrIndex === "number") {
|
|
760
|
-
if (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.columns.length) {
|
|
889
|
+
if (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.table.columns.length) {
|
|
761
890
|
return undefined;
|
|
762
891
|
}
|
|
763
892
|
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
764
893
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
765
|
-
return this.columns[columnOrIdOrIndex] as ColumnValueType;
|
|
894
|
+
return this.table.columns[columnOrIdOrIndex] as ColumnValueType;
|
|
766
895
|
}
|
|
767
896
|
|
|
768
897
|
if (typeof columnOrIdOrIndex === "string") {
|
|
769
898
|
const columnId = columnOrIdOrIndex;
|
|
770
899
|
// TypeScript is unable to narrow the types correctly here, hence the casts.
|
|
771
900
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
772
|
-
return this.columns.find((col) => (col as ColumnValueType).id === columnId) as
|
|
901
|
+
return this.table.columns.find((col) => (col as ColumnValueType).id === columnId) as
|
|
773
902
|
| ColumnValueType
|
|
774
903
|
| undefined;
|
|
775
904
|
}
|
|
776
905
|
|
|
777
906
|
// If the user provided a node, ensure it actually exists in this table.
|
|
778
|
-
if (!this.columns.includes(columnOrIdOrIndex)) {
|
|
907
|
+
if (!this.table.columns.includes(columnOrIdOrIndex)) {
|
|
779
908
|
return undefined;
|
|
780
909
|
}
|
|
781
910
|
|
|
@@ -795,13 +924,6 @@ export namespace System_TableSchema {
|
|
|
795
924
|
return column;
|
|
796
925
|
}
|
|
797
926
|
|
|
798
|
-
/**
|
|
799
|
-
* Checks if a Column with the specified ID exists in the table.
|
|
800
|
-
*/
|
|
801
|
-
#containsColumnWithId(columnId: string): boolean {
|
|
802
|
-
return this.#tryGetColumn(columnId) !== undefined;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
927
|
/**
|
|
806
928
|
* Throw a `UsageError` for a missing Column by its ID or index.
|
|
807
929
|
*/
|
|
@@ -830,25 +952,25 @@ export namespace System_TableSchema {
|
|
|
830
952
|
*/
|
|
831
953
|
#tryGetRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType | undefined {
|
|
832
954
|
if (typeof rowOrIdOrIndex === "number") {
|
|
833
|
-
if (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.rows.length) {
|
|
955
|
+
if (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.table.rows.length) {
|
|
834
956
|
return undefined;
|
|
835
957
|
}
|
|
836
958
|
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
837
959
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
838
|
-
return this.rows[rowOrIdOrIndex] as RowValueType;
|
|
960
|
+
return this.table.rows[rowOrIdOrIndex] as RowValueType;
|
|
839
961
|
}
|
|
840
962
|
|
|
841
963
|
if (typeof rowOrIdOrIndex === "string") {
|
|
842
964
|
const rowId = rowOrIdOrIndex;
|
|
843
965
|
// TypeScript is unable to narrow the types correctly here, hence the casts.
|
|
844
966
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
845
|
-
return this.rows.find((row) => (row as RowValueType).id === rowId) as
|
|
967
|
+
return this.table.rows.find((row) => (row as RowValueType).id === rowId) as
|
|
846
968
|
| RowValueType
|
|
847
969
|
| undefined;
|
|
848
970
|
}
|
|
849
971
|
|
|
850
972
|
// If the user provided a node, ensure it actually exists in this table.
|
|
851
|
-
if (!this.rows.includes(rowOrIdOrIndex)) {
|
|
973
|
+
if (!this.table.rows.includes(rowOrIdOrIndex)) {
|
|
852
974
|
return undefined;
|
|
853
975
|
}
|
|
854
976
|
|
|
@@ -868,6 +990,109 @@ export namespace System_TableSchema {
|
|
|
868
990
|
return row;
|
|
869
991
|
}
|
|
870
992
|
|
|
993
|
+
/**
|
|
994
|
+
* Validates the provided list of new columns being inserted into the table.
|
|
995
|
+
* @throws Throws a `UsageError` if any of the following conditions are met:
|
|
996
|
+
* - A column with a duplicate ID is being inserted.
|
|
997
|
+
*/
|
|
998
|
+
#validateNewColumns(newColumns: readonly ColumnInsertableType[]): void {
|
|
999
|
+
return Table._validateNewColumns(
|
|
1000
|
+
newColumns,
|
|
1001
|
+
new Set(this.table.columns.map((column) => (column as ColumnValueType).id)),
|
|
1002
|
+
);
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* Validates the provided list of new rows being inserted into the table.
|
|
1007
|
+
* @throws Throws a `UsageError` if any of the following conditions are met:
|
|
1008
|
+
* - A row with a duplicate ID is being inserted.
|
|
1009
|
+
* - A row is being inserted that contains cells for columns that do not exist in the table.
|
|
1010
|
+
*/
|
|
1011
|
+
#validateNewRows(newRows: readonly RowInsertableType[]): void {
|
|
1012
|
+
return Table._validateNewRows(
|
|
1013
|
+
newRows,
|
|
1014
|
+
new Set(this.table.rows.map((row) => (row as RowValueType).id)),
|
|
1015
|
+
new Set(this.table.columns.map((column) => (column as ColumnValueType).id)),
|
|
1016
|
+
);
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Validates the provided list of new columns being inserted into the table.
|
|
1021
|
+
* @throws Throws a `UsageError` if any of the following conditions are met:
|
|
1022
|
+
* - A column with a duplicate ID is being inserted.
|
|
1023
|
+
*/
|
|
1024
|
+
private static _validateNewColumns(
|
|
1025
|
+
newColumns: Iterable<ColumnInsertableType>,
|
|
1026
|
+
existingColumnIds: Set<string>,
|
|
1027
|
+
): void {
|
|
1028
|
+
const newColumnIds = new Set<string>();
|
|
1029
|
+
for (const newColumn of newColumns) {
|
|
1030
|
+
// #region Ensure each column ID is unique
|
|
1031
|
+
const newColumnId = (newColumn as ColumnValueType).id;
|
|
1032
|
+
if (existingColumnIds.has(newColumnId)) {
|
|
1033
|
+
throw new UsageError(
|
|
1034
|
+
`Attempted to insert a column with ID "${newColumnId}", but a column with that ID already exists in the table.`,
|
|
1035
|
+
);
|
|
1036
|
+
}
|
|
1037
|
+
if (newColumnIds.has(newColumnId)) {
|
|
1038
|
+
throw new UsageError(
|
|
1039
|
+
`Attempted to insert multiple columns with ID "${newColumnId}". Column IDs must be unique.`,
|
|
1040
|
+
);
|
|
1041
|
+
}
|
|
1042
|
+
newColumnIds.add(newColumnId);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* Validates the provided list of new rows being inserted into the table.
|
|
1048
|
+
* @throws Throws a `UsageError` if any of the following conditions are met:
|
|
1049
|
+
* - A row with a duplicate ID is being inserted.
|
|
1050
|
+
* - A row is being inserted that contains cells for columns that do not exist in the table.
|
|
1051
|
+
*/
|
|
1052
|
+
private static _validateNewRows(
|
|
1053
|
+
newRows: Iterable<RowInsertableType>,
|
|
1054
|
+
existingRowIds: Set<string>,
|
|
1055
|
+
columnIds: Set<string>,
|
|
1056
|
+
): void {
|
|
1057
|
+
const newRowIds = new Set<string>();
|
|
1058
|
+
for (const newRow of newRows) {
|
|
1059
|
+
// #region Ensure each row ID is unique
|
|
1060
|
+
|
|
1061
|
+
const newRowId = (newRow as RowValueType).id;
|
|
1062
|
+
if (existingRowIds.has(newRowId)) {
|
|
1063
|
+
throw new UsageError(
|
|
1064
|
+
`Attempted to insert a row with ID "${newRowId}", but a row with that ID already exists in the table.`,
|
|
1065
|
+
);
|
|
1066
|
+
}
|
|
1067
|
+
if (newRowIds.has(newRowId)) {
|
|
1068
|
+
throw new UsageError(
|
|
1069
|
+
`Attempted to insert multiple rows with ID "${newRowId}". Row IDs must be unique.`,
|
|
1070
|
+
);
|
|
1071
|
+
}
|
|
1072
|
+
newRowIds.add(newRowId);
|
|
1073
|
+
|
|
1074
|
+
// #endregion
|
|
1075
|
+
|
|
1076
|
+
// #region If the row contains cells, verify that the table contains the columns for those cells
|
|
1077
|
+
|
|
1078
|
+
// Note: we intentionally hide `cells` on `IRow` to avoid leaking the internal data representation as much as possible, so we have to cast here.
|
|
1079
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1080
|
+
if ((newRow as any).cells !== undefined) {
|
|
1081
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1082
|
+
const keys: string[] = Object.keys((newRow as any).cells);
|
|
1083
|
+
for (const key of keys) {
|
|
1084
|
+
if (!columnIds.has(key)) {
|
|
1085
|
+
throw new UsageError(
|
|
1086
|
+
`Attempted to insert a row containing a cell under column ID "${key}", but the table does not contain a column with that ID.`,
|
|
1087
|
+
);
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
// #endregion
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
|
|
871
1096
|
/**
|
|
872
1097
|
* Throw a `UsageError` for a missing Row by its ID or index.
|
|
873
1098
|
*/
|
|
@@ -895,30 +1120,35 @@ export namespace System_TableSchema {
|
|
|
895
1120
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
896
1121
|
(Table as any)[tableSchemaSymbol] = true;
|
|
897
1122
|
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1123
|
+
// Named interfaces here do not compile.
|
|
1124
|
+
type Statics = {
|
|
1125
|
+
/**
|
|
1126
|
+
* Create a table with initial contents.
|
|
1127
|
+
* @param initialContents - The initial contents of the table.
|
|
1128
|
+
* If not provided, an empty table will be constructed.
|
|
1129
|
+
* @remarks Performs the following input validation:
|
|
1130
|
+
* - Ensures that any cells specified in the initial rows correspond to existing columns in the initial columns.
|
|
1131
|
+
* - Ensures that all column and row IDs are unique.
|
|
1132
|
+
*/
|
|
1133
|
+
create<TThis extends TableConstructorType>(
|
|
1134
|
+
this: TThis,
|
|
1135
|
+
initialContents?:
|
|
1136
|
+
| TableSchema.TableFactoryMethodParameters<
|
|
1137
|
+
TUserScope,
|
|
1138
|
+
TCellSchema,
|
|
1139
|
+
TColumnSchema,
|
|
1140
|
+
TRowSchema
|
|
1141
|
+
>
|
|
1142
|
+
| undefined,
|
|
1143
|
+
): InstanceType<TThis>;
|
|
1144
|
+
} & TableConstructorType;
|
|
903
1145
|
|
|
904
1146
|
// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly "__#124291@#brand": unknown;`
|
|
905
1147
|
// for the private brand field of TreeNode.
|
|
906
1148
|
// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.
|
|
907
1149
|
// This is avoided by doing this type conversion.
|
|
908
|
-
// The conversion is done via
|
|
909
|
-
const TableSchemaType
|
|
910
|
-
/* Name */ ScopedSchemaName<Scope, "Table">,
|
|
911
|
-
/* Kind */ NodeKind.Object,
|
|
912
|
-
/* TNode */ TableValueType,
|
|
913
|
-
/* TInsertable */ object & TableInsertableType,
|
|
914
|
-
/* ImplicitlyConstructable */ true,
|
|
915
|
-
/* Info */ typeof tableFields
|
|
916
|
-
> & {
|
|
917
|
-
/**
|
|
918
|
-
* Create an empty table.
|
|
919
|
-
*/
|
|
920
|
-
empty<TThis extends TableConstructorType>(this: TThis): InstanceType<TThis>;
|
|
921
|
-
} = Table;
|
|
1150
|
+
// The conversion is done via eraseSubclassableSchemaDetails to erase internal details.
|
|
1151
|
+
const TableSchemaType = eraseSchemaDetailsSubclassable<TableValueType, Statics>()(Table);
|
|
922
1152
|
|
|
923
1153
|
// Return the table schema
|
|
924
1154
|
return TableSchemaType;
|
|
@@ -929,15 +1159,21 @@ export namespace System_TableSchema {
|
|
|
929
1159
|
* @sealed @system @alpha
|
|
930
1160
|
*/
|
|
931
1161
|
export type TableSchemaBase<
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
> = ReturnType<typeof createTableSchema<
|
|
1162
|
+
TUserScope extends string,
|
|
1163
|
+
TCellSchema extends ImplicitAllowedTypes,
|
|
1164
|
+
TColumnSchema extends ColumnSchemaBase<TUserScope, TCellSchema>,
|
|
1165
|
+
TRowSchema extends RowSchemaBase<TUserScope, TCellSchema>,
|
|
1166
|
+
> = ReturnType<typeof createTableSchema<TUserScope, TCellSchema, TColumnSchema, TRowSchema>>;
|
|
937
1167
|
|
|
938
1168
|
// #endregion
|
|
939
1169
|
}
|
|
940
1170
|
|
|
1171
|
+
function createTableScopedFactory<TUserScope extends string>(
|
|
1172
|
+
inputSchemaFactory: SchemaFactoryBeta<TUserScope>,
|
|
1173
|
+
): SchemaFactoryBeta<`${typeof baseSchemaScope}<${TUserScope}>`> {
|
|
1174
|
+
return new SchemaFactoryBeta(`${baseSchemaScope}<${inputSchemaFactory.scope}>`);
|
|
1175
|
+
}
|
|
1176
|
+
|
|
941
1177
|
/**
|
|
942
1178
|
* Removes the specified range of elements from the array.
|
|
943
1179
|
* @returns The removed elements.
|
|
@@ -1006,7 +1242,7 @@ function removeRangeFromArray<TNodeSchema extends ImplicitAllowedTypes>(
|
|
|
1006
1242
|
* cell: schemaFactory.string,
|
|
1007
1243
|
* }) {}
|
|
1008
1244
|
*
|
|
1009
|
-
* const table =
|
|
1245
|
+
* const table = MyTable.create({
|
|
1010
1246
|
* columns: [{ id: "column-0" }],
|
|
1011
1247
|
* rows: [{ id: "row-0", cells: { "column-0": "Hello world!" } }],
|
|
1012
1248
|
* });
|
|
@@ -1109,35 +1345,47 @@ export namespace TableSchema {
|
|
|
1109
1345
|
|
|
1110
1346
|
/**
|
|
1111
1347
|
* Factory for creating new table column schema.
|
|
1112
|
-
* @typeParam
|
|
1348
|
+
* @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
|
|
1113
1349
|
* @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
|
|
1114
1350
|
* @alpha
|
|
1115
1351
|
*/
|
|
1116
1352
|
export function column<
|
|
1117
|
-
const
|
|
1353
|
+
const TUserScope extends string,
|
|
1118
1354
|
const TCell extends ImplicitAllowedTypes,
|
|
1119
1355
|
>(
|
|
1120
|
-
params: System_TableSchema.CreateColumnOptionsBase<
|
|
1121
|
-
|
|
1356
|
+
params: System_TableSchema.CreateColumnOptionsBase<
|
|
1357
|
+
TUserScope,
|
|
1358
|
+
SchemaFactoryBeta<TUserScope>,
|
|
1359
|
+
TCell
|
|
1360
|
+
>,
|
|
1361
|
+
): System_TableSchema.ColumnSchemaBase<
|
|
1362
|
+
TUserScope,
|
|
1363
|
+
TCell,
|
|
1364
|
+
System_TableSchema.DefaultPropsType
|
|
1365
|
+
>;
|
|
1122
1366
|
/**
|
|
1123
1367
|
* Factory for creating new table column schema.
|
|
1124
|
-
* @typeParam
|
|
1368
|
+
* @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
|
|
1125
1369
|
* @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
|
|
1126
1370
|
* @typeParam TProps - Additional properties to associate with the column.
|
|
1127
1371
|
* @alpha
|
|
1128
1372
|
*/
|
|
1129
1373
|
export function column<
|
|
1130
|
-
const
|
|
1374
|
+
const TUserScope extends string,
|
|
1131
1375
|
const TCell extends ImplicitAllowedTypes,
|
|
1132
1376
|
const TProps extends ImplicitFieldSchema,
|
|
1133
1377
|
>(
|
|
1134
|
-
params: System_TableSchema.CreateColumnOptionsBase<
|
|
1378
|
+
params: System_TableSchema.CreateColumnOptionsBase<
|
|
1379
|
+
TUserScope,
|
|
1380
|
+
SchemaFactoryBeta<TUserScope>,
|
|
1381
|
+
TCell
|
|
1382
|
+
> & {
|
|
1135
1383
|
/**
|
|
1136
1384
|
* Optional column properties.
|
|
1137
1385
|
*/
|
|
1138
1386
|
readonly props: TProps;
|
|
1139
1387
|
},
|
|
1140
|
-
): System_TableSchema.ColumnSchemaBase<
|
|
1388
|
+
): System_TableSchema.ColumnSchemaBase<TUserScope, TCell, TProps>;
|
|
1141
1389
|
/**
|
|
1142
1390
|
* Overload implementation
|
|
1143
1391
|
*/
|
|
@@ -1186,35 +1434,43 @@ export namespace TableSchema {
|
|
|
1186
1434
|
|
|
1187
1435
|
/**
|
|
1188
1436
|
* Factory for creating new table column schema.
|
|
1189
|
-
* @typeParam
|
|
1437
|
+
* @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
|
|
1190
1438
|
* @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
|
|
1191
1439
|
* @alpha
|
|
1192
1440
|
*/
|
|
1193
1441
|
export function row<
|
|
1194
|
-
const
|
|
1442
|
+
const TUserScope extends string,
|
|
1195
1443
|
const TCell extends ImplicitAllowedTypes,
|
|
1196
1444
|
>(
|
|
1197
|
-
params: System_TableSchema.CreateRowOptionsBase<
|
|
1198
|
-
|
|
1445
|
+
params: System_TableSchema.CreateRowOptionsBase<
|
|
1446
|
+
TUserScope,
|
|
1447
|
+
SchemaFactoryBeta<TUserScope>,
|
|
1448
|
+
TCell
|
|
1449
|
+
>,
|
|
1450
|
+
): System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>;
|
|
1199
1451
|
/**
|
|
1200
1452
|
* Factory for creating new table row schema.
|
|
1201
|
-
* @typeParam
|
|
1453
|
+
* @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
|
|
1202
1454
|
* @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
|
|
1203
1455
|
* @typeParam TProps - Additional properties to associate with the row.
|
|
1204
1456
|
* @alpha
|
|
1205
1457
|
*/
|
|
1206
1458
|
export function row<
|
|
1207
|
-
const
|
|
1459
|
+
const TUserScope extends string,
|
|
1208
1460
|
const TCell extends ImplicitAllowedTypes,
|
|
1209
1461
|
const TProps extends ImplicitFieldSchema,
|
|
1210
1462
|
>(
|
|
1211
|
-
params: System_TableSchema.CreateRowOptionsBase<
|
|
1463
|
+
params: System_TableSchema.CreateRowOptionsBase<
|
|
1464
|
+
TUserScope,
|
|
1465
|
+
SchemaFactoryBeta<TUserScope>,
|
|
1466
|
+
TCell
|
|
1467
|
+
> & {
|
|
1212
1468
|
/**
|
|
1213
1469
|
* Optional row properties.
|
|
1214
1470
|
*/
|
|
1215
1471
|
readonly props: TProps;
|
|
1216
1472
|
},
|
|
1217
|
-
): System_TableSchema.RowSchemaBase<
|
|
1473
|
+
): System_TableSchema.RowSchemaBase<TUserScope, TCell, TProps>;
|
|
1218
1474
|
/**
|
|
1219
1475
|
* Overload implementation
|
|
1220
1476
|
*/
|
|
@@ -1234,7 +1490,7 @@ export namespace TableSchema {
|
|
|
1234
1490
|
|
|
1235
1491
|
/**
|
|
1236
1492
|
* A key to uniquely identify a cell within a table.
|
|
1237
|
-
* @alpha
|
|
1493
|
+
* @input @alpha
|
|
1238
1494
|
*/
|
|
1239
1495
|
export interface CellKey<
|
|
1240
1496
|
TColumn extends ImplicitAllowedTypes,
|
|
@@ -1253,7 +1509,7 @@ export namespace TableSchema {
|
|
|
1253
1509
|
|
|
1254
1510
|
/**
|
|
1255
1511
|
* {@link TableSchema.Table.insertColumns} parameters.
|
|
1256
|
-
* @alpha
|
|
1512
|
+
* @input @alpha
|
|
1257
1513
|
*/
|
|
1258
1514
|
export interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
|
|
1259
1515
|
/**
|
|
@@ -1270,7 +1526,7 @@ export namespace TableSchema {
|
|
|
1270
1526
|
|
|
1271
1527
|
/**
|
|
1272
1528
|
* {@link TableSchema.Table.insertRows} parameters.
|
|
1273
|
-
* @alpha
|
|
1529
|
+
* @input @alpha
|
|
1274
1530
|
*/
|
|
1275
1531
|
export interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
|
|
1276
1532
|
/**
|
|
@@ -1287,7 +1543,7 @@ export namespace TableSchema {
|
|
|
1287
1543
|
|
|
1288
1544
|
/**
|
|
1289
1545
|
* {@link TableSchema.Table.setCell} parameters.
|
|
1290
|
-
* @alpha
|
|
1546
|
+
* @input @alpha
|
|
1291
1547
|
*/
|
|
1292
1548
|
export interface SetCellParameters<
|
|
1293
1549
|
TCell extends ImplicitAllowedTypes,
|
|
@@ -1307,27 +1563,33 @@ export namespace TableSchema {
|
|
|
1307
1563
|
|
|
1308
1564
|
/**
|
|
1309
1565
|
* A table.
|
|
1310
|
-
*
|
|
1566
|
+
*
|
|
1567
|
+
* @remarks Table schema is created via the {@link TableSchema.(table:1)} factory.
|
|
1568
|
+
* Node instances of the schema type should be constructed via the static `create` method on the schema class.
|
|
1569
|
+
* E.g. `const table = MyTableSchema.create({ columns, rows});`
|
|
1570
|
+
*
|
|
1571
|
+
* @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
|
|
1311
1572
|
* @typeParam TCell - The type of the cells in the table.
|
|
1312
1573
|
* @typeParam TColumn - The type of the columns in the table.
|
|
1313
1574
|
* @typeParam TRow - The type of the rows in the table.
|
|
1575
|
+
*
|
|
1314
1576
|
* @sealed @alpha
|
|
1315
1577
|
*/
|
|
1316
1578
|
export interface Table<
|
|
1317
|
-
|
|
1579
|
+
TUserScope extends string,
|
|
1318
1580
|
TCell extends ImplicitAllowedTypes,
|
|
1319
|
-
TColumn extends System_TableSchema.ColumnSchemaBase<
|
|
1320
|
-
TRow extends System_TableSchema.RowSchemaBase<
|
|
1581
|
+
TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>,
|
|
1582
|
+
TRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>,
|
|
1321
1583
|
> {
|
|
1322
1584
|
/**
|
|
1323
1585
|
* The table's columns.
|
|
1324
1586
|
*/
|
|
1325
|
-
readonly columns:
|
|
1587
|
+
readonly columns: System_TableSchema.RearrangeableList<TColumn>;
|
|
1326
1588
|
|
|
1327
1589
|
/**
|
|
1328
1590
|
* The table's rows.
|
|
1329
1591
|
*/
|
|
1330
|
-
readonly rows:
|
|
1592
|
+
readonly rows: System_TableSchema.RearrangeableList<TRow>;
|
|
1331
1593
|
|
|
1332
1594
|
/**
|
|
1333
1595
|
* Gets a table column by its {@link TableSchema.Column.id}.
|
|
@@ -1475,84 +1737,136 @@ export namespace TableSchema {
|
|
|
1475
1737
|
): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
1476
1738
|
}
|
|
1477
1739
|
|
|
1740
|
+
/**
|
|
1741
|
+
* Input parameters for {@link TableSchema.Table}'s `create` factory method.
|
|
1742
|
+
* @input @alpha
|
|
1743
|
+
*/
|
|
1744
|
+
export interface TableFactoryMethodParameters<
|
|
1745
|
+
TUserScope extends string,
|
|
1746
|
+
TCell extends ImplicitAllowedTypes,
|
|
1747
|
+
TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>,
|
|
1748
|
+
TRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>,
|
|
1749
|
+
> {
|
|
1750
|
+
/**
|
|
1751
|
+
* Initial columns for the table.
|
|
1752
|
+
*/
|
|
1753
|
+
readonly columns?:
|
|
1754
|
+
| Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumn>>
|
|
1755
|
+
| undefined;
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* Initial rows for the table.
|
|
1759
|
+
* @remarks If any cells are specified, they will be validated against the IDs of the provided columns.
|
|
1760
|
+
*/
|
|
1761
|
+
readonly rows?: Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRow>> | undefined;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1478
1764
|
/**
|
|
1479
1765
|
* Factory for creating new table schema.
|
|
1480
|
-
* @typeParam
|
|
1766
|
+
* @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
|
|
1767
|
+
* The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.
|
|
1481
1768
|
* @typeParam TCell - The type of the cells in the table.
|
|
1482
1769
|
* @alpha
|
|
1483
1770
|
*/
|
|
1484
1771
|
export function table<
|
|
1485
|
-
const
|
|
1772
|
+
const TUserScope extends string,
|
|
1486
1773
|
const TCell extends ImplicitAllowedTypes,
|
|
1487
1774
|
>(
|
|
1488
|
-
params: System_TableSchema.TableFactoryOptionsBase<
|
|
1775
|
+
params: System_TableSchema.TableFactoryOptionsBase<
|
|
1776
|
+
TUserScope,
|
|
1777
|
+
SchemaFactoryBeta<TUserScope>,
|
|
1778
|
+
TCell
|
|
1779
|
+
>,
|
|
1489
1780
|
): System_TableSchema.TableSchemaBase<
|
|
1490
|
-
|
|
1781
|
+
TUserScope,
|
|
1491
1782
|
TCell,
|
|
1492
|
-
System_TableSchema.ColumnSchemaBase<
|
|
1493
|
-
|
|
1783
|
+
System_TableSchema.ColumnSchemaBase<
|
|
1784
|
+
TUserScope,
|
|
1785
|
+
TCell,
|
|
1786
|
+
System_TableSchema.DefaultPropsType
|
|
1787
|
+
>,
|
|
1788
|
+
System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>
|
|
1494
1789
|
>;
|
|
1495
1790
|
/**
|
|
1496
1791
|
* Factory for creating new table schema with custom column schema.
|
|
1497
|
-
* @typeParam
|
|
1792
|
+
* @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
|
|
1793
|
+
* The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.
|
|
1498
1794
|
* @typeParam TCell - The type of the cells in the table.
|
|
1499
1795
|
* @typeParam TColumn - The type of the columns in the table.
|
|
1500
1796
|
* @alpha
|
|
1501
1797
|
*/
|
|
1502
1798
|
export function table<
|
|
1503
|
-
const
|
|
1799
|
+
const TUserScope extends string,
|
|
1504
1800
|
const TCell extends ImplicitAllowedTypes,
|
|
1505
|
-
const TColumn extends System_TableSchema.ColumnSchemaBase<
|
|
1801
|
+
const TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>,
|
|
1506
1802
|
>(
|
|
1507
|
-
params: System_TableSchema.TableFactoryOptionsBase<
|
|
1803
|
+
params: System_TableSchema.TableFactoryOptionsBase<
|
|
1804
|
+
TUserScope,
|
|
1805
|
+
SchemaFactoryBeta<TUserScope>,
|
|
1806
|
+
TCell
|
|
1807
|
+
> & {
|
|
1508
1808
|
readonly column: TColumn;
|
|
1509
1809
|
},
|
|
1510
1810
|
): System_TableSchema.TableSchemaBase<
|
|
1511
|
-
|
|
1811
|
+
TUserScope,
|
|
1512
1812
|
TCell,
|
|
1513
1813
|
TColumn,
|
|
1514
|
-
System_TableSchema.RowSchemaBase<
|
|
1814
|
+
System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>
|
|
1515
1815
|
>;
|
|
1516
1816
|
/**
|
|
1517
1817
|
* Factory for creating new table schema with custom row schema.
|
|
1518
|
-
* @typeParam
|
|
1818
|
+
* @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
|
|
1819
|
+
* The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.
|
|
1519
1820
|
* @typeParam TCell - The type of the cells in the table.
|
|
1520
1821
|
* @typeParam TRow - The type of the rows in the table.
|
|
1521
1822
|
* @alpha
|
|
1522
1823
|
*/
|
|
1523
1824
|
export function table<
|
|
1524
|
-
const
|
|
1825
|
+
const TUserScope extends string,
|
|
1525
1826
|
const TCell extends ImplicitAllowedTypes,
|
|
1526
|
-
const TRow extends System_TableSchema.RowSchemaBase<
|
|
1827
|
+
const TRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>,
|
|
1527
1828
|
>(
|
|
1528
|
-
params: System_TableSchema.TableFactoryOptionsBase<
|
|
1829
|
+
params: System_TableSchema.TableFactoryOptionsBase<
|
|
1830
|
+
TUserScope,
|
|
1831
|
+
SchemaFactoryBeta<TUserScope>,
|
|
1832
|
+
TCell
|
|
1833
|
+
> & {
|
|
1529
1834
|
readonly row: TRow;
|
|
1530
1835
|
},
|
|
1531
1836
|
): System_TableSchema.TableSchemaBase<
|
|
1532
|
-
|
|
1837
|
+
TUserScope,
|
|
1533
1838
|
TCell,
|
|
1534
|
-
System_TableSchema.ColumnSchemaBase<
|
|
1839
|
+
System_TableSchema.ColumnSchemaBase<
|
|
1840
|
+
TUserScope,
|
|
1841
|
+
TCell,
|
|
1842
|
+
System_TableSchema.DefaultPropsType
|
|
1843
|
+
>,
|
|
1535
1844
|
TRow
|
|
1536
1845
|
>;
|
|
1537
1846
|
/**
|
|
1538
1847
|
* Factory for creating new table schema with custom column and row schema.
|
|
1539
|
-
* @typeParam
|
|
1848
|
+
* @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
|
|
1849
|
+
* The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.
|
|
1540
1850
|
* @typeParam TCell - The type of the cells in the table.
|
|
1541
1851
|
* @typeParam TColumn - The type of the columns in the table.
|
|
1542
1852
|
* @typeParam TRow - The type of the rows in the table.
|
|
1543
1853
|
* @alpha
|
|
1544
1854
|
*/
|
|
1545
1855
|
export function table<
|
|
1546
|
-
const
|
|
1856
|
+
const TUserScope extends string,
|
|
1547
1857
|
const TCell extends ImplicitAllowedTypes,
|
|
1548
|
-
const TColumn extends System_TableSchema.ColumnSchemaBase<
|
|
1549
|
-
const TRow extends System_TableSchema.RowSchemaBase<
|
|
1858
|
+
const TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>,
|
|
1859
|
+
const TRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>,
|
|
1550
1860
|
>(
|
|
1551
|
-
params: System_TableSchema.TableFactoryOptionsBase<
|
|
1861
|
+
params: System_TableSchema.TableFactoryOptionsBase<
|
|
1862
|
+
TUserScope,
|
|
1863
|
+
SchemaFactoryBeta<TUserScope>,
|
|
1864
|
+
TCell
|
|
1865
|
+
> & {
|
|
1552
1866
|
readonly column: TColumn;
|
|
1553
1867
|
readonly row: TRow;
|
|
1554
1868
|
},
|
|
1555
|
-
): System_TableSchema.TableSchemaBase<
|
|
1869
|
+
): System_TableSchema.TableSchemaBase<TUserScope, TCell, TColumn, TRow>;
|
|
1556
1870
|
/**
|
|
1557
1871
|
* Overload implementation
|
|
1558
1872
|
*/
|