@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/lib/tableSchema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableSchema.js","sourceRoot":"","sources":["../src/tableSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAQN,aAAa,EASb,aAAa,EAEb,sBAAsB,GAEtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,4BAA4B;AAC5B,mDAAmD;AACnD,oDAAoD;AACpD,2EAA2E;AAE3E,oBAAoB;AACpB,mGAAmG;AAEnG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rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { TreeAlpha } from \"./shared-tree/index.js\";\nimport {\n\ttype FieldHasDefault,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeKind,\n\ttype SchemaFactoryBeta,\n\ttype ScopedSchemaName,\n\tTreeArrayNode,\n\ttype TreeNode,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaClass,\n\ttype WithType,\n\ttype TreeFieldFromImplicitField,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InternalTreeNode,\n\tSchemaFactory,\n\ttype ImplicitFieldSchema,\n\twithBufferedTreeEvents,\n\ttype TreeRecordNode,\n} from \"./simple-tree/index.js\";\nimport { validateIndex, validateIndexRange } from \"./util/index.js\";\n\n// Future improvement TODOs:\n// - Omit `cells` property from Row insertion type.\n// - Record-like type parameters / input parameters?\n// - Omit `props` properties from Row and Column schemas when not provided?\n\n// Longer-term work:\n// - Add constraint APIs to make it possible to avoid situations that could yield \"orphaned\" cells.\n\n/**\n * The sub-scope applied to user-provided {@link SchemaFactory}s by table schema factories.\n */\nconst tableSchemaFactorySubScope = \"table\";\n\n/**\n * A private symbol put on table schema to help identify them.\n */\nconst tableSchemaSymbol: unique symbol = Symbol(\"tableNode\");\n\n/**\n * A row in a table.\n * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n * @typeParam TProps - Additional properties to associate with the row.\n * @privateRemarks Private counterpart to the {@link TableSchema.Row}.\n * Exposes internal properties needed for table operations (publicly exposed via {@link TableSchema.Table}).\n * @sealed\n */\nexport interface RowPrivate<\n\tTCell extends ImplicitAllowedTypes,\n\tTProps extends ImplicitFieldSchema = ImplicitFieldSchema,\n> extends TableSchema.Row<TCell, TProps> {\n\t/**\n\t * The row's cells.\n\t * @remarks This is a user-defined schema that can be used to store additional information about the row.\n\t * @privateRemarks\n\t * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createRowSchema}.\n\t * If you update the docs here, please also update the inline type definitions.\n\t */\n\treadonly cells: TreeRecordNode<TCell>;\n}\n\n/**\n * Not intended for use outside of this package.\n *\n * @privateRemarks\n * This namespace is a collection of internal system types relate to {@link TableSchema}.\n * This namespace should be strictly type-exported by the package.\n * All members should be tagged with `@system`.\n *\n * @system @alpha\n */\nexport namespace System_TableSchema {\n\t/**\n\t * Default type used for column and row \"props\" fields.\n\t * @privateRemarks\n\t * Longer term, it would be better to simply omit \"props\" altogether by default.\n\t * For now, this ensures that the user doesn't have to specify a \"props\" entry when initializing column/row nodes\n\t * and ensures that they cannot set anything that might conflict with future evolutions of the schema.\n\t * @system @alpha\n\t */\n\texport type DefaultPropsType = ReturnType<typeof SchemaFactory.optional<[]>>;\n\n\t/**\n\t * A base interface for factory input options which include an schema factory.\n\t * @remarks This interface should not be referenced directly.\n\t * @privateRemarks This interface primarily exists to provide a single home for property documentation.\n\t * @system @alpha\n\t */\n\texport interface OptionsWithSchemaFactory<TSchemaFactory extends SchemaFactoryBeta> {\n\t\t/**\n\t\t * Schema factory with which the Column schema will be associated.\n\t\t * @remarks Can be used to associate the resulting schema with an existing {@link SchemaFactory.scope|scope}.\n\t\t */\n\t\treadonly schemaFactory: TSchemaFactory;\n\t}\n\n\t/**\n\t * A base interface for factory input options which include the table cell schema.\n\t * @remarks This interface should not be referenced directly.\n\t * @privateRemarks This interface primarily exists to provide a single home for property documentation.\n\t * @system @alpha\n\t */\n\texport interface OptionsWithCellSchema<TCellSchema extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * Schema for the table's cells.\n\t\t */\n\t\treadonly cell: TCellSchema;\n\t}\n\n\t// #region Column\n\n\t/**\n\t * Base options for creating table cow schema.\n\t * @remarks Includes parameters common to all column factory overloads.\n\t * @system @alpha\n\t */\n\texport type CreateColumnOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryBeta = SchemaFactoryBeta,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating column schema.\n\t * @system @alpha\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createColumnSchema<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TPropsSchema extends ImplicitFieldSchema,\n\t>(inputSchemaFactory: SchemaFactoryBeta<TInputScope>, propsSchema: TPropsSchema) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\t// Note: `columnFields` is broken into two parts to work around a TypeScript bug\n\t\t// that results in broken `.d.ts` output.\n\t\t// See definition of `ColumnInsertableType` below.\n\t\tconst columnFieldsBuiltInParts = {\n\t\t\tid: schemaFactory.identifier,\n\t\t} as const;\n\t\tconst columnFieldsPropsPart = {\n\t\t\tprops: propsSchema,\n\t\t} as const;\n\n\t\t/**\n\t\t * {@link Column} fields.\n\t\t *\n\t\t * @remarks\n\t\t * Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t *\n\t\t * Note: ideally we would add a satisfies clause here to ensure that this satisfies\n\t\t * `Record<string, ImplicitFieldSchema>`, but doing so causes TypeScript to prematurely and incorrectly evaluate the type of `propsSchema`.\n\t\t * Likely related to the following issue: https://github.com/microsoft/TypeScript/issues/52394\n\t\t */\n\t\tconst columnFields = {\n\t\t\t...columnFieldsBuiltInParts,\n\t\t\t...columnFieldsPropsPart,\n\t\t} as const; // satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * A column in a table.\n\t\t */\n\t\tclass Column\n\t\t\textends schemaFactory.object(\"Column\", columnFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements TableSchema.Column<TCellSchema, TPropsSchema> {}\n\n\t\ttype ColumnValueType = TreeNode &\n\t\t\tTableSchema.Column<TCellSchema, TPropsSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Column\">>;\n\n\t\t// Note: ideally this type would just leverage `InsertableObjectFromSchemaRecord<typeof columnFields>`,\n\t\t// but that results in broken `.d.ts` output due to a TypeScript bug.\n\t\t// See: https://github.com/microsoft/TypeScript/issues/58688.\n\t\t// Instead we extract and inline the typing of the \"props\" field here, which seems to sufficiently work around the issue.\n\t\t// type ColumnInsertableType = InsertableObjectFromSchemaRecord<typeof columnFields>;\n\t\ttype ColumnInsertableType = InsertableObjectFromSchemaRecord<\n\t\t\ttypeof columnFieldsBuiltInParts\n\t\t> &\n\t\t\t(FieldHasDefault<TPropsSchema> extends true\n\t\t\t\t? // Note: The docs on the below properties are copied from `IColumn.props`' docs to ensure that the\n\t\t\t\t\t// documentation appears in the data insertion scenario.\n\t\t\t\t\t// The contents are duplicated instead of using `@inheritdoc`, as intellisense does not correctly\n\t\t\t\t\t// support `@inheritDoc`.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/31267\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The column's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops?: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The column's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t});\n\n\t\t// Modified version of `Column` that ensures the constructor (and `createFromInsertable`) are\n\t\t// typed correctly in terms of our insertable type.\n\t\t// This lets us be selective in our type-cast for the value returned from this function,\n\t\t// preserving as much type-safety as we reasonably can.\n\t\ttype ColumnSchemaModifiedType = Omit<\n\t\t\t// Use mapped type to omit the constructor\n\t\t\t{\n\t\t\t\t[Property in keyof typeof Column]: (typeof Column)[Property];\n\t\t\t},\n\t\t\t\"createFromInsertable\"\n\t\t> &\n\t\t\t(new (\n\t\t\t\tparameters: InternalTreeNode | ColumnInsertableType,\n\t\t\t) => Column) & {\n\t\t\t\tcreateFromInsertable(parameters: ColumnInsertableType): Column;\n\t\t\t};\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst ColumnSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Column\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ ColumnValueType,\n\t\t\t/* TInsertable */ object & ColumnInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof columnFields\n\t\t> = Column as ColumnSchemaModifiedType;\n\n\t\treturn ColumnSchemaType;\n\t}\n\n\t/**\n\t * Base column schema type.\n\t * @sealed @system @alpha\n\t */\n\texport type ColumnSchemaBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> = ReturnType<typeof createColumnSchema<TScope, TCellSchema, TPropsSchema>>;\n\n\t// #endregion\n\n\t// #region Row\n\n\t/**\n\t * Base options for creating table row schema.\n\t * @remarks Includes parameters common to all row factory overloads.\n\t * @system @alpha\n\t */\n\texport type CreateRowOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryBeta = SchemaFactoryBeta,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating row schema.\n\t * @sealed @alpha\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createRowSchema<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TPropsSchema extends ImplicitFieldSchema,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryBeta<TInputScope>,\n\t\tcellSchema: TCellSchema,\n\t\tpropsSchema: TPropsSchema,\n\t) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\t// Note: `rowFields` is broken into two parts to work around a TypeScript bug\n\t\t// that results in broken `.d.ts` output.\n\t\t// See definition of `RowInsertableType` below.\n\t\tconst rowFieldsBuiltInParts = {\n\t\t\tid: schemaFactory.identifier,\n\t\t\t/**\n\t\t\t * The cells of the table row, keyed by column ID.\n\t\t\t * @remarks\n\t\t\t * The table row models its cells as a record, where each key is the ID of the column it belongs to. The choice of record (as opposed to a map) is intended to make interop with common table rendering libraries in TypeScript/JavaScript easier.\n\t\t\t */\n\t\t\tcells: schemaFactory.required(schemaFactory.record(\"Row.cells\", cellSchema), {\n\t\t\t\tmetadata: {\n\t\t\t\t\tdescription: \"The cells of the table row, keyed by column ID.\",\n\t\t\t\t},\n\t\t\t}),\n\t\t} as const;\n\t\tconst rowFieldsPropsPart = {\n\t\t\tprops: propsSchema,\n\t\t} as const;\n\n\t\t/**\n\t\t * {@link RowSchema} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t * Note: ideally we would add a satisfies clause here to ensure that this satisfies\n\t\t * `Record<string, ImplicitFieldSchema>`, but doing so causes TypeScript to prematurely and incorrectly evaluate the type of `propsSchema`.\n\t\t * Likely related to the following issue: https://github.com/microsoft/TypeScript/issues/52394\n\t\t */\n\t\tconst rowFields = {\n\t\t\t...rowFieldsBuiltInParts,\n\t\t\t...rowFieldsPropsPart,\n\t\t} as const; // satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * The Row schema - this is a map of Cells where the key is the column id\n\t\t */\n\t\tclass RowSchema\n\t\t\textends schemaFactory.object(\"Row\", rowFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements RowPrivate<TCellSchema, TPropsSchema> {}\n\n\t\ttype RowValueType = TreeNode &\n\t\t\tTableSchema.Row<TCellSchema, TPropsSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Row\">>;\n\n\t\t// Note: ideally this type would just leverage `InsertableObjectFromSchemaRecord<typeof rowFields>`,\n\t\t// but that results in broken `.d.ts` output due to a TypeScript bug.\n\t\t// See: https://github.com/microsoft/TypeScript/issues/58688.\n\t\t// Instead we extract and inline the typing of the \"props\" field here, which seems to sufficiently work around\n\t\t// the issue.\n\t\t// type RowInsertableType = InsertableObjectFromSchemaRecord<typeof rowFields>;\n\t\ttype RowInsertableType = InsertableObjectFromSchemaRecord<typeof rowFieldsBuiltInParts> &\n\t\t\t(FieldHasDefault<TPropsSchema> extends true\n\t\t\t\t? // Note: The docs on the below properties are copied from `IRow.props`' docs to ensure that the\n\t\t\t\t\t// documentation appears in the data insertion scenario.\n\t\t\t\t\t// The contents are duplicated instead of using `@inheritdoc`, as intellisense does not correctly\n\t\t\t\t\t// support `@inheritDoc`.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/31267\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The row's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information\n\t\t\t\t\t\t * about the row.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops?: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The row's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information\n\t\t\t\t\t\t * about the row.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t});\n\n\t\t// Modified version of `Row` that ensures the constructor (and `createFromInsertable`) are\n\t\t// typed correctly in terms of our insertable type.\n\t\t// This lets us be selective in our type-cast for the value returned from this function,\n\t\t// preserving as much type-safety as we reasonably can.\n\t\ttype RowSchemaModifiedType = Omit<\n\t\t\t// Use mapped type to omit the constructor\n\t\t\t{\n\t\t\t\t[Property in keyof typeof RowSchema]: (typeof RowSchema)[Property];\n\t\t\t},\n\t\t\t\"createFromInsertable\"\n\t\t> &\n\t\t\t(new (\n\t\t\t\tparameters: InternalTreeNode | RowInsertableType,\n\t\t\t) => RowSchema) & {\n\t\t\t\tcreateFromInsertable(parameters: RowInsertableType): RowSchema;\n\t\t\t};\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst RowSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Row\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ RowValueType,\n\t\t\t/* TInsertable */ object & RowInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof rowFields\n\t\t> = RowSchema as RowSchemaModifiedType;\n\n\t\treturn RowSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @alpha\n\t */\n\texport type RowSchemaBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> = ReturnType<typeof createRowSchema<TScope, TCellSchema, TPropsSchema>>;\n\n\t// #endregion\n\n\t// #region Table\n\n\t/**\n\t * Base options for creating table schema.\n\t * @remarks Includes parameters common to all table factory overloads.\n\t * @system @alpha\n\t */\n\texport type TableFactoryOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryBeta = SchemaFactoryBeta,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating table schema.\n\t * @system @alpha\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createTableSchema<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TColumnSchema extends ColumnSchemaBase<TInputScope, TCellSchema>,\n\t\tconst TRowSchema extends RowSchemaBase<TInputScope, TCellSchema>,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryBeta<TInputScope>,\n\t\t_cellSchema: TCellSchema,\n\t\tcolumnSchema: TColumnSchema,\n\t\trowSchema: TRowSchema,\n\t) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\ttype CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\t\ttype ColumnValueType = TreeNodeFromImplicitAllowedTypes<TColumnSchema>;\n\t\ttype RowValueType = TreeNodeFromImplicitAllowedTypes<TRowSchema>;\n\n\t\t// Internal version of RowValueType that exposes the `cells` property for use within Table methods.\n\t\ttype RowValueInternalType = RowValueType & RowPrivate<TCellSchema>;\n\n\t\t/**\n\t\t * {@link Table} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t */\n\t\tconst tableFields = {\n\t\t\trows: schemaFactory.array(\"Table.rows\", rowSchema),\n\t\t\tcolumns: schemaFactory.array(\"Table.columns\", columnSchema),\n\t\t} as const satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * The Table schema\n\t\t */\n\t\tclass Table\n\t\t\textends schemaFactory.object(\"Table\", tableFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements TableSchema.Table<TInputScope, TCellSchema, TColumnSchema, TRowSchema>\n\t\t{\n\t\t\tpublic static empty<TThis extends TableConstructorType>(\n\t\t\t\tthis: TThis,\n\t\t\t): InstanceType<TThis> {\n\t\t\t\treturn new this({ columns: [], rows: [] }) as InstanceType<TThis>;\n\t\t\t}\n\n\t\t\tpublic getColumn(indexOrId: number | string): ColumnValueType | undefined {\n\t\t\t\treturn this.#tryGetColumn(indexOrId);\n\t\t\t}\n\n\t\t\tpublic getRow(indexOrId: number | string): RowValueType | undefined {\n\t\t\t\treturn this.#tryGetRow(indexOrId);\n\t\t\t}\n\n\t\t\tpublic getCell(\n\t\t\t\tkey: TableSchema.CellKey<TColumnSchema, TRowSchema>,\n\t\t\t): CellValueType | undefined {\n\t\t\t\tconst { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;\n\t\t\t\tconst row = this.#tryGetRow(rowOrIdOrIndex);\n\t\t\t\tif (row === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst column = this.#tryGetColumn(columnOrIdOrIndex);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn (row as RowValueInternalType).cells[column.id];\n\t\t\t}\n\n\t\t\tpublic insertColumns({\n\t\t\t\tcolumns,\n\t\t\t\tindex,\n\t\t\t}: TableSchema.InsertColumnsParameters<TColumnSchema>): ColumnValueType[] {\n\t\t\t\t// TypeScript is unable to narrow the column type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);\n\t\t\t\t} else {\n\t\t\t\t\t// Ensure specified index is valid\n\t\t\t\t\tvalidateIndex(index, this.columns, \"Table.insertColumns\", true);\n\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.columns.insertAt(index, TreeArrayNode.spread(columns) as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input nodes into the tree hydrates them, making them usable as nodes.\n\t\t\t\treturn columns as unknown as ColumnValueType[];\n\t\t\t}\n\n\t\t\tpublic insertRows({\n\t\t\t\tindex,\n\t\t\t\trows,\n\t\t\t}: TableSchema.InsertRowsParameters<TRowSchema>): RowValueType[] {\n\t\t\t\t// #region Input validation\n\n\t\t\t\t// Ensure specified index is valid\n\t\t\t\tif (index !== undefined) {\n\t\t\t\t\tvalidateIndex(index, this.rows, \"Table.insertRows\", true);\n\t\t\t\t}\n\n\t\t\t\t// Note: TypeScript is unable to narrow the type of the row type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tfor (const newRow of rows) {\n\t\t\t\t\t// If the row contains cells, verify that the table contains the columns for those cells.\n\t\t\t\t\t// Note: we intentionally hide `cells` on `IRow` to avoid leaking the internal data representation as much as possible, so we have to cast here.\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tif ((newRow as any).cells !== undefined) {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\tconst keys: string[] = Object.keys((newRow as any).cells);\n\t\t\t\t\t\tfor (const key of keys) {\n\t\t\t\t\t\t\tif (!this.#containsColumnWithId(key)) {\n\t\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\t`Attempted to insert row a cell under column ID \"${key}\", but the table does not contain a column with that ID.`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// #endregion\n\n\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.rows.insertAtEnd(TreeArrayNode.spread(rows) as any);\n\t\t\t\t} else {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.rows.insertAt(index, TreeArrayNode.spread(rows) as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input nodes into the tree hydrates them, making them usable as nodes.\n\t\t\t\treturn rows as unknown as RowValueType[];\n\t\t\t}\n\n\t\t\tpublic setCell({\n\t\t\t\tkey,\n\t\t\t\tcell,\n\t\t\t}: TableSchema.SetCellParameters<TCellSchema, TColumnSchema, TRowSchema>): void {\n\t\t\t\tconst { column: columnOrId, row: rowOrId } = key;\n\n\t\t\t\tconst row = this.#getRow(rowOrId);\n\t\t\t\tconst column = this.#getColumn(columnOrId);\n\n\t\t\t\t(row as RowValueInternalType).cells[column.id] = cell as CellValueType;\n\t\t\t}\n\n\t\t\tpublic removeColumns(\n\t\t\t\tindexOrColumns: number | undefined | readonly string[] | readonly ColumnValueType[],\n\t\t\t\tcount: number | undefined = undefined,\n\t\t\t): ColumnValueType[] {\n\t\t\t\tif (typeof indexOrColumns === \"number\" || indexOrColumns === undefined) {\n\t\t\t\t\tlet removedColumns: ColumnValueType[] | undefined;\n\t\t\t\t\tconst startIndex = indexOrColumns ?? 0;\n\t\t\t\t\tconst endIndex = count === undefined ? this.columns.length : startIndex + count;\n\n\t\t\t\t\t// If there are no columns to remove, do nothing\n\t\t\t\t\tif (startIndex === endIndex) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\tvalidateIndexRange(startIndex, endIndex, this.columns, \"Table.removeColumns\");\n\n\t\t\t\t\tthis.#applyEditsInBatch(() => {\n\t\t\t\t\t\tconst columnsToRemove = this.columns.slice(\n\t\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\t\tendIndex,\n\t\t\t\t\t\t) as ColumnValueType[];\n\n\t\t\t\t\t\t// First, remove all cells that correspond to each column from each row:\n\t\t\t\t\t\tfor (const column of columnsToRemove) {\n\t\t\t\t\t\t\tthis.#removeCells(column);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Second, remove the column nodes:\n\t\t\t\t\t\tremoveRangeFromArray(startIndex, endIndex, this.columns, \"Table.removeColumns\");\n\t\t\t\t\t\tremovedColumns = columnsToRemove;\n\t\t\t\t\t});\n\t\t\t\t\treturn removedColumns ?? fail(0xc1f /* Transaction did not complete. */);\n\t\t\t\t} else {\n\t\t\t\t\t// If there are no columns to remove, do nothing\n\t\t\t\t\tif (indexOrColumns.length === 0) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Resolve any IDs to actual nodes.\n\t\t\t\t\t// This validates that all of the rows exist before starting transaction.\n\t\t\t\t\t// This improves user-facing error experience.\n\t\t\t\t\tconst columnsToRemove: ColumnValueType[] = [];\n\t\t\t\t\tfor (const columnOrIdToRemove of indexOrColumns) {\n\t\t\t\t\t\tcolumnsToRemove.push(this.#getColumn(columnOrIdToRemove));\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.#applyEditsInBatch(() => {\n\t\t\t\t\t\t// Note, throwing an error within a transaction will abort the entire transaction.\n\t\t\t\t\t\t// So if we throw an error here for any column, no columns will be removed.\n\t\t\t\t\t\tfor (const columnToRemove of columnsToRemove) {\n\t\t\t\t\t\t\t// Remove the corresponding cell from all rows.\n\t\t\t\t\t\t\tfor (const row of this.rows) {\n\t\t\t\t\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the cast.\n\t\t\t\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\t\t\t\tthis.removeCell({\n\t\t\t\t\t\t\t\t\tcolumn: columnToRemove,\n\t\t\t\t\t\t\t\t\trow: row as RowValueType,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// We have already validated that all of the columns exist above, so this is safe.\n\t\t\t\t\t\t\tthis.columns.removeAt(this.columns.indexOf(columnToRemove));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn columnsToRemove;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic removeRows(\n\t\t\t\tindexOrRows: number | undefined | readonly string[] | readonly RowValueType[],\n\t\t\t\tcount?: number | undefined,\n\t\t\t): RowValueType[] {\n\t\t\t\tif (typeof indexOrRows === \"number\" || indexOrRows === undefined) {\n\t\t\t\t\tconst startIndex = indexOrRows ?? 0;\n\t\t\t\t\tconst endIndex = count === undefined ? this.columns.length : startIndex + count;\n\n\t\t\t\t\t// If there are no rows to remove, do nothing\n\t\t\t\t\tif (startIndex === endIndex) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn removeRangeFromArray(startIndex, endIndex, this.rows, \"Table.removeRows\");\n\t\t\t\t}\n\n\t\t\t\t// If there are no rows to remove, do nothing\n\t\t\t\tif (indexOrRows.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\t// Resolve any IDs to actual nodes.\n\t\t\t\t// This validates that all of the rows exist before starting transaction.\n\t\t\t\t// This improves user-facing error experience.\n\t\t\t\tconst rowsToRemove: RowValueType[] = [];\n\t\t\t\tfor (const rowToRemove of indexOrRows) {\n\t\t\t\t\trowsToRemove.push(this.#getRow(rowToRemove));\n\t\t\t\t}\n\n\t\t\t\tthis.#applyEditsInBatch(() => {\n\t\t\t\t\t// Note, throwing an error within a transaction will abort the entire transaction.\n\t\t\t\t\t// So if we throw an error here for any row, no rows will be removed.\n\t\t\t\t\tfor (const rowToRemove of rowsToRemove) {\n\t\t\t\t\t\t// We have already validated that all of the rows exist above, so this is safe.\n\t\t\t\t\t\tconst index = this.rows.indexOf(rowToRemove);\n\t\t\t\t\t\tthis.rows.removeAt(index);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn rowsToRemove;\n\t\t\t}\n\n\t\t\tpublic removeCell(\n\t\t\t\tkey: TableSchema.CellKey<TColumnSchema, TRowSchema>,\n\t\t\t): CellValueType | undefined {\n\t\t\t\tconst { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;\n\t\t\t\tconst row = this.#getRow(rowOrIdOrIndex) as RowValueInternalType;\n\t\t\t\tconst column = this.#getColumn(columnOrIdOrIndex);\n\n\t\t\t\tconst cell: CellValueType | undefined = row.cells[column.id];\n\t\t\t\tif (cell === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\t\t\tdelete row.cells[column.id];\n\t\t\t\treturn cell;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Removes the cell corresponding with the specified column from each row in the table.\n\t\t\t */\n\t\t\t#removeCells(column: ColumnValueType): void {\n\t\t\t\tfor (const row of this.rows) {\n\t\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\tthis.removeCell({\n\t\t\t\t\t\tcolumn,\n\t\t\t\t\t\trow: row as RowValueType,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Applies the provided edits in a \"batch\".\n\t\t\t *\n\t\t\t * @remarks\n\t\t\t * For hydrated trees, this will be done in a transaction to ensure atomicity.\n\t\t\t *\n\t\t\t * Transactions are not supported for unhydrated trees, so we cannot run a transaction in that case.\n\t\t\t * But since there are no collaborators, this is not an issue.\n\t\t\t */\n\t\t\t#applyEditsInBatch(applyEdits: () => void): void {\n\t\t\t\tconst branch = TreeAlpha.branch(this);\n\n\t\t\t\t// Ensure events are paused until all of the edits are applied.\n\t\t\t\t// This ensures that the user sees the corresponding table-level edit as atomic,\n\t\t\t\t// and ensures they are not spammed with intermediate events.\n\t\t\t\twithBufferedTreeEvents(() => {\n\t\t\t\t\tif (branch === undefined) {\n\t\t\t\t\t\t// If this node does not have a corresponding branch, then it is unhydrated.\n\t\t\t\t\t\t// I.e., it is not part of a collaborative session yet.\n\t\t\t\t\t\t// Therefore, we don't need to run the edits as a transaction.\n\t\t\t\t\t\tapplyEdits();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbranch.runTransaction(() => {\n\t\t\t\t\t\t\tapplyEdits();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Column node or ID to a Column node in the table.\n\t\t\t * Returns `undefined` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\t#tryGetColumn(\n\t\t\t\tcolumnOrIdOrIndex: ColumnValueType | string | number,\n\t\t\t): ColumnValueType | undefined {\n\t\t\t\tif (typeof columnOrIdOrIndex === \"number\") {\n\t\t\t\t\tif (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.columns.length) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.columns[columnOrIdOrIndex] as ColumnValueType;\n\t\t\t\t}\n\n\t\t\t\tif (typeof columnOrIdOrIndex === \"string\") {\n\t\t\t\t\tconst columnId = columnOrIdOrIndex;\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.columns.find((col) => (col as ColumnValueType).id === columnId) as\n\t\t\t\t\t\t| ColumnValueType\n\t\t\t\t\t\t| undefined;\n\t\t\t\t}\n\n\t\t\t\t// If the user provided a node, ensure it actually exists in this table.\n\t\t\t\tif (!this.columns.includes(columnOrIdOrIndex)) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn columnOrIdOrIndex;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Column node or ID to a Column node in the table.\n\t\t\t * @throws Throws a `UsageError` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\t#getColumn(columnOrIdOrIndex: ColumnValueType | string | number): ColumnValueType {\n\t\t\t\tconst column = this.#tryGetColumn(columnOrIdOrIndex);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\tTable._throwMissingColumnError(columnOrIdOrIndex);\n\t\t\t\t}\n\t\t\t\treturn column;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Checks if a Column with the specified ID exists in the table.\n\t\t\t */\n\t\t\t#containsColumnWithId(columnId: string): boolean {\n\t\t\t\treturn this.#tryGetColumn(columnId) !== undefined;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Throw a `UsageError` for a missing Column by its ID or index.\n\t\t\t */\n\t\t\tprivate static _throwMissingColumnError(\n\t\t\t\tcolumnOrIdOrIndex: ColumnValueType | string | number,\n\t\t\t): never {\n\t\t\t\tif (typeof columnOrIdOrIndex === \"number\") {\n\t\t\t\t\tthrow new UsageError(`No column exists at index ${columnOrIdOrIndex}.`);\n\t\t\t\t}\n\n\t\t\t\tif (typeof columnOrIdOrIndex === \"string\") {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`No column with ID \"${columnOrIdOrIndex}\" exists in the table.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`The specified column node with ID \"${columnOrIdOrIndex.id}\" does not exist in the table.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Row node or ID to a Row node in the table.\n\t\t\t * Returns `undefined` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\t#tryGetRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType | undefined {\n\t\t\t\tif (typeof rowOrIdOrIndex === \"number\") {\n\t\t\t\t\tif (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.rows.length) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.rows[rowOrIdOrIndex] as RowValueType;\n\t\t\t\t}\n\n\t\t\t\tif (typeof rowOrIdOrIndex === \"string\") {\n\t\t\t\t\tconst rowId = rowOrIdOrIndex;\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.rows.find((row) => (row as RowValueType).id === rowId) as\n\t\t\t\t\t\t| RowValueType\n\t\t\t\t\t\t| undefined;\n\t\t\t\t}\n\n\t\t\t\t// If the user provided a node, ensure it actually exists in this table.\n\t\t\t\tif (!this.rows.includes(rowOrIdOrIndex)) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn rowOrIdOrIndex;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Row node, ID, or index to a Row node in the table.\n\t\t\t * @throws Throws a `UsageError` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\t#getRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType {\n\t\t\t\tconst row = this.#tryGetRow(rowOrIdOrIndex);\n\t\t\t\tif (row === undefined) {\n\t\t\t\t\tTable._throwMissingRowError(rowOrIdOrIndex);\n\t\t\t\t}\n\t\t\t\treturn row;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Throw a `UsageError` for a missing Row by its ID or index.\n\t\t\t */\n\t\t\tprivate static _throwMissingRowError(\n\t\t\t\trowOrIdOrIndex: RowValueType | string | number,\n\t\t\t): never {\n\t\t\t\tif (typeof rowOrIdOrIndex === \"number\") {\n\t\t\t\t\tthrow new UsageError(`No row exists at index ${rowOrIdOrIndex}.`);\n\t\t\t\t}\n\n\t\t\t\tif (typeof rowOrIdOrIndex === \"string\") {\n\t\t\t\t\tthrow new UsageError(`No row with ID \"${rowOrIdOrIndex}\" exists in the table.`);\n\t\t\t\t}\n\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`The specified row node with ID \"${rowOrIdOrIndex.id}\" does not exist in the table.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Set a private symbol on the schema class that marks it as having been generated by this factory.\n\t\t// Column / Row functionality use this to validate that they are being used in a table.\n\t\t// This is effectively a work-around that allows columns and rows to invoke table methods\n\t\t// without having to pass the table as a parameter to their construction, which isn't possible.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t(Table as any)[tableSchemaSymbol] = true;\n\n\t\ttype TableValueType = TreeNode &\n\t\t\tTableSchema.Table<TInputScope, TCellSchema, TColumnSchema, TRowSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Table\">>;\n\t\ttype TableInsertableType = InsertableObjectFromSchemaRecord<typeof tableFields>;\n\t\ttype TableConstructorType = new (data: TableInsertableType) => TableValueType;\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst TableSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Table\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ TableValueType,\n\t\t\t/* TInsertable */ object & TableInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof tableFields\n\t\t> & {\n\t\t\t/**\n\t\t\t * Create an empty table.\n\t\t\t */\n\t\t\tempty<TThis extends TableConstructorType>(this: TThis): InstanceType<TThis>;\n\t\t} = Table;\n\n\t\t// Return the table schema\n\t\treturn TableSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @alpha\n\t */\n\texport type TableSchemaBase<\n\t\tTScope extends string | undefined,\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ColumnSchemaBase<TScope, TCell>,\n\t\tTRow extends RowSchemaBase<TScope, TCell>,\n\t> = ReturnType<typeof createTableSchema<TScope, TCell, TColumn, TRow>>;\n\n\t// #endregion\n}\n\n/**\n * Removes the specified range of elements from the array.\n * @returns The removed elements.\n */\nfunction removeRangeFromArray<TNodeSchema extends ImplicitAllowedTypes>(\n\tstartIndex: number,\n\tendIndex: number,\n\tarray: TreeArrayNode<TNodeSchema>,\n\tmethodName: string,\n): TreeNodeFromImplicitAllowedTypes<TNodeSchema>[] {\n\tvalidateIndexRange(startIndex, endIndex, array, methodName);\n\n\t// TypeScript is unable to narrow the array element type correctly here, hence the cast.\n\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\tconst removedRows = array.slice(\n\t\tstartIndex,\n\t\tendIndex,\n\t) as TreeNodeFromImplicitAllowedTypes<TNodeSchema>[];\n\tarray.removeRange(startIndex, endIndex);\n\n\treturn removedRows;\n}\n\n/**\n * Contains types and factories for creating schema to represent dynamic tabular data.\n *\n * @remarks\n *\n * WARNING: These APIs are in preview and are subject to change.\n * Until these APIs have stabilized, it is not recommended to use them in production code.\n * There may be breaking changes to these APIs and their underlying data format.\n * Using these APIs in production code may result in data loss or corruption.\n *\n * The primary APIs for create tabular data schema are:\n *\n * - {@link TableSchema.(table:1)}\n *\n * - {@link TableSchema.(column:1)}\n *\n * - {@link TableSchema.(row:1)}\n *\n * Tables created using these APIs are...\n *\n * - sparse, meaning that cells may be omitted, and new rows are empty by default.\n *\n * - dynamic, meaning that their structure can be modified at runtime.\n * Columns and rows can be inserted, removed, modified, and reordered.\n * Cells can be inserted, removed, and modified.\n *\n * - row-major, meaning that operating on rows (including inserts, removal, moves, and traversal) is more efficient than operating on columns.\n *\n * Column and Row schema created using these APIs are extensible via the `props` field.\n * This allows association of additional properties with column and row nodes.\n *\n * Cells in the table may become \"orphaned.\"\n * That is, it is possible to enter a state where one or more rows contain cells with no corresponding column.\n * To reduce the likelihood of this, you can manually remove corresponding cells when removing columns.\n * Either way, it is possible to enter such a state via the merging of edits.\n * For example: one client might add a row while another concurrently removes a column, orphaning the cell where the column and row intersected.\n *\n * @example Defining a Table schema\n *\n * ```typescript\n * class MyTable extends TableSchema.table({\n * \tschemaFactory,\n * \tcell: schemaFactory.string,\n * }) {}\n *\n * const table = new MyTable({\n * \tcolumns: [{ id: \"column-0\" }],\n * \trows: [{ id: \"row-0\", cells: { \"column-0\": \"Hello world!\" } }],\n * });\n * ```\n *\n * @example Customizing Column and Row schema\n *\n * ```typescript\n * const Cell = schemaFactory.string;\n *\n * class MyColumn extends TableSchema.column({\n * \tschemaFactory,\n * \tcell: Cell,\n * \tprops: schemaFactory.object(\"TableColumnProps\", {\n * \t\tlabel: schemaFactory.string,\n * \t}),\n * }) {}\n *\n * class MyRow extends TableSchema.row({\n * \tschemaFactory,\n * \tcell: Cell,\n * }) {}\n *\n * class MyTable extends TableSchema.table({\n * \tschemaFactory,\n * \tcell: Cell,\n * \tcolumn: MyColumn,\n * \trow: MyRow,\n * }) {}\n *\n * const table = new MyTable({\n * \tcolumns: [\n * \t\tnew MyColumn({ props: { label: \"Entry\" } }),\n * \t\tnew MyColumn({ props: { label: \"Date\" } }),\n * \t\tnew MyColumn({ props: { label: \"Amount\" } }),\n * \t],\n * \trows: [],\n * });\n * ```\n *\n * @example Listening for changes in the table\n *\n * ```typescript\n * // Listen for any changes to the table and its children.\n * // The \"treeChanged\" event will fire when the associated node or any of its descendants change.\n * Tree.on(table, \"treeChanged\", () => {\n * \t// Respond to the change.\n * });\n * ```\n *\n * @example Listening for changes to the rows list only\n *\n * ```typescript\n * // Listen for any changes to the list of rows.\n * // The \"nodeChanged\" event will fire only when the specified node itself changes (i.e., its own properties change).\n * // In this case, the event will fire when a row is added or removed, or the order of the list is changed.\n * // But it won't fire when a row's properties change, or when the row's cells change, etc.\n * Tree.on(table.rows, \"nodeChanged\", () => {\n * \t// Respond to the change.\n * });\n * ```\n *\n * @privateRemarks\n * The above examples are backed by tests in `tableSchema.spec.ts`.\n * Those tests and these examples should be kept in-sync to ensure that the examples are correct.\n *\n * @alpha\n */\nexport namespace TableSchema {\n\t// #region Column\n\n\t/**\n\t * A column in a table.\n\t * @remarks Implemented by the schema class returned from {@link TableSchema.(column:2)}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the column.\n\t * @sealed @alpha\n\t */\n\texport interface Column<\n\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Reserving this for future use.\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTProps extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> {\n\t\t/**\n\t\t * The unique identifier of the column.\n\t\t * @remarks Uniquely identifies the node within the entire tree, not just the table.\n\t\t */\n\t\treadonly id: string;\n\n\t\t/**\n\t\t * The column's properties.\n\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t * @privateRemarks\n\t\t * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createColumnSchema}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<TProps>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<TProps>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @alpha\n\t */\n\texport function column<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tparams: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryBeta<TScope>, TCell>,\n\t): System_TableSchema.ColumnSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>;\n\t/**\n\t * Factory for creating new table column schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the column.\n\t * @alpha\n\t */\n\texport function column<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TProps extends ImplicitFieldSchema,\n\t>(\n\t\tparams: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\t/**\n\t\t\t * Optional column properties.\n\t\t\t */\n\t\t\treadonly props: TProps;\n\t\t},\n\t): System_TableSchema.ColumnSchemaBase<TScope, TCell, TProps>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function column({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops = SchemaFactory.optional(SchemaFactory.null),\n\t}: System_TableSchema.CreateColumnOptionsBase & {\n\t\treadonly props?: ImplicitFieldSchema;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createColumnSchema(schemaFactory, props);\n\t}\n\n\t// #endregion\n\n\t// #region Row\n\n\t/**\n\t * A row in a table.\n\t * @remarks Implemented by the schema class returned from {@link TableSchema.(row:2)}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the row.\n\t * @sealed @alpha\n\t */\n\texport interface Row<\n\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Reserving this for future use.\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTProps extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> {\n\t\t/**\n\t\t * The unique identifier of the row.\n\t\t * @remarks Uniquely identifies the node within the entire tree, not just the table.\n\t\t */\n\t\treadonly id: string;\n\n\t\t/**\n\t\t * The row's properties.\n\t\t * @remarks This is a user-defined schema that can be used to store additional information about the row.\n\t\t * @privateRemarks\n\t\t * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createRowSchema}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<TProps>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<TProps>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @alpha\n\t */\n\texport function row<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tparams: System_TableSchema.CreateRowOptionsBase<SchemaFactoryBeta<TScope>, TCell>,\n\t): System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>;\n\t/**\n\t * Factory for creating new table row schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the row.\n\t * @alpha\n\t */\n\texport function row<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TProps extends ImplicitFieldSchema,\n\t>(\n\t\tparams: System_TableSchema.CreateRowOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\t/**\n\t\t\t * Optional row properties.\n\t\t\t */\n\t\t\treadonly props: TProps;\n\t\t},\n\t): System_TableSchema.RowSchemaBase<TScope, TCell, TProps>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function row({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops = SchemaFactory.optional(SchemaFactory.null),\n\t}: System_TableSchema.CreateRowOptionsBase & {\n\t\treadonly props?: ImplicitFieldSchema;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createRowSchema(schemaFactory, cell, props);\n\t}\n\n\t// #endregion\n\n\t// #region Table\n\n\t/**\n\t * A key to uniquely identify a cell within a table.\n\t * @alpha\n\t */\n\texport interface CellKey<\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * {@link TableSchema.Column}, {@link TableSchema.Column.id}, or column index at which the cell is located.\n\t\t */\n\t\treadonly column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>;\n\n\t\t/**\n\t\t * {@link TableSchema.Row}, {@link TableSchema.Row.id}, or row index at which the cell is located.\n\t\t */\n\t\treadonly row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>;\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertColumns} parameters.\n\t * @alpha\n\t */\n\texport interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new columns.\n\t\t * @remarks If not provided, the columns will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The columns to insert.\n\t\t */\n\t\treadonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertRows} parameters.\n\t * @alpha\n\t */\n\texport interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new rows.\n\t\t * @remarks If not provided, the rows will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The rows to insert.\n\t\t */\n\t\treadonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.setCell} parameters.\n\t * @alpha\n\t */\n\texport interface SetCellParameters<\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * The key to uniquely identify a cell in a table.\n\t\t */\n\t\treadonly key: CellKey<TColumn, TRow>;\n\n\t\t/**\n\t\t * The cell to set.\n\t\t */\n\t\treadonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;\n\t}\n\n\t/**\n\t * A table.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TColumn - The type of the columns in the table.\n\t * @typeParam TRow - The type of the rows in the table.\n\t * @sealed @alpha\n\t */\n\texport interface Table<\n\t\tTScope extends string | undefined,\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>,\n\t\tTRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,\n\t> {\n\t\t/**\n\t\t * The table's columns.\n\t\t */\n\t\treadonly columns: TreeArrayNode<TColumn>;\n\n\t\t/**\n\t\t * The table's rows.\n\t\t */\n\t\treadonly rows: TreeArrayNode<TRow>;\n\n\t\t/**\n\t\t * Gets a table column by its {@link TableSchema.Column.id}.\n\t\t * @returns The column, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;\n\t\t/**\n\t\t * Gets a table column by its index in the table.\n\t\t * @returns The column, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetColumn(index: number): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;\n\n\t\t/**\n\t\t * Gets a table row by its {@link TableSchema.Row.id}.\n\t\t * @returns The row, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;\n\t\t/**\n\t\t * Gets a table row by its index in the table.\n\t\t * @returns The row, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;\n\n\t\t/**\n\t\t * Gets a cell in the table by corresponding column and row.\n\t\t * @param key - A key that uniquely distinguishes a cell in the table, represented as a combination of the column ID and row ID.\n\t\t * @returns The cell, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * Inserts 0 or more columns into the table.\n\t\t *\n\t\t * @throws Throws an error if the specified index is out of range.\n\t\t *\n\t\t * No columns are inserted in this case.\n\t\t */\n\t\tinsertColumns(\n\t\t\tparams: InsertColumnsParameters<TColumn>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\n\t\t/**\n\t\t * Inserts 0 or more rows into the table.\n\t\t *\n\t\t * @throws\n\t\t * Throws an error in the following cases:\n\t\t *\n\t\t * - The row contains cells, but the table does not contain matching columns for one or more of those cells.\n\t\t *\n\t\t * - The specified index is out of range.\n\t\t *\n\t\t * No rows are inserted in these cases.\n\t\t */\n\t\tinsertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\n\t\t/**\n\t\t * Sets the cell at the specified location in the table.\n\t\t * @remarks To remove a cell, call {@link TableSchema.Table.removeCell} instead.\n\t\t */\n\t\tsetCell(params: SetCellParameters<TCell, TColumn, TRow>): void;\n\n\t\t/**\n\t\t * Removes a range of columns from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Also removes any corresponding cells from the table's rows.\n\t\t *\n\t\t * Note: this operation can be slow for tables with many rows.\n\t\t * We are actively working on improving the performance of this operation, but for now it may have a negative\n\t\t * impact on performance.\n\t\t * @param index - The starting index of the range to remove. Default: `0`.\n\t\t * @param count - The number of columns to remove. Default: all remaining columns starting from `index`.\n\t\t * @throws Throws an error if the specified range is invalid. In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(\n\t\t\tindex?: number | undefined,\n\t\t\tcount?: number | undefined,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t\t/**\n\t\t * Removes 0 or more columns from the table.\n\t\t * @remarks\n\t\t * Also removes any corresponding cells from the table's rows.\n\t\t *\n\t\t * Note: this operation can be slow for tables with many rows.\n\t\t * We are actively working on improving the performance of this operation, but for now it may have a negative\n\t\t * impact on performance.\n\t\t *\n\t\t * @param columns - The columns to remove.\n\t\t * @throws Throws an error if any of the columns are not in the table.\n\t\t * In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(\n\t\t\tcolumns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[],\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t\t/**\n\t\t * Removes 0 or more columns from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Also removes any corresponding cells from the table's rows.\n\t\t *\n\t\t * Note: this operation can be slow for tables with many rows.\n\t\t * We are actively working on improving the performance of this operation, but for now it may have a negative\n\t\t * impact on performance.\n\t\t *\n\t\t * @param columns - The columns to remove, specified by their {@link TableSchema.Column.id}.\n\t\t * @throws Throws an error if any of the columns are not in the table.\n\t\t * In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(columns: readonly string[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\n\t\t/**\n\t\t * Removes a range of rows from the table.\n\t\t * @param index - The starting index of the range to remove. Default: `0`.\n\t\t * @param count - The number of rows to remove. Default: all remaining rows starting from `index`.\n\t\t * @throws Throws an error if the specified range is invalid. In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(\n\t\t\tindex?: number | undefined,\n\t\t\tcount?: number | undefined,\n\t\t): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\t\t/**\n\t\t * Removes 0 or more rows from the table.\n\t\t * @param rows - The rows to remove.\n\t\t * @throws Throws an error if any of the rows are not in the table.\n\t\t * In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(\n\t\t\trows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[],\n\t\t): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\t\t/**\n\t\t * Removes 0 or more rows from the table.\n\t\t * @param rows - The rows to remove, specified by their {@link TableSchema.Row.id}.\n\t\t * @throws Throws an error if any of the rows are not in the table.\n\t\t * In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\n\t\t/**\n\t\t * Removes the cell at the specified location in the table.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t * @throws Throws an error if the location does not exist in the table.\n\t\t */\n\t\tremoveCell(\n\t\t\tkey: CellKey<TColumn, TRow>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\t}\n\n\t/**\n\t * Factory for creating new table schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell>,\n\t): System_TableSchema.TableSchemaBase<\n\t\tTScope,\n\t\tTCell,\n\t\tSystem_TableSchema.ColumnSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>,\n\t\tSystem_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>\n\t>;\n\t/**\n\t * Factory for creating new table schema with custom column schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TColumn - The type of the columns in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\treadonly column: TColumn;\n\t\t},\n\t): System_TableSchema.TableSchemaBase<\n\t\tTScope,\n\t\tTCell,\n\t\tTColumn,\n\t\tSystem_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>\n\t>;\n\t/**\n\t * Factory for creating new table schema with custom row schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TRow - The type of the rows in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\treadonly row: TRow;\n\t\t},\n\t): System_TableSchema.TableSchemaBase<\n\t\tTScope,\n\t\tTCell,\n\t\tSystem_TableSchema.ColumnSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>,\n\t\tTRow\n\t>;\n\t/**\n\t * Factory for creating new table schema with custom column and row schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TColumn - The type of the columns in the table.\n\t * @typeParam TRow - The type of the rows in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>,\n\t\tconst TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\treadonly column: TColumn;\n\t\t\treadonly row: TRow;\n\t\t},\n\t): System_TableSchema.TableSchemaBase<TScope, TCell, TColumn, TRow>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function table({\n\t\tschemaFactory,\n\t\tcell: cellSchema,\n\t\tcolumn: columnSchema = column({\n\t\t\tschemaFactory,\n\t\t\tcell: cellSchema,\n\t\t}),\n\t\trow: rowSchema = row({\n\t\t\tschemaFactory,\n\t\t\tcell: cellSchema,\n\t\t}),\n\t}: System_TableSchema.TableFactoryOptionsBase & {\n\t\treadonly column?: System_TableSchema.ColumnSchemaBase;\n\t\treadonly row?: System_TableSchema.RowSchemaBase;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createTableSchema(\n\t\t\tschemaFactory,\n\t\t\tcellSchema,\n\t\t\tcolumnSchema,\n\t\t\trowSchema,\n\t\t);\n\t}\n\n\t// #endregion\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tableSchema.js","sourceRoot":"","sources":["../src/tableSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAMN,iBAAiB,EAEjB,aAAa,EASb,aAAa,EACb,MAAM,EAEN,sBAAsB,EAEtB,YAAY,EACZ,8BAA8B,GAG9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,4BAA4B;AAC5B,mDAAmD;AACnD,oDAAoD;AACpD,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiHG;AACH,MAAM,KAAW,WAAW,CAukB3B;AAvkBD,WAAiB,WAAW;IAC3B,iBAAiB;IA0EjB;;OAEG;IACH,SAAgB,MAAM,CAAC,EACtB,aAAa,EACb,IAAI,EACJ,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,GAGlD;QACA,OAAO,kBAAkB,CAAC,kBAAkB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IACpE,CAAC;IARe,kBAAM,SAQrB,CAAA;IA0ED;;OAEG;IACH,SAAgB,GAAG,CAAC,EACnB,aAAa,EACb,IAAI,EACJ,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,GAGlD;QACA,OAAO,kBAAkB,CAAC,eAAe,CAAC,aAAa,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC;IARe,eAAG,MAQlB,CAAA;IAiYD;;OAEG;IACH,SAAgB,KAAK,CAAC,EACrB,aAAa,EACb,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC;QAC7B,aAAa;QACb,IAAI,EAAE,UAAU;KAChB,CAAC,EACF,GAAG,EAAE,SAAS,GAAG,GAAG,CAAC;QACpB,aAAa;QACb,IAAI,EAAE,UAAU;KAChB,CAAC,GAIF;QACA,OAAO,kBAAkB,CAAC,iBAAiB,CAC1C,aAAa,EACb,UAAU,EACV,YAAY,EACZ,SAAS,CACT,CAAC;IACH,CAAC;IArBe,iBAAK,QAqBpB,CAAA;IAED,aAAa;AACd,CAAC,EAvkBgB,WAAW,KAAX,WAAW,QAukB3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { TreeAlpha } from \"./shared-tree/index.js\";\nimport {\n\ttype FieldHasDefault,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeKind,\n\tSchemaFactoryBeta,\n\ttype ScopedSchemaName,\n\tTreeArrayNode,\n\ttype TreeNode,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaClass,\n\ttype WithType,\n\ttype TreeFieldFromImplicitField,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InternalTreeNode,\n\tSchemaFactory,\n\tscoped,\n\ttype ImplicitFieldSchema,\n\twithBufferedTreeEvents,\n\ttype TreeRecordNode,\n\tobjectSchema,\n\teraseSchemaDetailsSubclassable,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports -- This makes the API report slightly cleaner.\n\tTreeNodeSchemaCore,\n} from \"./simple-tree/index.js\";\nimport { validateIndex, validateIndexRange } from \"./util/index.js\";\nimport { EmptyKey } from \"./core/index.js\";\n\n// Future improvement TODOs:\n// - Omit `cells` property from Row insertion type.\n// - Record-like type parameters / input parameters?\n// - Omit `props` properties from Row and Column schemas when not provided?\n\n// Longer-term work:\n// - Add constraint APIs to make it possible to avoid situations that could yield \"orphaned\" cells.\n\n/**\n * Scope for table schema built-in types.\n * @remarks User-provided factory scoping will be applied as `com.fluidframework.table<user-scope>`.\n */\nconst baseSchemaScope = \"com.fluidframework.table\";\n\n/**\n * A private symbol put on table schema to help identify them.\n */\nconst tableSchemaSymbol: unique symbol = Symbol(\"tableNode\");\n\n/**\n * A row in a table.\n * @typeParam TCellSchema - The type of the cells in the {@link TableSchema.Table}.\n * @typeParam TPropsSchema - Additional properties to associate with the row.\n * @privateRemarks Private counterpart to the {@link TableSchema.Row}.\n * Exposes internal properties needed for table operations (publicly exposed via {@link TableSchema.Table}).\n * @sealed\n */\nexport interface RowPrivate<\n\tTCellSchema extends ImplicitAllowedTypes,\n\tTPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n> extends TableSchema.Row<TCellSchema, TPropsSchema> {\n\t/**\n\t * The row's cells.\n\t * @remarks This is a user-defined schema that can be used to store additional information about the row.\n\t * @privateRemarks\n\t * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createRowSchema}.\n\t * If you update the docs here, please also update the inline type definitions.\n\t */\n\treadonly cells: TreeRecordNode<TCellSchema>;\n}\n\n/**\n * Not intended for use outside of this package.\n *\n * @privateRemarks\n * This namespace is a collection of internal system types relate to {@link TableSchema}.\n * This namespace should be strictly type-exported by the package.\n * All members should be tagged with `@system`.\n *\n * @system @alpha\n */\nexport namespace System_TableSchema {\n\t/**\n\t * A list of items in a table whose elements may be rearranged, but not inserted or removed.\n\t *\n\t * @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.\n\t *\n\t * Note: this can't reasonably be implemented via `Pick<ArrayNode<...>>` because we only want to include the\n\t * subset of its method overloads which do not support moving items between lists.\n\t *\n\t * @alpha @system\n\t */\n\texport type RearrangeableList<TItemSchema extends ImplicitAllowedTypes> = TreeNode &\n\t\treadonly TreeNodeFromImplicitAllowedTypes<TItemSchema>[] & {\n\t\t\t// #region Capture the subset of item rearrangement methods from `TreeArrayNode` that do not allow moving between lists.\n\n\t\t\t/** {@inheritDoc (TreeArrayNode:interface).(moveToEnd:1)} */\n\t\t\tmoveToEnd(sourceIndex: number): void;\n\t\t\t/** {@inheritDoc (TreeArrayNode:interface).(moveToStart:1)} */\n\t\t\tmoveToStart(sourceIndex: number): void;\n\t\t\t/** {@inheritDoc (TreeArrayNode:interface).(moveToIndex:1)} */\n\t\t\tmoveToIndex(sourceIndex: number, destinationIndex: number): void;\n\t\t\t/** {@inheritDoc (TreeArrayNode:interface).(moveRangeToEnd:1)} */\n\t\t\tmoveRangeToEnd(startIndex: number, endIndex: number): void;\n\t\t\t/** {@inheritDoc (TreeArrayNode:interface).(moveRangeToStart:1)} */\n\t\t\tmoveRangeToStart(startIndex: number, endIndex: number): void;\n\t\t\t/** {@inheritDoc (TreeArrayNode:interface).(moveRangeToIndex:1)} */\n\t\t\tmoveRangeToIndex(startIndex: number, endIndex: number, destinationIndex: number): void;\n\n\t\t\t// #endregion\n\t\t};\n\n\t/**\n\t * Default type used for column and row \"props\" fields.\n\t * @privateRemarks\n\t * Longer term, it would be better to simply omit \"props\" altogether by default.\n\t * For now, this ensures that the user doesn't have to specify a \"props\" entry when initializing column/row nodes\n\t * and ensures that they cannot set anything that might conflict with future evolutions of the schema.\n\t * @system @alpha\n\t */\n\texport type DefaultPropsType = ReturnType<typeof SchemaFactory.optional<[]>>;\n\n\t/**\n\t * A base interface for factory input options which include an schema factory.\n\t * @remarks This interface should not be referenced directly.\n\t * @privateRemarks This interface primarily exists to provide a single home for property documentation.\n\t * @system @alpha\n\t */\n\texport interface OptionsWithSchemaFactory<TSchemaFactory extends SchemaFactoryBeta> {\n\t\t/**\n\t\t * Schema factory with which the Column schema will be associated.\n\t\t * @remarks Can be used to associate the resulting schema with an existing {@link SchemaFactory.scope|scope}.\n\t\t * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.<Column|Row|Table>`.\n\t\t */\n\t\treadonly schemaFactory: TSchemaFactory;\n\t}\n\n\t/**\n\t * A base interface for factory input options which include the table cell schema.\n\t * @remarks This interface should not be referenced directly.\n\t * @privateRemarks This interface primarily exists to provide a single home for property documentation.\n\t * @system @alpha\n\t */\n\texport interface OptionsWithCellSchema<TCellSchema extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * Schema for the table's cells.\n\t\t */\n\t\treadonly cell: TCellSchema;\n\t}\n\n\t// #region Column\n\n\t/**\n\t * Base options for creating table column schema.\n\t * @remarks Includes parameters common to all column factory overloads.\n\t * @system @alpha\n\t */\n\texport type CreateColumnOptionsBase<\n\t\tTUserScope extends string = string,\n\t\tTSchemaFactory extends SchemaFactoryBeta<TUserScope> = SchemaFactoryBeta<TUserScope>,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCellSchema>;\n\n\t/**\n\t * Factory for creating column schema.\n\t * @system @alpha\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createColumnSchema<\n\t\tconst TUserScope extends string,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TPropsSchema extends ImplicitFieldSchema,\n\t>(inputSchemaFactory: SchemaFactoryBeta<TUserScope>, propsSchema: TPropsSchema) {\n\t\tconst schemaFactory = createTableScopedFactory(inputSchemaFactory);\n\t\ttype Scope = typeof schemaFactory.scope;\n\n\t\t// Note: `columnFields` is broken into two parts to work around a TypeScript bug\n\t\t// that results in broken `.d.ts` output.\n\t\t// See definition of `ColumnInsertableType` below.\n\t\tconst columnFieldsBuiltInParts = {\n\t\t\tid: schemaFactory.identifier,\n\t\t} as const;\n\t\tconst columnFieldsPropsPart = {\n\t\t\tprops: propsSchema,\n\t\t} as const;\n\n\t\t/**\n\t\t * {@link Column} fields.\n\t\t *\n\t\t * @remarks\n\t\t * Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t *\n\t\t * Note: ideally we would add a satisfies clause here to ensure that this satisfies\n\t\t * `Record<string, ImplicitFieldSchema>`, but doing so causes TypeScript to prematurely and incorrectly evaluate the type of `propsSchema`.\n\t\t * Likely related to the following issue: https://github.com/microsoft/TypeScript/issues/52394\n\t\t */\n\t\tconst columnFields = {\n\t\t\t...columnFieldsBuiltInParts,\n\t\t\t...columnFieldsPropsPart,\n\t\t} as const; // satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * A column in a table.\n\t\t */\n\t\tclass Column\n\t\t\textends schemaFactory.object(\"Column\", columnFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements TableSchema.Column<TCellSchema, TPropsSchema> {}\n\n\t\ttype ColumnValueType = TreeNode &\n\t\t\tTableSchema.Column<TCellSchema, TPropsSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Column\">>;\n\n\t\t// Note: ideally this type would just leverage `InsertableObjectFromSchemaRecord<typeof columnFields>`,\n\t\t// but that results in broken `.d.ts` output due to a TypeScript bug.\n\t\t// See: https://github.com/microsoft/TypeScript/issues/58688.\n\t\t// Instead we extract and inline the typing of the \"props\" field here, which seems to sufficiently work around the issue.\n\t\t// type ColumnInsertableType = InsertableObjectFromSchemaRecord<typeof columnFields>;\n\t\ttype ColumnInsertableType = InsertableObjectFromSchemaRecord<\n\t\t\ttypeof columnFieldsBuiltInParts\n\t\t> &\n\t\t\t(FieldHasDefault<TPropsSchema> extends true\n\t\t\t\t? // Note: The docs on the below properties are copied from `IColumn.props`' docs to ensure that the\n\t\t\t\t\t// documentation appears in the data insertion scenario.\n\t\t\t\t\t// The contents are duplicated instead of using `@inheritdoc`, as intellisense does not correctly\n\t\t\t\t\t// support `@inheritDoc`.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/31267\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The column's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops?: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The column's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t});\n\n\t\t// Modified version of `Column` that ensures the constructor (and `createFromInsertable`) are\n\t\t// typed correctly in terms of our insertable type.\n\t\t// This lets us be selective in our type-cast for the value returned from this function,\n\t\t// preserving as much type-safety as we reasonably can.\n\t\ttype ColumnSchemaModifiedType = Omit<\n\t\t\t// Use mapped type to omit the constructor\n\t\t\t{\n\t\t\t\t[Property in keyof typeof Column]: (typeof Column)[Property];\n\t\t\t},\n\t\t\t\"createFromInsertable\"\n\t\t> &\n\t\t\t(new (\n\t\t\t\tparameters: InternalTreeNode | ColumnInsertableType,\n\t\t\t) => Column) & {\n\t\t\t\tcreateFromInsertable(parameters: ColumnInsertableType): Column;\n\t\t\t};\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst ColumnSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Column\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ ColumnValueType,\n\t\t\t/* TInsertable */ object & ColumnInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof columnFields\n\t\t> = Column as ColumnSchemaModifiedType;\n\n\t\treturn ColumnSchemaType;\n\t}\n\n\t/**\n\t * Base column schema type.\n\t * @sealed @system @alpha\n\t */\n\texport type ColumnSchemaBase<\n\t\tTUserScope extends string = string,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> = ReturnType<typeof createColumnSchema<TUserScope, TCellSchema, TPropsSchema>>;\n\n\t// #endregion\n\n\t// #region Row\n\n\t/**\n\t * Base options for creating table row schema.\n\t * @remarks Includes parameters common to all row factory overloads.\n\t * @system @alpha\n\t */\n\texport type CreateRowOptionsBase<\n\t\tTUserScope extends string = string,\n\t\tTSchemaFactory extends SchemaFactoryBeta<TUserScope> = SchemaFactoryBeta<TUserScope>,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCellSchema>;\n\n\t/**\n\t * Factory for creating row schema.\n\t * @sealed @alpha\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createRowSchema<\n\t\tconst TUserScope extends string,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TPropsSchema extends ImplicitFieldSchema,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryBeta<TUserScope>,\n\t\tcellSchema: TCellSchema,\n\t\tpropsSchema: TPropsSchema,\n\t) {\n\t\tconst schemaFactory = createTableScopedFactory(inputSchemaFactory);\n\t\ttype Scope = typeof schemaFactory.scope;\n\n\t\t// Note: `rowFields` is broken into two parts to work around a TypeScript bug\n\t\t// that results in broken `.d.ts` output.\n\t\t// See definition of `RowInsertableType` below.\n\t\tconst rowFieldsBuiltInParts = {\n\t\t\tid: schemaFactory.identifier,\n\t\t\t/**\n\t\t\t * The cells of the table row, keyed by column ID.\n\t\t\t * @remarks\n\t\t\t * The table row models its cells as a record, where each key is the ID of the column it belongs to. The choice of record (as opposed to a map) is intended to make interop with common table rendering libraries in TypeScript/JavaScript easier.\n\t\t\t */\n\t\t\tcells: schemaFactory.required(schemaFactory.record(\"Row.cells\", cellSchema), {\n\t\t\t\tmetadata: {\n\t\t\t\t\tdescription: \"The cells of the table row, keyed by column ID.\",\n\t\t\t\t},\n\t\t\t}),\n\t\t} as const;\n\t\tconst rowFieldsPropsPart = {\n\t\t\tprops: propsSchema,\n\t\t} as const;\n\n\t\t/**\n\t\t * {@link RowSchema} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t * Note: ideally we would add a satisfies clause here to ensure that this satisfies\n\t\t * `Record<string, ImplicitFieldSchema>`, but doing so causes TypeScript to prematurely and incorrectly evaluate the type of `propsSchema`.\n\t\t * Likely related to the following issue: https://github.com/microsoft/TypeScript/issues/52394\n\t\t */\n\t\tconst rowFields = {\n\t\t\t...rowFieldsBuiltInParts,\n\t\t\t...rowFieldsPropsPart,\n\t\t} as const; // satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * The Row schema - this is a map of Cells where the key is the column id\n\t\t */\n\t\tclass RowSchema\n\t\t\textends schemaFactory.object(\"Row\", rowFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements RowPrivate<TCellSchema, TPropsSchema> {}\n\n\t\ttype RowValueType = TreeNode &\n\t\t\tTableSchema.Row<TCellSchema, TPropsSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Row\">>;\n\n\t\t// Note: ideally this type would just leverage `InsertableObjectFromSchemaRecord<typeof rowFields>`,\n\t\t// but that results in broken `.d.ts` output due to a TypeScript bug.\n\t\t// See: https://github.com/microsoft/TypeScript/issues/58688.\n\t\t// Instead we extract and inline the typing of the \"props\" field here, which seems to sufficiently work around\n\t\t// the issue.\n\t\t// type RowInsertableType = InsertableObjectFromSchemaRecord<typeof rowFields>;\n\t\ttype RowInsertableType = InsertableObjectFromSchemaRecord<typeof rowFieldsBuiltInParts> &\n\t\t\t(FieldHasDefault<TPropsSchema> extends true\n\t\t\t\t? // Note: The docs on the below properties are copied from `IRow.props`' docs to ensure that the\n\t\t\t\t\t// documentation appears in the data insertion scenario.\n\t\t\t\t\t// The contents are duplicated instead of using `@inheritdoc`, as intellisense does not correctly\n\t\t\t\t\t// support `@inheritDoc`.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/31267\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The row's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information\n\t\t\t\t\t\t * about the row.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops?: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The row's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information\n\t\t\t\t\t\t * about the row.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t});\n\n\t\t// Modified version of `Row` that ensures the constructor (and `createFromInsertable`) are\n\t\t// typed correctly in terms of our insertable type.\n\t\t// This lets us be selective in our type-cast for the value returned from this function,\n\t\t// preserving as much type-safety as we reasonably can.\n\t\ttype RowSchemaModifiedType = Omit<\n\t\t\t// Use mapped type to omit the constructor\n\t\t\t{\n\t\t\t\t[Property in keyof typeof RowSchema]: (typeof RowSchema)[Property];\n\t\t\t},\n\t\t\t\"createFromInsertable\"\n\t\t> &\n\t\t\t(new (\n\t\t\t\tparameters: InternalTreeNode | RowInsertableType,\n\t\t\t) => RowSchema) & {\n\t\t\t\tcreateFromInsertable(parameters: RowInsertableType): RowSchema;\n\t\t\t};\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst RowSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Row\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ RowValueType,\n\t\t\t/* TInsertable */ object & RowInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof rowFields\n\t\t> = RowSchema as RowSchemaModifiedType;\n\n\t\treturn RowSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @alpha\n\t */\n\texport type RowSchemaBase<\n\t\tTUserScope extends string = string,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> = ReturnType<typeof createRowSchema<TUserScope, TCellSchema, TPropsSchema>>;\n\n\t// #endregion\n\n\t// #region Table\n\n\t/**\n\t * Base options for creating table schema.\n\t * @remarks Includes parameters common to all table factory overloads.\n\t * @system @alpha\n\t */\n\texport type TableFactoryOptionsBase<\n\t\tTUserScope extends string = string,\n\t\tTSchemaFactory extends SchemaFactoryBeta<TUserScope> = SchemaFactoryBeta<TUserScope>,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCellSchema>;\n\n\t/**\n\t * Factory for creating table schema.\n\t * @system @alpha\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createTableSchema<\n\t\tconst TUserScope extends string,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TColumnSchema extends ColumnSchemaBase<TUserScope, TCellSchema>,\n\t\tconst TRowSchema extends RowSchemaBase<TUserScope, TCellSchema>,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryBeta<TUserScope>,\n\t\t_cellSchema: TCellSchema,\n\t\tcolumnSchema: TColumnSchema,\n\t\trowSchema: TRowSchema,\n\t) {\n\t\tconst schemaFactory = createTableScopedFactory(inputSchemaFactory);\n\t\ttype Scope = typeof schemaFactory.scope;\n\n\t\ttype CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\t\ttype ColumnValueType = TreeNodeFromImplicitAllowedTypes<TColumnSchema>;\n\t\ttype ColumnInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>;\n\t\ttype RowValueType = TreeNodeFromImplicitAllowedTypes<TRowSchema>;\n\t\ttype RowInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>;\n\n\t\t// Internal version of RowValueType that exposes the `cells` property for use within Table methods.\n\t\ttype RowValueInternalType = RowValueType & RowPrivate<TCellSchema>;\n\n\t\t/**\n\t\t * {@link Table} inner fields.\n\t\t * @remarks Extracted for re-use as construction parameters.\n\t\t * @see {@link Table.create}.\n\t\t */\n\t\tconst tableInnerFields = {\n\t\t\trows: schemaFactory.array(\"Table.rows\", rowSchema),\n\t\t\tcolumns: schemaFactory.array(\"Table.columns\", columnSchema),\n\t\t} as const satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * {@link Table} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t */\n\t\tconst tableFields = {\n\t\t\ttable: schemaFactory.required(schemaFactory.object(\"Table\", tableInnerFields), {\n\t\t\t\t// Use an empty key in the stored schema format to help prevent schema-unaware edits from being\n\t\t\t\t// made to the table, which may violate intended invariants.\n\t\t\t\tkey: EmptyKey,\n\t\t\t}),\n\t\t} as const satisfies Record<string, ImplicitFieldSchema>;\n\n\t\ttype TableValueType = TreeNode &\n\t\t\tTableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"TableRoot\">>;\n\t\ttype TableConstructorType = new (data?: InternalTreeNode | undefined) => TableValueType;\n\n\t\t/**\n\t\t * The Table schema\n\t\t */\n\t\tclass Table\n\t\t\t// Calling the objectSchema factory directly rather than using the schemaFactory so we can specify\n\t\t\t// `implicitlyConstructable: false`, which the SchemaFactory APIs do not yet support.\n\t\t\t// TODO: when support for configuring `implicitlyConstructable` is added to SchemaFactory, switch to\n\t\t\t// using that instead.\n\t\t\textends objectSchema(\n\t\t\t\t/* identifier: */ scoped(schemaFactory as SchemaFactory<Scope>, \"TableRoot\"),\n\t\t\t\t/* info: */ tableFields,\n\t\t\t\t/* implicitlyConstructable: */ false,\n\t\t\t\t/* nodeOptions: */ {\n\t\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t\t},\n\t\t\t)\n\t\t\timplements TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema>\n\t\t{\n\t\t\tpublic constructor(node?: InternalTreeNode | undefined) {\n\t\t\t\tsuper(node ?? { table: { columns: [], rows: [] } });\n\t\t\t}\n\n\t\t\tpublic static create<TThis extends TableConstructorType>(\n\t\t\t\tthis: TThis,\n\t\t\t\tinitialContents?:\n\t\t\t\t\t| TableSchema.TableFactoryMethodParameters<\n\t\t\t\t\t\t\tTUserScope,\n\t\t\t\t\t\t\tTCellSchema,\n\t\t\t\t\t\t\tTColumnSchema,\n\t\t\t\t\t\t\tTRowSchema\n\t\t\t\t\t >\n\t\t\t\t\t| undefined,\n\t\t\t): InstanceType<TThis> {\n\t\t\t\t// #region Input validation\n\n\t\t\t\tconst columns =\n\t\t\t\t\t(initialContents?.columns as Iterable<ColumnInsertableType> | undefined) ?? [];\n\n\t\t\t\tconst columnIds = new Set<string>();\n\t\t\t\tfor (const column of columns) {\n\t\t\t\t\tcolumnIds.add((column as ColumnValueType).id);\n\t\t\t\t}\n\n\t\t\t\tconst rows = (initialContents?.rows as Iterable<RowInsertableType> | undefined) ?? [];\n\n\t\t\t\tTable._validateNewColumns(\n\t\t\t\t\tcolumns,\n\t\t\t\t\t// New table, so no existing columns to validate against\n\t\t\t\t\tnew Set(),\n\t\t\t\t);\n\n\t\t\t\tTable._validateNewRows(\n\t\t\t\t\trows,\n\t\t\t\t\t// New table, so no existing rows to validate against\n\t\t\t\t\tnew Set(),\n\t\t\t\t\t// No existing columns to validate cells against, but we do need to validate the new rows against the new columns\n\t\t\t\t\tcolumnIds,\n\t\t\t\t);\n\n\t\t\t\t// #endregion\n\t\t\t\treturn new this(\n\t\t\t\t\tinitialContents === undefined\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: ({\n\t\t\t\t\t\t\t\ttable: initialContents,\n\t\t\t\t\t\t\t\t// We have typed our constructor to prevent users from calling it directly with insertable contents.\n\t\t\t\t\t\t\t\t// But the base constructor still allows it. Cast to work around this.\n\t\t\t\t\t\t\t} as unknown as InternalTreeNode),\n\t\t\t\t) as InstanceType<TThis>;\n\t\t\t}\n\n\t\t\tpublic get columns(): RearrangeableList<TColumnSchema> {\n\t\t\t\treturn this.table.columns as RearrangeableList<TColumnSchema>;\n\t\t\t}\n\n\t\t\tpublic get rows(): RearrangeableList<TRowSchema> {\n\t\t\t\treturn this.table.rows as RearrangeableList<TRowSchema>;\n\t\t\t}\n\n\t\t\tpublic getColumn(indexOrId: number | string): ColumnValueType | undefined {\n\t\t\t\treturn this.#tryGetColumn(indexOrId);\n\t\t\t}\n\n\t\t\tpublic getRow(indexOrId: number | string): RowValueType | undefined {\n\t\t\t\treturn this.#tryGetRow(indexOrId);\n\t\t\t}\n\n\t\t\tpublic getCell(\n\t\t\t\tkey: TableSchema.CellKey<TColumnSchema, TRowSchema>,\n\t\t\t): CellValueType | undefined {\n\t\t\t\tconst { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;\n\t\t\t\tconst row = this.#tryGetRow(rowOrIdOrIndex);\n\t\t\t\tif (row === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst column = this.#tryGetColumn(columnOrIdOrIndex);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn (row as RowValueInternalType).cells[column.id];\n\t\t\t}\n\n\t\t\tpublic insertColumns({\n\t\t\t\tcolumns,\n\t\t\t\tindex,\n\t\t\t}: TableSchema.InsertColumnsParameters<TColumnSchema>): ColumnValueType[] {\n\t\t\t\t// #region Input validation\n\n\t\t\t\t// Ensure specified index is valid\n\t\t\t\tif (index !== undefined) {\n\t\t\t\t\tvalidateIndex(index, this.table.columns, \"Table.insertColumns\", true);\n\t\t\t\t}\n\n\t\t\t\t// Ensure the new columns being inserted are valid\n\t\t\t\tthis.#validateNewColumns(columns);\n\n\t\t\t\t// #endregion\n\n\t\t\t\t// TypeScript is unable to narrow the column type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.table.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);\n\t\t\t\t} else {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.table.columns.insertAt(index, TreeArrayNode.spread(columns) as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input nodes into the tree hydrates them, making them usable as nodes.\n\t\t\t\treturn columns as unknown as ColumnValueType[];\n\t\t\t}\n\n\t\t\tpublic insertRows({\n\t\t\t\tindex,\n\t\t\t\trows,\n\t\t\t}: TableSchema.InsertRowsParameters<TRowSchema>): RowValueType[] {\n\t\t\t\t// #region Input validation\n\n\t\t\t\t// Ensure specified index is valid\n\t\t\t\tif (index !== undefined) {\n\t\t\t\t\tvalidateIndex(index, this.table.rows, \"Table.insertRows\", true);\n\t\t\t\t}\n\n\t\t\t\t// Ensure the new rows being inserted are valid\n\t\t\t\tthis.#validateNewRows(rows);\n\n\t\t\t\t// #endregion\n\n\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.table.rows.insertAtEnd(TreeArrayNode.spread(rows) as any);\n\t\t\t\t} else {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.table.rows.insertAt(index, TreeArrayNode.spread(rows) as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input nodes into the tree hydrates them, making them usable as nodes.\n\t\t\t\treturn rows as unknown as RowValueType[];\n\t\t\t}\n\n\t\t\tpublic setCell({\n\t\t\t\tkey,\n\t\t\t\tcell,\n\t\t\t}: TableSchema.SetCellParameters<TCellSchema, TColumnSchema, TRowSchema>): void {\n\t\t\t\tconst { column: columnOrId, row: rowOrId } = key;\n\n\t\t\t\tconst row = this.#getRow(rowOrId);\n\t\t\t\tconst column = this.#getColumn(columnOrId);\n\n\t\t\t\t(row as RowValueInternalType).cells[column.id] = cell as CellValueType;\n\t\t\t}\n\n\t\t\tpublic removeColumns(\n\t\t\t\tindexOrColumns: number | undefined | readonly string[] | readonly ColumnValueType[],\n\t\t\t\tcount: number | undefined = undefined,\n\t\t\t): ColumnValueType[] {\n\t\t\t\tif (typeof indexOrColumns === \"number\" || indexOrColumns === undefined) {\n\t\t\t\t\tlet removedColumns: ColumnValueType[] | undefined;\n\t\t\t\t\tconst startIndex = indexOrColumns ?? 0;\n\t\t\t\t\tconst endIndex =\n\t\t\t\t\t\tcount === undefined ? this.table.columns.length : startIndex + count;\n\n\t\t\t\t\t// If there are no columns to remove, do nothing\n\t\t\t\t\tif (startIndex === endIndex) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\tvalidateIndexRange(startIndex, endIndex, this.table.columns, \"Table.removeColumns\");\n\n\t\t\t\t\tthis.#applyEditsInBatch(() => {\n\t\t\t\t\t\tconst columnsToRemove = this.table.columns.slice(\n\t\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\t\tendIndex,\n\t\t\t\t\t\t) as ColumnValueType[];\n\n\t\t\t\t\t\t// First, remove all cells that correspond to each column from each row:\n\t\t\t\t\t\tfor (const column of columnsToRemove) {\n\t\t\t\t\t\t\tthis.#removeCells(column);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Second, remove the column nodes:\n\t\t\t\t\t\tremoveRangeFromArray(\n\t\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\t\tendIndex,\n\t\t\t\t\t\t\tthis.table.columns,\n\t\t\t\t\t\t\t\"Table.removeColumns\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tremovedColumns = columnsToRemove;\n\t\t\t\t\t});\n\t\t\t\t\treturn removedColumns ?? fail(0xc1f /* Transaction did not complete. */);\n\t\t\t\t} else {\n\t\t\t\t\t// If there are no columns to remove, do nothing\n\t\t\t\t\tif (indexOrColumns.length === 0) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Resolve any IDs to actual nodes.\n\t\t\t\t\t// This validates that all of the rows exist before starting transaction.\n\t\t\t\t\t// This improves user-facing error experience.\n\t\t\t\t\tconst columnsToRemove: ColumnValueType[] = [];\n\t\t\t\t\tfor (const columnOrIdToRemove of indexOrColumns) {\n\t\t\t\t\t\tcolumnsToRemove.push(this.#getColumn(columnOrIdToRemove));\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.#applyEditsInBatch(() => {\n\t\t\t\t\t\t// Note, throwing an error within a transaction will abort the entire transaction.\n\t\t\t\t\t\t// So if we throw an error here for any column, no columns will be removed.\n\t\t\t\t\t\tfor (const columnToRemove of columnsToRemove) {\n\t\t\t\t\t\t\t// Remove the corresponding cell from all rows.\n\t\t\t\t\t\t\tfor (const row of this.table.rows) {\n\t\t\t\t\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the cast.\n\t\t\t\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\t\t\t\tthis.removeCell({\n\t\t\t\t\t\t\t\t\tcolumn: columnToRemove,\n\t\t\t\t\t\t\t\t\trow: row as RowValueType,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// We have already validated that all of the columns exist above, so this is safe.\n\t\t\t\t\t\t\tthis.table.columns.removeAt(this.table.columns.indexOf(columnToRemove));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn columnsToRemove;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic removeRows(\n\t\t\t\tindexOrRows: number | undefined | readonly string[] | readonly RowValueType[],\n\t\t\t\tcount?: number | undefined,\n\t\t\t): RowValueType[] {\n\t\t\t\tif (typeof indexOrRows === \"number\" || indexOrRows === undefined) {\n\t\t\t\t\tconst startIndex = indexOrRows ?? 0;\n\t\t\t\t\tconst endIndex = count === undefined ? this.table.rows.length : startIndex + count;\n\n\t\t\t\t\t// If there are no rows to remove, do nothing\n\t\t\t\t\tif (startIndex === endIndex) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn removeRangeFromArray(\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tendIndex,\n\t\t\t\t\t\tthis.table.rows,\n\t\t\t\t\t\t\"Table.removeRows\",\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// If there are no rows to remove, do nothing\n\t\t\t\tif (indexOrRows.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\t// Resolve any IDs to actual nodes.\n\t\t\t\t// This validates that all of the rows exist before starting transaction.\n\t\t\t\t// This improves user-facing error experience.\n\t\t\t\tconst rowsToRemove: RowValueType[] = [];\n\t\t\t\tfor (const rowToRemove of indexOrRows) {\n\t\t\t\t\trowsToRemove.push(this.#getRow(rowToRemove));\n\t\t\t\t}\n\n\t\t\t\tthis.#applyEditsInBatch(() => {\n\t\t\t\t\t// Note, throwing an error within a transaction will abort the entire transaction.\n\t\t\t\t\t// So if we throw an error here for any row, no rows will be removed.\n\t\t\t\t\tfor (const rowToRemove of rowsToRemove) {\n\t\t\t\t\t\t// We have already validated that all of the rows exist above, so this is safe.\n\t\t\t\t\t\tconst index = this.table.rows.indexOf(rowToRemove);\n\t\t\t\t\t\tthis.table.rows.removeAt(index);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn rowsToRemove;\n\t\t\t}\n\n\t\t\tpublic removeCell(\n\t\t\t\tkey: TableSchema.CellKey<TColumnSchema, TRowSchema>,\n\t\t\t): CellValueType | undefined {\n\t\t\t\tconst { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;\n\t\t\t\tconst row = this.#getRow(rowOrIdOrIndex) as RowValueInternalType;\n\t\t\t\tconst column = this.#getColumn(columnOrIdOrIndex);\n\n\t\t\t\tconst cell: CellValueType | undefined = row.cells[column.id];\n\t\t\t\tif (cell === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\t\t\tdelete row.cells[column.id];\n\t\t\t\treturn cell;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Removes the cell corresponding with the specified column from each row in the table.\n\t\t\t */\n\t\t\t#removeCells(column: ColumnValueType): void {\n\t\t\t\tfor (const row of this.table.rows) {\n\t\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\tthis.removeCell({\n\t\t\t\t\t\tcolumn,\n\t\t\t\t\t\trow: row as RowValueType,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Applies the provided edits in a \"batch\".\n\t\t\t *\n\t\t\t * @remarks\n\t\t\t * For hydrated trees, this will be done in a transaction to ensure atomicity.\n\t\t\t *\n\t\t\t * Transactions are not supported for unhydrated trees, so we cannot run a transaction in that case.\n\t\t\t * But since there are no collaborators, this is not an issue.\n\t\t\t */\n\t\t\t#applyEditsInBatch(applyEdits: () => void): void {\n\t\t\t\tconst branch = TreeAlpha.branch(this);\n\n\t\t\t\t// Ensure events are paused until all of the edits are applied.\n\t\t\t\t// This ensures that the user sees the corresponding table-level edit as atomic,\n\t\t\t\t// and ensures they are not spammed with intermediate events.\n\t\t\t\twithBufferedTreeEvents(() => {\n\t\t\t\t\tif (branch === undefined) {\n\t\t\t\t\t\t// If this node does not have a corresponding branch, then it is unhydrated.\n\t\t\t\t\t\t// I.e., it is not part of a collaborative session yet.\n\t\t\t\t\t\t// Therefore, we don't need to run the edits as a transaction.\n\t\t\t\t\t\tapplyEdits();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbranch.runTransaction(() => {\n\t\t\t\t\t\t\tapplyEdits();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Column node or ID to a Column node in the table.\n\t\t\t * Returns `undefined` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\t#tryGetColumn(\n\t\t\t\tcolumnOrIdOrIndex: ColumnValueType | string | number,\n\t\t\t): ColumnValueType | undefined {\n\t\t\t\tif (typeof columnOrIdOrIndex === \"number\") {\n\t\t\t\t\tif (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.table.columns.length) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.table.columns[columnOrIdOrIndex] as ColumnValueType;\n\t\t\t\t}\n\n\t\t\t\tif (typeof columnOrIdOrIndex === \"string\") {\n\t\t\t\t\tconst columnId = columnOrIdOrIndex;\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.table.columns.find((col) => (col as ColumnValueType).id === columnId) as\n\t\t\t\t\t\t| ColumnValueType\n\t\t\t\t\t\t| undefined;\n\t\t\t\t}\n\n\t\t\t\t// If the user provided a node, ensure it actually exists in this table.\n\t\t\t\tif (!this.table.columns.includes(columnOrIdOrIndex)) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn columnOrIdOrIndex;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Column node or ID to a Column node in the table.\n\t\t\t * @throws Throws a `UsageError` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\t#getColumn(columnOrIdOrIndex: ColumnValueType | string | number): ColumnValueType {\n\t\t\t\tconst column = this.#tryGetColumn(columnOrIdOrIndex);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\tTable._throwMissingColumnError(columnOrIdOrIndex);\n\t\t\t\t}\n\t\t\t\treturn column;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Throw a `UsageError` for a missing Column by its ID or index.\n\t\t\t */\n\t\t\tprivate static _throwMissingColumnError(\n\t\t\t\tcolumnOrIdOrIndex: ColumnValueType | string | number,\n\t\t\t): never {\n\t\t\t\tif (typeof columnOrIdOrIndex === \"number\") {\n\t\t\t\t\tthrow new UsageError(`No column exists at index ${columnOrIdOrIndex}.`);\n\t\t\t\t}\n\n\t\t\t\tif (typeof columnOrIdOrIndex === \"string\") {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`No column with ID \"${columnOrIdOrIndex}\" exists in the table.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`The specified column node with ID \"${columnOrIdOrIndex.id}\" does not exist in the table.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Row node or ID to a Row node in the table.\n\t\t\t * Returns `undefined` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\t#tryGetRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType | undefined {\n\t\t\t\tif (typeof rowOrIdOrIndex === \"number\") {\n\t\t\t\t\tif (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.table.rows.length) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.table.rows[rowOrIdOrIndex] as RowValueType;\n\t\t\t\t}\n\n\t\t\t\tif (typeof rowOrIdOrIndex === \"string\") {\n\t\t\t\t\tconst rowId = rowOrIdOrIndex;\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.table.rows.find((row) => (row as RowValueType).id === rowId) as\n\t\t\t\t\t\t| RowValueType\n\t\t\t\t\t\t| undefined;\n\t\t\t\t}\n\n\t\t\t\t// If the user provided a node, ensure it actually exists in this table.\n\t\t\t\tif (!this.table.rows.includes(rowOrIdOrIndex)) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn rowOrIdOrIndex;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Row node, ID, or index to a Row node in the table.\n\t\t\t * @throws Throws a `UsageError` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\t#getRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType {\n\t\t\t\tconst row = this.#tryGetRow(rowOrIdOrIndex);\n\t\t\t\tif (row === undefined) {\n\t\t\t\t\tTable._throwMissingRowError(rowOrIdOrIndex);\n\t\t\t\t}\n\t\t\t\treturn row;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Validates the provided list of new columns being inserted into the table.\n\t\t\t * @throws Throws a `UsageError` if any of the following conditions are met:\n\t\t\t * - A column with a duplicate ID is being inserted.\n\t\t\t */\n\t\t\t#validateNewColumns(newColumns: readonly ColumnInsertableType[]): void {\n\t\t\t\treturn Table._validateNewColumns(\n\t\t\t\t\tnewColumns,\n\t\t\t\t\tnew Set(this.table.columns.map((column) => (column as ColumnValueType).id)),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Validates the provided list of new rows being inserted into the table.\n\t\t\t * @throws Throws a `UsageError` if any of the following conditions are met:\n\t\t\t * - A row with a duplicate ID is being inserted.\n\t\t\t * - A row is being inserted that contains cells for columns that do not exist in the table.\n\t\t\t */\n\t\t\t#validateNewRows(newRows: readonly RowInsertableType[]): void {\n\t\t\t\treturn Table._validateNewRows(\n\t\t\t\t\tnewRows,\n\t\t\t\t\tnew Set(this.table.rows.map((row) => (row as RowValueType).id)),\n\t\t\t\t\tnew Set(this.table.columns.map((column) => (column as ColumnValueType).id)),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Validates the provided list of new columns being inserted into the table.\n\t\t\t * @throws Throws a `UsageError` if any of the following conditions are met:\n\t\t\t * - A column with a duplicate ID is being inserted.\n\t\t\t */\n\t\t\tprivate static _validateNewColumns(\n\t\t\t\tnewColumns: Iterable<ColumnInsertableType>,\n\t\t\t\texistingColumnIds: Set<string>,\n\t\t\t): void {\n\t\t\t\tconst newColumnIds = new Set<string>();\n\t\t\t\tfor (const newColumn of newColumns) {\n\t\t\t\t\t// #region Ensure each column ID is unique\n\t\t\t\t\tconst newColumnId = (newColumn as ColumnValueType).id;\n\t\t\t\t\tif (existingColumnIds.has(newColumnId)) {\n\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t`Attempted to insert a column with ID \"${newColumnId}\", but a column with that ID already exists in the table.`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif (newColumnIds.has(newColumnId)) {\n\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t`Attempted to insert multiple columns with ID \"${newColumnId}\". Column IDs must be unique.`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tnewColumnIds.add(newColumnId);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Validates the provided list of new rows being inserted into the table.\n\t\t\t * @throws Throws a `UsageError` if any of the following conditions are met:\n\t\t\t * - A row with a duplicate ID is being inserted.\n\t\t\t * - A row is being inserted that contains cells for columns that do not exist in the table.\n\t\t\t */\n\t\t\tprivate static _validateNewRows(\n\t\t\t\tnewRows: Iterable<RowInsertableType>,\n\t\t\t\texistingRowIds: Set<string>,\n\t\t\t\tcolumnIds: Set<string>,\n\t\t\t): void {\n\t\t\t\tconst newRowIds = new Set<string>();\n\t\t\t\tfor (const newRow of newRows) {\n\t\t\t\t\t// #region Ensure each row ID is unique\n\n\t\t\t\t\tconst newRowId = (newRow as RowValueType).id;\n\t\t\t\t\tif (existingRowIds.has(newRowId)) {\n\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t`Attempted to insert a row with ID \"${newRowId}\", but a row with that ID already exists in the table.`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif (newRowIds.has(newRowId)) {\n\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t`Attempted to insert multiple rows with ID \"${newRowId}\". Row IDs must be unique.`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tnewRowIds.add(newRowId);\n\n\t\t\t\t\t// #endregion\n\n\t\t\t\t\t// #region If the row contains cells, verify that the table contains the columns for those cells\n\n\t\t\t\t\t// Note: we intentionally hide `cells` on `IRow` to avoid leaking the internal data representation as much as possible, so we have to cast here.\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tif ((newRow as any).cells !== undefined) {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\tconst keys: string[] = Object.keys((newRow as any).cells);\n\t\t\t\t\t\tfor (const key of keys) {\n\t\t\t\t\t\t\tif (!columnIds.has(key)) {\n\t\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\t`Attempted to insert a row containing a cell under column ID \"${key}\", but the table does not contain a column with that ID.`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// #endregion\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Throw a `UsageError` for a missing Row by its ID or index.\n\t\t\t */\n\t\t\tprivate static _throwMissingRowError(\n\t\t\t\trowOrIdOrIndex: RowValueType | string | number,\n\t\t\t): never {\n\t\t\t\tif (typeof rowOrIdOrIndex === \"number\") {\n\t\t\t\t\tthrow new UsageError(`No row exists at index ${rowOrIdOrIndex}.`);\n\t\t\t\t}\n\n\t\t\t\tif (typeof rowOrIdOrIndex === \"string\") {\n\t\t\t\t\tthrow new UsageError(`No row with ID \"${rowOrIdOrIndex}\" exists in the table.`);\n\t\t\t\t}\n\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`The specified row node with ID \"${rowOrIdOrIndex.id}\" does not exist in the table.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Set a private symbol on the schema class that marks it as having been generated by this factory.\n\t\t// Column / Row functionality use this to validate that they are being used in a table.\n\t\t// This is effectively a work-around that allows columns and rows to invoke table methods\n\t\t// without having to pass the table as a parameter to their construction, which isn't possible.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t(Table as any)[tableSchemaSymbol] = true;\n\n\t\t// Named interfaces here do not compile.\n\t\ttype Statics = {\n\t\t\t/**\n\t\t\t * Create a table with initial contents.\n\t\t\t * @param initialContents - The initial contents of the table.\n\t\t\t * If not provided, an empty table will be constructed.\n\t\t\t * @remarks Performs the following input validation:\n\t\t\t * - Ensures that any cells specified in the initial rows correspond to existing columns in the initial columns.\n\t\t\t * - Ensures that all column and row IDs are unique.\n\t\t\t */\n\t\t\tcreate<TThis extends TableConstructorType>(\n\t\t\t\tthis: TThis,\n\t\t\t\tinitialContents?:\n\t\t\t\t\t| TableSchema.TableFactoryMethodParameters<\n\t\t\t\t\t\t\tTUserScope,\n\t\t\t\t\t\t\tTCellSchema,\n\t\t\t\t\t\t\tTColumnSchema,\n\t\t\t\t\t\t\tTRowSchema\n\t\t\t\t\t >\n\t\t\t\t\t| undefined,\n\t\t\t): InstanceType<TThis>;\n\t\t} & TableConstructorType;\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via eraseSubclassableSchemaDetails to erase internal details.\n\t\tconst TableSchemaType = eraseSchemaDetailsSubclassable<TableValueType, Statics>()(Table);\n\n\t\t// Return the table schema\n\t\treturn TableSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @alpha\n\t */\n\texport type TableSchemaBase<\n\t\tTUserScope extends string,\n\t\tTCellSchema extends ImplicitAllowedTypes,\n\t\tTColumnSchema extends ColumnSchemaBase<TUserScope, TCellSchema>,\n\t\tTRowSchema extends RowSchemaBase<TUserScope, TCellSchema>,\n\t> = ReturnType<typeof createTableSchema<TUserScope, TCellSchema, TColumnSchema, TRowSchema>>;\n\n\t// #endregion\n}\n\nfunction createTableScopedFactory<TUserScope extends string>(\n\tinputSchemaFactory: SchemaFactoryBeta<TUserScope>,\n): SchemaFactoryBeta<`${typeof baseSchemaScope}<${TUserScope}>`> {\n\treturn new SchemaFactoryBeta(`${baseSchemaScope}<${inputSchemaFactory.scope}>`);\n}\n\n/**\n * Removes the specified range of elements from the array.\n * @returns The removed elements.\n */\nfunction removeRangeFromArray<TNodeSchema extends ImplicitAllowedTypes>(\n\tstartIndex: number,\n\tendIndex: number,\n\tarray: TreeArrayNode<TNodeSchema>,\n\tmethodName: string,\n): TreeNodeFromImplicitAllowedTypes<TNodeSchema>[] {\n\tvalidateIndexRange(startIndex, endIndex, array, methodName);\n\n\t// TypeScript is unable to narrow the array element type correctly here, hence the cast.\n\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\tconst removedRows = array.slice(\n\t\tstartIndex,\n\t\tendIndex,\n\t) as TreeNodeFromImplicitAllowedTypes<TNodeSchema>[];\n\tarray.removeRange(startIndex, endIndex);\n\n\treturn removedRows;\n}\n\n/**\n * Contains types and factories for creating schema to represent dynamic tabular data.\n *\n * @remarks\n *\n * WARNING: These APIs are in preview and are subject to change.\n * Until these APIs have stabilized, it is not recommended to use them in production code.\n * There may be breaking changes to these APIs and their underlying data format.\n * Using these APIs in production code may result in data loss or corruption.\n *\n * The primary APIs for create tabular data schema are:\n *\n * - {@link TableSchema.(table:1)}\n *\n * - {@link TableSchema.(column:1)}\n *\n * - {@link TableSchema.(row:1)}\n *\n * Tables created using these APIs are...\n *\n * - sparse, meaning that cells may be omitted, and new rows are empty by default.\n *\n * - dynamic, meaning that their structure can be modified at runtime.\n * Columns and rows can be inserted, removed, modified, and reordered.\n * Cells can be inserted, removed, and modified.\n *\n * - row-major, meaning that operating on rows (including inserts, removal, moves, and traversal) is more efficient than operating on columns.\n *\n * Column and Row schema created using these APIs are extensible via the `props` field.\n * This allows association of additional properties with column and row nodes.\n *\n * Cells in the table may become \"orphaned.\"\n * That is, it is possible to enter a state where one or more rows contain cells with no corresponding column.\n * To reduce the likelihood of this, you can manually remove corresponding cells when removing columns.\n * Either way, it is possible to enter such a state via the merging of edits.\n * For example: one client might add a row while another concurrently removes a column, orphaning the cell where the column and row intersected.\n *\n * @example Defining a Table schema\n *\n * ```typescript\n * class MyTable extends TableSchema.table({\n * \tschemaFactory,\n * \tcell: schemaFactory.string,\n * }) {}\n *\n * const table = MyTable.create({\n * \tcolumns: [{ id: \"column-0\" }],\n * \trows: [{ id: \"row-0\", cells: { \"column-0\": \"Hello world!\" } }],\n * });\n * ```\n *\n * @example Customizing Column and Row schema\n *\n * ```typescript\n * const Cell = schemaFactory.string;\n *\n * class MyColumn extends TableSchema.column({\n * \tschemaFactory,\n * \tcell: Cell,\n * \tprops: schemaFactory.object(\"TableColumnProps\", {\n * \t\tlabel: schemaFactory.string,\n * \t}),\n * }) {}\n *\n * class MyRow extends TableSchema.row({\n * \tschemaFactory,\n * \tcell: Cell,\n * }) {}\n *\n * class MyTable extends TableSchema.table({\n * \tschemaFactory,\n * \tcell: Cell,\n * \tcolumn: MyColumn,\n * \trow: MyRow,\n * }) {}\n *\n * const table = new MyTable({\n * \tcolumns: [\n * \t\tnew MyColumn({ props: { label: \"Entry\" } }),\n * \t\tnew MyColumn({ props: { label: \"Date\" } }),\n * \t\tnew MyColumn({ props: { label: \"Amount\" } }),\n * \t],\n * \trows: [],\n * });\n * ```\n *\n * @example Listening for changes in the table\n *\n * ```typescript\n * // Listen for any changes to the table and its children.\n * // The \"treeChanged\" event will fire when the associated node or any of its descendants change.\n * Tree.on(table, \"treeChanged\", () => {\n * \t// Respond to the change.\n * });\n * ```\n *\n * @example Listening for changes to the rows list only\n *\n * ```typescript\n * // Listen for any changes to the list of rows.\n * // The \"nodeChanged\" event will fire only when the specified node itself changes (i.e., its own properties change).\n * // In this case, the event will fire when a row is added or removed, or the order of the list is changed.\n * // But it won't fire when a row's properties change, or when the row's cells change, etc.\n * Tree.on(table.rows, \"nodeChanged\", () => {\n * \t// Respond to the change.\n * });\n * ```\n *\n * @privateRemarks\n * The above examples are backed by tests in `tableSchema.spec.ts`.\n * Those tests and these examples should be kept in-sync to ensure that the examples are correct.\n *\n * @alpha\n */\nexport namespace TableSchema {\n\t// #region Column\n\n\t/**\n\t * A column in a table.\n\t * @remarks Implemented by the schema class returned from {@link TableSchema.(column:2)}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the column.\n\t * @sealed @alpha\n\t */\n\texport interface Column<\n\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Reserving this for future use.\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTProps extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> {\n\t\t/**\n\t\t * The unique identifier of the column.\n\t\t * @remarks Uniquely identifies the node within the entire tree, not just the table.\n\t\t */\n\t\treadonly id: string;\n\n\t\t/**\n\t\t * The column's properties.\n\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t * @privateRemarks\n\t\t * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createColumnSchema}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<TProps>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<TProps>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @alpha\n\t */\n\texport function column<\n\t\tconst TUserScope extends string,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tparams: System_TableSchema.CreateColumnOptionsBase<\n\t\t\tTUserScope,\n\t\t\tSchemaFactoryBeta<TUserScope>,\n\t\t\tTCell\n\t\t>,\n\t): System_TableSchema.ColumnSchemaBase<\n\t\tTUserScope,\n\t\tTCell,\n\t\tSystem_TableSchema.DefaultPropsType\n\t>;\n\t/**\n\t * Factory for creating new table column schema.\n\t * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the column.\n\t * @alpha\n\t */\n\texport function column<\n\t\tconst TUserScope extends string,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TProps extends ImplicitFieldSchema,\n\t>(\n\t\tparams: System_TableSchema.CreateColumnOptionsBase<\n\t\t\tTUserScope,\n\t\t\tSchemaFactoryBeta<TUserScope>,\n\t\t\tTCell\n\t\t> & {\n\t\t\t/**\n\t\t\t * Optional column properties.\n\t\t\t */\n\t\t\treadonly props: TProps;\n\t\t},\n\t): System_TableSchema.ColumnSchemaBase<TUserScope, TCell, TProps>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function column({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops = SchemaFactory.optional(SchemaFactory.null),\n\t}: System_TableSchema.CreateColumnOptionsBase & {\n\t\treadonly props?: ImplicitFieldSchema;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createColumnSchema(schemaFactory, props);\n\t}\n\n\t// #endregion\n\n\t// #region Row\n\n\t/**\n\t * A row in a table.\n\t * @remarks Implemented by the schema class returned from {@link TableSchema.(row:2)}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the row.\n\t * @sealed @alpha\n\t */\n\texport interface Row<\n\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Reserving this for future use.\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTProps extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> {\n\t\t/**\n\t\t * The unique identifier of the row.\n\t\t * @remarks Uniquely identifies the node within the entire tree, not just the table.\n\t\t */\n\t\treadonly id: string;\n\n\t\t/**\n\t\t * The row's properties.\n\t\t * @remarks This is a user-defined schema that can be used to store additional information about the row.\n\t\t * @privateRemarks\n\t\t * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createRowSchema}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<TProps>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<TProps>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @alpha\n\t */\n\texport function row<\n\t\tconst TUserScope extends string,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tparams: System_TableSchema.CreateRowOptionsBase<\n\t\t\tTUserScope,\n\t\t\tSchemaFactoryBeta<TUserScope>,\n\t\t\tTCell\n\t\t>,\n\t): System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>;\n\t/**\n\t * Factory for creating new table row schema.\n\t * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the row.\n\t * @alpha\n\t */\n\texport function row<\n\t\tconst TUserScope extends string,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TProps extends ImplicitFieldSchema,\n\t>(\n\t\tparams: System_TableSchema.CreateRowOptionsBase<\n\t\t\tTUserScope,\n\t\t\tSchemaFactoryBeta<TUserScope>,\n\t\t\tTCell\n\t\t> & {\n\t\t\t/**\n\t\t\t * Optional row properties.\n\t\t\t */\n\t\t\treadonly props: TProps;\n\t\t},\n\t): System_TableSchema.RowSchemaBase<TUserScope, TCell, TProps>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function row({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops = SchemaFactory.optional(SchemaFactory.null),\n\t}: System_TableSchema.CreateRowOptionsBase & {\n\t\treadonly props?: ImplicitFieldSchema;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createRowSchema(schemaFactory, cell, props);\n\t}\n\n\t// #endregion\n\n\t// #region Table\n\n\t/**\n\t * A key to uniquely identify a cell within a table.\n\t * @input @alpha\n\t */\n\texport interface CellKey<\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * {@link TableSchema.Column}, {@link TableSchema.Column.id}, or column index at which the cell is located.\n\t\t */\n\t\treadonly column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>;\n\n\t\t/**\n\t\t * {@link TableSchema.Row}, {@link TableSchema.Row.id}, or row index at which the cell is located.\n\t\t */\n\t\treadonly row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>;\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertColumns} parameters.\n\t * @input @alpha\n\t */\n\texport interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new columns.\n\t\t * @remarks If not provided, the columns will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The columns to insert.\n\t\t */\n\t\treadonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertRows} parameters.\n\t * @input @alpha\n\t */\n\texport interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new rows.\n\t\t * @remarks If not provided, the rows will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The rows to insert.\n\t\t */\n\t\treadonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.setCell} parameters.\n\t * @input @alpha\n\t */\n\texport interface SetCellParameters<\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * The key to uniquely identify a cell in a table.\n\t\t */\n\t\treadonly key: CellKey<TColumn, TRow>;\n\n\t\t/**\n\t\t * The cell to set.\n\t\t */\n\t\treadonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;\n\t}\n\n\t/**\n\t * A table.\n\t *\n\t * @remarks Table schema is created via the {@link TableSchema.(table:1)} factory.\n\t * Node instances of the schema type should be constructed via the static `create` method on the schema class.\n\t * E.g. `const table = MyTableSchema.create({ columns, rows});`\n\t *\n\t * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TColumn - The type of the columns in the table.\n\t * @typeParam TRow - The type of the rows in the table.\n\t *\n\t * @sealed @alpha\n\t */\n\texport interface Table<\n\t\tTUserScope extends string,\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>,\n\t\tTRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>,\n\t> {\n\t\t/**\n\t\t * The table's columns.\n\t\t */\n\t\treadonly columns: System_TableSchema.RearrangeableList<TColumn>;\n\n\t\t/**\n\t\t * The table's rows.\n\t\t */\n\t\treadonly rows: System_TableSchema.RearrangeableList<TRow>;\n\n\t\t/**\n\t\t * Gets a table column by its {@link TableSchema.Column.id}.\n\t\t * @returns The column, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;\n\t\t/**\n\t\t * Gets a table column by its index in the table.\n\t\t * @returns The column, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetColumn(index: number): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;\n\n\t\t/**\n\t\t * Gets a table row by its {@link TableSchema.Row.id}.\n\t\t * @returns The row, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;\n\t\t/**\n\t\t * Gets a table row by its index in the table.\n\t\t * @returns The row, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;\n\n\t\t/**\n\t\t * Gets a cell in the table by corresponding column and row.\n\t\t * @param key - A key that uniquely distinguishes a cell in the table, represented as a combination of the column ID and row ID.\n\t\t * @returns The cell, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * Inserts 0 or more columns into the table.\n\t\t *\n\t\t * @throws Throws an error if the specified index is out of range.\n\t\t *\n\t\t * No columns are inserted in this case.\n\t\t */\n\t\tinsertColumns(\n\t\t\tparams: InsertColumnsParameters<TColumn>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\n\t\t/**\n\t\t * Inserts 0 or more rows into the table.\n\t\t *\n\t\t * @throws\n\t\t * Throws an error in the following cases:\n\t\t *\n\t\t * - The row contains cells, but the table does not contain matching columns for one or more of those cells.\n\t\t *\n\t\t * - The specified index is out of range.\n\t\t *\n\t\t * No rows are inserted in these cases.\n\t\t */\n\t\tinsertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\n\t\t/**\n\t\t * Sets the cell at the specified location in the table.\n\t\t * @remarks To remove a cell, call {@link TableSchema.Table.removeCell} instead.\n\t\t */\n\t\tsetCell(params: SetCellParameters<TCell, TColumn, TRow>): void;\n\n\t\t/**\n\t\t * Removes a range of columns from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Also removes any corresponding cells from the table's rows.\n\t\t *\n\t\t * Note: this operation can be slow for tables with many rows.\n\t\t * We are actively working on improving the performance of this operation, but for now it may have a negative\n\t\t * impact on performance.\n\t\t * @param index - The starting index of the range to remove. Default: `0`.\n\t\t * @param count - The number of columns to remove. Default: all remaining columns starting from `index`.\n\t\t * @throws Throws an error if the specified range is invalid. In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(\n\t\t\tindex?: number | undefined,\n\t\t\tcount?: number | undefined,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t\t/**\n\t\t * Removes 0 or more columns from the table.\n\t\t * @remarks\n\t\t * Also removes any corresponding cells from the table's rows.\n\t\t *\n\t\t * Note: this operation can be slow for tables with many rows.\n\t\t * We are actively working on improving the performance of this operation, but for now it may have a negative\n\t\t * impact on performance.\n\t\t *\n\t\t * @param columns - The columns to remove.\n\t\t * @throws Throws an error if any of the columns are not in the table.\n\t\t * In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(\n\t\t\tcolumns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[],\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t\t/**\n\t\t * Removes 0 or more columns from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Also removes any corresponding cells from the table's rows.\n\t\t *\n\t\t * Note: this operation can be slow for tables with many rows.\n\t\t * We are actively working on improving the performance of this operation, but for now it may have a negative\n\t\t * impact on performance.\n\t\t *\n\t\t * @param columns - The columns to remove, specified by their {@link TableSchema.Column.id}.\n\t\t * @throws Throws an error if any of the columns are not in the table.\n\t\t * In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(columns: readonly string[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\n\t\t/**\n\t\t * Removes a range of rows from the table.\n\t\t * @param index - The starting index of the range to remove. Default: `0`.\n\t\t * @param count - The number of rows to remove. Default: all remaining rows starting from `index`.\n\t\t * @throws Throws an error if the specified range is invalid. In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(\n\t\t\tindex?: number | undefined,\n\t\t\tcount?: number | undefined,\n\t\t): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\t\t/**\n\t\t * Removes 0 or more rows from the table.\n\t\t * @param rows - The rows to remove.\n\t\t * @throws Throws an error if any of the rows are not in the table.\n\t\t * In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(\n\t\t\trows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[],\n\t\t): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\t\t/**\n\t\t * Removes 0 or more rows from the table.\n\t\t * @param rows - The rows to remove, specified by their {@link TableSchema.Row.id}.\n\t\t * @throws Throws an error if any of the rows are not in the table.\n\t\t * In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\n\t\t/**\n\t\t * Removes the cell at the specified location in the table.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t * @throws Throws an error if the location does not exist in the table.\n\t\t */\n\t\tremoveCell(\n\t\t\tkey: CellKey<TColumn, TRow>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\t}\n\n\t/**\n\t * Input parameters for {@link TableSchema.Table}'s `create` factory method.\n\t * @input @alpha\n\t */\n\texport interface TableFactoryMethodParameters<\n\t\tTUserScope extends string,\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>,\n\t\tTRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>,\n\t> {\n\t\t/**\n\t\t * Initial columns for the table.\n\t\t */\n\t\treadonly columns?:\n\t\t\t| Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumn>>\n\t\t\t| undefined;\n\n\t\t/**\n\t\t * Initial rows for the table.\n\t\t * @remarks If any cells are specified, they will be validated against the IDs of the provided columns.\n\t\t */\n\t\treadonly rows?: Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRow>> | undefined;\n\t}\n\n\t/**\n\t * Factory for creating new table schema.\n\t * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TUserScope extends string,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<\n\t\t\tTUserScope,\n\t\t\tSchemaFactoryBeta<TUserScope>,\n\t\t\tTCell\n\t\t>,\n\t): System_TableSchema.TableSchemaBase<\n\t\tTUserScope,\n\t\tTCell,\n\t\tSystem_TableSchema.ColumnSchemaBase<\n\t\t\tTUserScope,\n\t\t\tTCell,\n\t\t\tSystem_TableSchema.DefaultPropsType\n\t\t>,\n\t\tSystem_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>\n\t>;\n\t/**\n\t * Factory for creating new table schema with custom column schema.\n\t * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TColumn - The type of the columns in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TUserScope extends string,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<\n\t\t\tTUserScope,\n\t\t\tSchemaFactoryBeta<TUserScope>,\n\t\t\tTCell\n\t\t> & {\n\t\t\treadonly column: TColumn;\n\t\t},\n\t): System_TableSchema.TableSchemaBase<\n\t\tTUserScope,\n\t\tTCell,\n\t\tTColumn,\n\t\tSystem_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>\n\t>;\n\t/**\n\t * Factory for creating new table schema with custom row schema.\n\t * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TRow - The type of the rows in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TUserScope extends string,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<\n\t\t\tTUserScope,\n\t\t\tSchemaFactoryBeta<TUserScope>,\n\t\t\tTCell\n\t\t> & {\n\t\t\treadonly row: TRow;\n\t\t},\n\t): System_TableSchema.TableSchemaBase<\n\t\tTUserScope,\n\t\tTCell,\n\t\tSystem_TableSchema.ColumnSchemaBase<\n\t\t\tTUserScope,\n\t\t\tTCell,\n\t\t\tSystem_TableSchema.DefaultPropsType\n\t\t>,\n\t\tTRow\n\t>;\n\t/**\n\t * Factory for creating new table schema with custom column and row schema.\n\t * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TColumn - The type of the columns in the table.\n\t * @typeParam TRow - The type of the rows in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TUserScope extends string,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>,\n\t\tconst TRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<\n\t\t\tTUserScope,\n\t\t\tSchemaFactoryBeta<TUserScope>,\n\t\t\tTCell\n\t\t> & {\n\t\t\treadonly column: TColumn;\n\t\t\treadonly row: TRow;\n\t\t},\n\t): System_TableSchema.TableSchemaBase<TUserScope, TCell, TColumn, TRow>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function table({\n\t\tschemaFactory,\n\t\tcell: cellSchema,\n\t\tcolumn: columnSchema = column({\n\t\t\tschemaFactory,\n\t\t\tcell: cellSchema,\n\t\t}),\n\t\trow: rowSchema = row({\n\t\t\tschemaFactory,\n\t\t\tcell: cellSchema,\n\t\t}),\n\t}: System_TableSchema.TableFactoryOptionsBase & {\n\t\treadonly column?: System_TableSchema.ColumnSchemaBase;\n\t\treadonly row?: System_TableSchema.RowSchemaBase;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createTableSchema(\n\t\t\tschemaFactory,\n\t\t\tcellSchema,\n\t\t\tcolumnSchema,\n\t\t\trowSchema,\n\t\t);\n\t}\n\n\t// #endregion\n}\n"]}
|
package/lib/util/brand.d.ts
CHANGED
|
@@ -112,4 +112,53 @@ export declare function brand<T>(value: T extends BrandedType<infer ValueType, u
|
|
|
112
112
|
* The dummy parameter is used to produce a compile error in the event where the value being branded is incompatible with the branded type.
|
|
113
113
|
*/
|
|
114
114
|
export declare function brandConst<const T>(value: T): <T2 extends BrandedType<unknown, unknown>>(...dummy: T extends (T2 extends BrandedType<infer ValueType, unknown> ? ValueType : never) ? [] : [never]) => T2 & T;
|
|
115
|
+
/**
|
|
116
|
+
* Removes a type brand from a branded value.
|
|
117
|
+
* @remarks
|
|
118
|
+
* This is useful when trying to do an exhaustive switch over a union of branded types,
|
|
119
|
+
* which for some reason fails if the brand is not removed from the "case" entries.
|
|
120
|
+
*/
|
|
121
|
+
export declare function unbrand<const T extends BrandedType<unknown, unknown>>(value: T): ValueFromBranded<T>;
|
|
122
|
+
/**
|
|
123
|
+
* Make an enum like object using {@link Brand} to brand the values.
|
|
124
|
+
* @remarks
|
|
125
|
+
* This has stricter typing than TypeScript built in enums since it does not allow implicit assignment of `number` to enums with a numeric value.
|
|
126
|
+
* It also blocks implicit conversions of individual constants to the enum type:
|
|
127
|
+
* such cases must use {@link brand} or get the branded value from the enum instead.
|
|
128
|
+
*
|
|
129
|
+
* One limitation is that narrowing does not work in switch statements:
|
|
130
|
+
* the values in each case can use {@link unbrand} to work around this.
|
|
131
|
+
*
|
|
132
|
+
* This object does not provide {@link https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings | reverse mappings}.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* const TestA = strictEnum("TestA", {
|
|
137
|
+
* a: 1,
|
|
138
|
+
* b: 2,
|
|
139
|
+
* });
|
|
140
|
+
* type TestA = Values<typeof TestA>;
|
|
141
|
+
*
|
|
142
|
+
* function switchUnbrand(x: TestA) {
|
|
143
|
+
* switch (x) {
|
|
144
|
+
* case unbrand(TestA.a):
|
|
145
|
+
* return "a";
|
|
146
|
+
* case unbrand(TestA.b):
|
|
147
|
+
* return "b";
|
|
148
|
+
* default:
|
|
149
|
+
* unreachableCase(x);
|
|
150
|
+
* }
|
|
151
|
+
* }
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
export declare function strictEnum<const T, const TBrand>(name: TBrand, entries: T): {
|
|
155
|
+
readonly [Property in keyof T]: Brand<T[Property], TBrand>;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Extracts the values of an object type as a union.
|
|
159
|
+
* @remarks
|
|
160
|
+
* Like `keyof` except for values.
|
|
161
|
+
* This is useful for extracting the value types of enums created with {@link strictEnum}.
|
|
162
|
+
*/
|
|
163
|
+
export type Values<T> = T[keyof T];
|
|
115
164
|
//# sourceMappingURL=brand.d.ts.map
|
package/lib/util/brand.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../../src/util/brand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,KAAK,CAAC,SAAS,EAAE,IAAI,IAAI,SAAS,GAAG,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,8BAAsB,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI;IACpD,SAAS,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5C;;;;;;;;OAQG;IACH,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAE5C;;OAEG;IACH,OAAO;IAEP;;;;OAIG;WACW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,KAAK;CAKhE;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,WAAW,CAC5F,MAAM,SAAS,EACf,OAAO,CACP,GACE,SAAS,GACT,KAAK,CAAC;AAET;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,WAAW,CAC3F,OAAO,EACP,MAAM,IAAI,CACV,GACE,IAAI,GACJ,KAAK,CAAC;AAET;;;;;;;;;;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,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAAE,CAIhE;AAED;;;;;GAKG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
package/lib/util/brand.js
CHANGED
|
@@ -78,4 +78,48 @@ export function brand(value) {
|
|
|
78
78
|
export function brandConst(value) {
|
|
79
79
|
return () => value;
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Removes a type brand from a branded value.
|
|
83
|
+
* @remarks
|
|
84
|
+
* This is useful when trying to do an exhaustive switch over a union of branded types,
|
|
85
|
+
* which for some reason fails if the brand is not removed from the "case" entries.
|
|
86
|
+
*/
|
|
87
|
+
export function unbrand(value) {
|
|
88
|
+
return value;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Make an enum like object using {@link Brand} to brand the values.
|
|
92
|
+
* @remarks
|
|
93
|
+
* This has stricter typing than TypeScript built in enums since it does not allow implicit assignment of `number` to enums with a numeric value.
|
|
94
|
+
* It also blocks implicit conversions of individual constants to the enum type:
|
|
95
|
+
* such cases must use {@link brand} or get the branded value from the enum instead.
|
|
96
|
+
*
|
|
97
|
+
* One limitation is that narrowing does not work in switch statements:
|
|
98
|
+
* the values in each case can use {@link unbrand} to work around this.
|
|
99
|
+
*
|
|
100
|
+
* This object does not provide {@link https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings | reverse mappings}.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* const TestA = strictEnum("TestA", {
|
|
105
|
+
* a: 1,
|
|
106
|
+
* b: 2,
|
|
107
|
+
* });
|
|
108
|
+
* type TestA = Values<typeof TestA>;
|
|
109
|
+
*
|
|
110
|
+
* function switchUnbrand(x: TestA) {
|
|
111
|
+
* switch (x) {
|
|
112
|
+
* case unbrand(TestA.a):
|
|
113
|
+
* return "a";
|
|
114
|
+
* case unbrand(TestA.b):
|
|
115
|
+
* return "b";
|
|
116
|
+
* default:
|
|
117
|
+
* unreachableCase(x);
|
|
118
|
+
* }
|
|
119
|
+
* }
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
export function strictEnum(name, entries) {
|
|
123
|
+
return entries;
|
|
124
|
+
}
|
|
81
125
|
//# sourceMappingURL=brand.js.map
|
package/lib/util/brand.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand.js","sourceRoot":"","sources":["../../src/util/brand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAwBtE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAgB,WAAW;IAahC;;OAEG;IACH,gBAAuB,CAAC;IAExB;;;;OAIG;IACI,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAY;QAC9C,MAAM,IAAI,UAAU,CACnB,0GAA0G,CAC1G,CAAC;IACH,CAAC;CACD;AAwBD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,KAAK,CACpB,KAA0E;IAE1E,OAAO,KAAU,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,UAAU,CACzB,KAAQ;IAMR,OAAO,GAAO,EAAE,CAAC,KAAe,CAAC;AAClC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { Covariant } from \"./typeCheck.js\";\n\n/**\n * Constructs a \"Branded\" type, adding a type-checking only field to `ValueType`.\n * @remarks\n * Two usages of `Brand` should never use the same `Name`.\n * If they do, the resulting types will be assignable which defeats the point of this type.\n *\n * This type is constructed such that the first line of type errors when assigning\n * mismatched branded types will be:\n * `Type 'Name1' is not assignable to type 'Name2'.`\n *\n * These branded types are not opaque: A `Brand<A, B>` can still be used as a `A`.\n *\n * @example Simple usage:\n * ```typescript\n * export type StrongId = Brand<string, \"tree.StrongId\">;\n * const x: StrongId = brand(\"myId\");\n * ```\n */\nexport type Brand<ValueType, Name> = ValueType & BrandedType<ValueType, Name>;\n\n/**\n * Implementation detail for {@link Brand}.\n *\n * See `MakeNominal` for some more details.\n *\n * Do not use this class with `instanceof`: this will always be false at runtime,\n * but the compiler may think it's true in some cases.\n *\n * @remarks\n * This is covariant over ValueType.\n * This is suitable for when ValueType is immutable (like string or number),\n * which is the common use-case for branding.\n *\n * @privateRemarks\n * This is split out into its own type as that's the only way to:\n *\n * - make the member protected (so you can't accidentally try and access it).\n * - get nominal typing (so types produced without using this class can never be assignable to it).\n *\n * @sealed\n */\nexport abstract class BrandedType<out ValueType, Name> {\n\tprotected _typeCheck?: Covariant<ValueType>;\n\t/**\n\t * Compile time only marker to make type checking more strict.\n\t * This method will not exist at runtime and accessing it is invalid.\n\t * See {@link Brand} for details.\n\t *\n\t * @privateRemarks\n\t * `Name` is used as the return type of a method rather than a a simple readonly member as this allows types with two brands to be intersected without getting `never`.\n\t * The method takes in never to help emphasize that its not callable.\n\t */\n\tprotected abstract brand(dummy: never): Name;\n\n\t/**\n\t * This class should never exist at runtime, so make it un-constructable.\n\t */\n\tprivate constructor() {}\n\n\t/**\n\t * Since this class is a compile time only type brand, `instanceof` will never work with it.\n\t * This `Symbol.hasInstance` implementation ensures that `instanceof` will error if used,\n\t * and in TypeScript 5.3 and newer will produce a compile time error if used.\n\t */\n\tpublic static [Symbol.hasInstance](value: never): value is never {\n\t\tthrow new UsageError(\n\t\t\t\"BrandedType is a compile time type brand not a real class that can be used with `instanceof` at runtime.\",\n\t\t);\n\t}\n}\n\n/**\n * Implementation detail of type branding. Should not be used directly outside this file,\n * but shows up as part of branded types so API-Extractor requires it to be exported.\n */\nexport type ValueFromBranded<T extends BrandedType<unknown, unknown>> = T extends BrandedType<\n\tinfer ValueType,\n\tunknown\n>\n\t? ValueType\n\t: never;\n\n/**\n * Implementation detail of type branding. Should not be used directly outside this file,\n * but shows up as part of branded types so API-Extractor requires it to be exported.\n */\nexport type NameFromBranded<T extends BrandedType<unknown, unknown>> = T extends BrandedType<\n\tunknown,\n\tinfer Name\n>\n\t? Name\n\t: never;\n\n/**\n * Adds a type {@link Brand} to a value.\n *\n * Only do this when specifically allowed by the requirements of the type being converted to.\n * @remarks\n * This infers the branded type from context so it can very easily be used to a semantically invalid conversion.\n * Treat this like \"as\" casts: they are an indicator that the user/reader must ensure the conversion is valid.\n *\n * If branding a constant, and wanting to preserve the exact typing of the constant, use {@link brandConst} instead.\n * @privateRemarks\n * Leaving `T` unconstrained here allows for better type inference when branding unions.\n * For example when assigning `brand(number)` a number to an optional branded number field,\n * constraining T to `BrandedType<unknown, string>` causes the inference to fail and requires explicitly providing the type parameter.\n * For example leaving T unconstrained instead allows the union of `BrandedType | undefined` to distribute over the conditional allowing the branding only the the union members which should be branded.\n * This does not permit branding an optional value into an optional field since non branded union members are still excluded from input to this function:\n * this is an intended restriction as it causes compile errors for misuse of this function (like using brand when the relevant type is not a branded type).\n */\nexport function brand<T>(\n\tvalue: T extends BrandedType<infer ValueType, unknown> ? ValueType : never,\n): T {\n\treturn value as T;\n}\n\n/**\n * Adds a type {@link Brand} to a value, while preserving the exact type of the value being branded.\n * @remarks\n * This takes in the type to brand to as a required type parameter, unlike {@link brand} which infers it from context.\n * This also preserves the exact type of the value being branded.\n * TypeScript has no way to take an explicit type parameter and infer another in a single generic context.\n * To work around this, two generic contexts are used, first a function to infer the parameter type,\n * and a second function (returned) to take the explicit type parameter.\n *\n * This is intended for use when branding constants.\n * @example\n * ```typescript\n * const requiredIdentifier = brandConst(\"Value\")<FieldKindIdentifier>();\n * ```\n * @privateRemarks\n * The dummy parameter is used to produce a compile error in the event where the value being branded is incompatible with the branded type.\n */\nexport function brandConst<const T>(\n\tvalue: T,\n): <T2 extends BrandedType<unknown, unknown>>(\n\t...dummy: T extends (T2 extends BrandedType<infer ValueType, unknown> ? ValueType : never)\n\t\t? []\n\t\t: [never]\n) => T2 & T {\n\treturn <T2>() => value as T2 & T;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"brand.js","sourceRoot":"","sources":["../../src/util/brand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAwBtE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAgB,WAAW;IAahC;;OAEG;IACH,gBAAuB,CAAC;IAExB;;;;OAIG;IACI,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAY;QAC9C,MAAM,IAAI,UAAU,CACnB,0GAA0G,CAC1G,CAAC;IACH,CAAC;CACD;AAwBD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,KAAK,CACpB,KAA0E;IAE1E,OAAO,KAAU,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,UAAU,CACzB,KAAQ;IAMR,OAAO,GAAO,EAAE,CAAC,KAAe,CAAC;AAClC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CACtB,KAAQ;IAER,OAAO,KAAc,CAAC;AACvB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,UAAU,CACzB,IAAY,EACZ,OAAU;IAEV,OAAO,OAEN,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { Covariant } from \"./typeCheck.js\";\n\n/**\n * Constructs a \"Branded\" type, adding a type-checking only field to `ValueType`.\n * @remarks\n * Two usages of `Brand` should never use the same `Name`.\n * If they do, the resulting types will be assignable which defeats the point of this type.\n *\n * This type is constructed such that the first line of type errors when assigning\n * mismatched branded types will be:\n * `Type 'Name1' is not assignable to type 'Name2'.`\n *\n * These branded types are not opaque: A `Brand<A, B>` can still be used as a `A`.\n *\n * @example Simple usage:\n * ```typescript\n * export type StrongId = Brand<string, \"tree.StrongId\">;\n * const x: StrongId = brand(\"myId\");\n * ```\n */\nexport type Brand<ValueType, Name> = ValueType & BrandedType<ValueType, Name>;\n\n/**\n * Implementation detail for {@link Brand}.\n *\n * See `MakeNominal` for some more details.\n *\n * Do not use this class with `instanceof`: this will always be false at runtime,\n * but the compiler may think it's true in some cases.\n *\n * @remarks\n * This is covariant over ValueType.\n * This is suitable for when ValueType is immutable (like string or number),\n * which is the common use-case for branding.\n *\n * @privateRemarks\n * This is split out into its own type as that's the only way to:\n *\n * - make the member protected (so you can't accidentally try and access it).\n * - get nominal typing (so types produced without using this class can never be assignable to it).\n *\n * @sealed\n */\nexport abstract class BrandedType<out ValueType, Name> {\n\tprotected _typeCheck?: Covariant<ValueType>;\n\t/**\n\t * Compile time only marker to make type checking more strict.\n\t * This method will not exist at runtime and accessing it is invalid.\n\t * See {@link Brand} for details.\n\t *\n\t * @privateRemarks\n\t * `Name` is used as the return type of a method rather than a a simple readonly member as this allows types with two brands to be intersected without getting `never`.\n\t * The method takes in never to help emphasize that its not callable.\n\t */\n\tprotected abstract brand(dummy: never): Name;\n\n\t/**\n\t * This class should never exist at runtime, so make it un-constructable.\n\t */\n\tprivate constructor() {}\n\n\t/**\n\t * Since this class is a compile time only type brand, `instanceof` will never work with it.\n\t * This `Symbol.hasInstance` implementation ensures that `instanceof` will error if used,\n\t * and in TypeScript 5.3 and newer will produce a compile time error if used.\n\t */\n\tpublic static [Symbol.hasInstance](value: never): value is never {\n\t\tthrow new UsageError(\n\t\t\t\"BrandedType is a compile time type brand not a real class that can be used with `instanceof` at runtime.\",\n\t\t);\n\t}\n}\n\n/**\n * Implementation detail of type branding. Should not be used directly outside this file,\n * but shows up as part of branded types so API-Extractor requires it to be exported.\n */\nexport type ValueFromBranded<T extends BrandedType<unknown, unknown>> = T extends BrandedType<\n\tinfer ValueType,\n\tunknown\n>\n\t? ValueType\n\t: never;\n\n/**\n * Implementation detail of type branding. Should not be used directly outside this file,\n * but shows up as part of branded types so API-Extractor requires it to be exported.\n */\nexport type NameFromBranded<T extends BrandedType<unknown, unknown>> = T extends BrandedType<\n\tunknown,\n\tinfer Name\n>\n\t? Name\n\t: never;\n\n/**\n * Adds a type {@link Brand} to a value.\n *\n * Only do this when specifically allowed by the requirements of the type being converted to.\n * @remarks\n * This infers the branded type from context so it can very easily be used to a semantically invalid conversion.\n * Treat this like \"as\" casts: they are an indicator that the user/reader must ensure the conversion is valid.\n *\n * If branding a constant, and wanting to preserve the exact typing of the constant, use {@link brandConst} instead.\n * @privateRemarks\n * Leaving `T` unconstrained here allows for better type inference when branding unions.\n * For example when assigning `brand(number)` a number to an optional branded number field,\n * constraining T to `BrandedType<unknown, string>` causes the inference to fail and requires explicitly providing the type parameter.\n * For example leaving T unconstrained instead allows the union of `BrandedType | undefined` to distribute over the conditional allowing the branding only the the union members which should be branded.\n * This does not permit branding an optional value into an optional field since non branded union members are still excluded from input to this function:\n * this is an intended restriction as it causes compile errors for misuse of this function (like using brand when the relevant type is not a branded type).\n */\nexport function brand<T>(\n\tvalue: T extends BrandedType<infer ValueType, unknown> ? ValueType : never,\n): T {\n\treturn value as T;\n}\n\n/**\n * Adds a type {@link Brand} to a value, while preserving the exact type of the value being branded.\n * @remarks\n * This takes in the type to brand to as a required type parameter, unlike {@link brand} which infers it from context.\n * This also preserves the exact type of the value being branded.\n * TypeScript has no way to take an explicit type parameter and infer another in a single generic context.\n * To work around this, two generic contexts are used, first a function to infer the parameter type,\n * and a second function (returned) to take the explicit type parameter.\n *\n * This is intended for use when branding constants.\n * @example\n * ```typescript\n * const requiredIdentifier = brandConst(\"Value\")<FieldKindIdentifier>();\n * ```\n * @privateRemarks\n * The dummy parameter is used to produce a compile error in the event where the value being branded is incompatible with the branded type.\n */\nexport function brandConst<const T>(\n\tvalue: T,\n): <T2 extends BrandedType<unknown, unknown>>(\n\t...dummy: T extends (T2 extends BrandedType<infer ValueType, unknown> ? ValueType : never)\n\t\t? []\n\t\t: [never]\n) => T2 & T {\n\treturn <T2>() => value as T2 & T;\n}\n\n/**\n * Removes a type brand from a branded value.\n * @remarks\n * This is useful when trying to do an exhaustive switch over a union of branded types,\n * which for some reason fails if the brand is not removed from the \"case\" entries.\n */\nexport function unbrand<const T extends BrandedType<unknown, unknown>>(\n\tvalue: T,\n): ValueFromBranded<T> {\n\treturn value as never;\n}\n\n/**\n * Make an enum like object using {@link Brand} to brand the values.\n * @remarks\n * This has stricter typing than TypeScript built in enums since it does not allow implicit assignment of `number` to enums with a numeric value.\n * It also blocks implicit conversions of individual constants to the enum type:\n * such cases must use {@link brand} or get the branded value from the enum instead.\n *\n * One limitation is that narrowing does not work in switch statements:\n * the values in each case can use {@link unbrand} to work around this.\n *\n * This object does not provide {@link https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings | reverse mappings}.\n *\n * @example\n * ```typescript\n * const TestA = strictEnum(\"TestA\", {\n * \ta: 1,\n * \tb: 2,\n * });\n * type TestA = Values<typeof TestA>;\n *\n * function switchUnbrand(x: TestA) {\n * \tswitch (x) {\n * \t\tcase unbrand(TestA.a):\n * \t\t\treturn \"a\";\n * \t\tcase unbrand(TestA.b):\n * \t\t\treturn \"b\";\n * \t\tdefault:\n * \t\t\tunreachableCase(x);\n * \t}\n * }\n * ```\n */\nexport function strictEnum<const T, const TBrand>(\n\tname: TBrand,\n\tentries: T,\n): { readonly [Property in keyof T]: Brand<T[Property], TBrand> } {\n\treturn entries as {\n\t\treadonly [Property in keyof T]: Brand<T[Property], TBrand>;\n\t};\n}\n\n/**\n * Extracts the values of an object type as a union.\n * @remarks\n * Like `keyof`\texcept for values.\n * This is useful for extracting the value types of enums created with {@link strictEnum}.\n */\nexport type Values<T> = T[keyof T];\n"]}
|
package/lib/util/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { validateIndex, validateIndexRange, validatePositiveIndex, validateSafeInteger, } from "./arrayUtilities.js";
|
|
6
|
-
export { brand, type Brand, BrandedType, type NameFromBranded, type ValueFromBranded, brandConst, } from "./brand.js";
|
|
6
|
+
export { brand, type Brand, BrandedType, type NameFromBranded, type ValueFromBranded, brandConst, type Values, strictEnum, unbrand, } from "./brand.js";
|
|
7
7
|
export { brandedNumberType, brandedStringType } from "./typeboxBrand.js";
|
|
8
8
|
export { brandOpaque, extractFromOpaque, type ExtractFromOpaque, type Opaque, } from "./opaque.js";
|
|
9
9
|
export { deleteFromNestedMap, getOrAddInNestedMap, getOrDefaultInNestedMap, forEachInNestedMap, type NestedMap, type ReadonlyNestedMap, SizedNestedMap, populateNestedMap, setInNestedMap, tryAddToNestedMap, tryGetFromNestedMap, mapNestedMap, nestedMapToFlatList, nestedMapFromFlatList, getOrCreateInNestedMap, } from "./nestedMap.js";
|
|
@@ -21,4 +21,5 @@ export { type IdAllocator, idAllocatorFromMaxId, idAllocatorFromState, type IdAl
|
|
|
21
21
|
export { Breakable, type WithBreakable, breakingMethod, throwIfBroken, breakingClass, } from "./breakable.js";
|
|
22
22
|
export { type TupleBTree, newTupleBTree, mergeTupleBTrees } from "./bTreeUtils.js";
|
|
23
23
|
export { cloneWithReplacements } from "./cloneWithReplacements.js";
|
|
24
|
+
export { readAndParseSnapshotBlob } from "./readSnapshotBlob.js";
|
|
24
25
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/util/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,KAAK,EACL,KAAK,KAAK,EACV,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,KAAK,EACL,KAAK,KAAK,EACV,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,UAAU,EACV,KAAK,MAAM,EACX,UAAU,EACV,OAAO,GACP,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,MAAM,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,KAAK,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,KAAK,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACrE,YAAY,EACX,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,WAAW,EACX,qBAAqB,EACrB,SAAS,EACT,KAAK,EACL,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,WAAW,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACN,SAAS,EACT,cAAc,EACd,KAAK,EACL,W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