@fluidframework/tree 2.40.0-336023 → 2.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/api-report/tree.alpha.api.md +4 -1
- package/dist/alpha.d.ts +1 -0
- package/dist/codec/codec.d.ts +5 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +6 -2
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +2 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
- package/dist/core/schema-stored/formatV1.d.ts.map +1 -0
- package/dist/core/schema-stored/{format.js → formatV1.js} +1 -1
- package/dist/core/schema-stored/formatV1.js.map +1 -0
- package/dist/core/schema-stored/index.d.ts +3 -3
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +3 -3
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +3 -1
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +8 -6
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/schema-view/index.d.ts +1 -1
- package/dist/core/schema-view/index.d.ts.map +1 -1
- package/dist/core/schema-view/index.js +1 -2
- package/dist/core/schema-view/index.js.map +1 -1
- package/dist/core/schema-view/view.d.ts +0 -27
- package/dist/core/schema-view/view.d.ts.map +1 -1
- package/dist/core/schema-view/view.js +1 -35
- package/dist/core/schema-view/view.js.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
- package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +1 -1
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +4 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts +3 -3
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +2 -2
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -5
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +34 -5
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +63 -9
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/{lib/feature-libraries/schema-index/format.d.ts → dist/feature-libraries/schema-index/formatV1.d.ts} +9 -9
- package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
- package/dist/feature-libraries/schema-index/{format.js → formatV1.js} +4 -4
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -0
- package/dist/feature-libraries/schema-index/index.d.ts +2 -2
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +6 -3
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +4 -4
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- 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.map +1 -1
- package/dist/shared-tree/independentView.js +1 -1
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +8 -9
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +9 -33
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +1 -4
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +28 -3
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +29 -3
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/tree.d.ts +24 -0
- package/dist/shared-tree/tree.d.ts.map +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +2 -0
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +3 -2
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts +0 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +0 -1
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js +4 -1
- package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +9 -0
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +7 -0
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +8 -7
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +13 -9
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +25 -0
- 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/treeBeta.d.ts +4 -1
- package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.d.ts +83 -0
- package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
- package/dist/simple-tree/api/treeChangeEvents.js +7 -0
- package/dist/simple-tree/api/treeChangeEvents.js.map +1 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts +2 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +28 -0
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.d.ts +1 -1
- package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +2 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +5 -5
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts +94 -0
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -0
- package/dist/simple-tree/core/treeNode.js +123 -0
- package/dist/simple-tree/core/treeNode.js.map +1 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts +2 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +3 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts +0 -165
- package/dist/simple-tree/core/types.d.ts.map +1 -1
- package/dist/simple-tree/core/types.js +1 -113
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +1 -1
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +3 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +1 -0
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +8 -8
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +27 -32
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/tableSchema.d.ts +302 -83
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +299 -57
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts +1 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +30 -75
- package/dist/treeFactory.js.map +1 -1
- package/lib/alpha.d.ts +1 -0
- package/lib/codec/codec.d.ts +5 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +5 -1
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
- package/lib/core/schema-stored/formatV1.d.ts.map +1 -0
- package/lib/core/schema-stored/{format.js → formatV1.js} +1 -1
- package/lib/core/schema-stored/formatV1.js.map +1 -0
- package/lib/core/schema-stored/index.d.ts +3 -3
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +2 -2
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +3 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -1
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/schema-view/index.d.ts +1 -1
- package/lib/core/schema-view/index.d.ts.map +1 -1
- package/lib/core/schema-view/index.js +1 -1
- package/lib/core/schema-view/index.js.map +1 -1
- package/lib/core/schema-view/view.d.ts +0 -27
- package/lib/core/schema-view/view.d.ts.map +1 -1
- package/lib/core/schema-view/view.js +0 -34
- package/lib/core/schema-view/view.js.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.d.ts +4 -4
- package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.js +2 -2
- package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +2 -2
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts +3 -3
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js +2 -2
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js +3 -3
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -6
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +34 -5
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +61 -9
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/{dist/feature-libraries/schema-index/format.d.ts → lib/feature-libraries/schema-index/formatV1.d.ts} +9 -9
- package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
- package/lib/feature-libraries/schema-index/{format.js → formatV1.js} +5 -5
- package/lib/feature-libraries/schema-index/formatV1.js.map +1 -0
- package/lib/feature-libraries/schema-index/index.d.ts +2 -2
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +2 -2
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +5 -5
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- 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.map +1 -1
- package/lib/shared-tree/independentView.js +2 -2
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +8 -9
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +10 -34
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +2 -5
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +28 -3
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +29 -4
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/tree.d.ts +24 -0
- package/lib/shared-tree/tree.d.ts.map +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +2 -0
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +4 -3
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts +0 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +0 -1
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js +4 -1
- package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +9 -0
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +7 -0
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +8 -7
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +17 -11
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +25 -0
- 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/treeBeta.d.ts +4 -1
- package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.d.ts +83 -0
- package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
- package/lib/simple-tree/api/treeChangeEvents.js +6 -0
- package/lib/simple-tree/api/treeChangeEvents.js.map +1 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts +2 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +28 -0
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.d.ts +1 -1
- package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +2 -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/treeNode.d.ts +94 -0
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -0
- package/lib/simple-tree/core/treeNode.js +118 -0
- package/lib/simple-tree/core/treeNode.js.map +1 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts +2 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +3 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts +0 -165
- package/lib/simple-tree/core/types.d.ts.map +1 -1
- package/lib/simple-tree/core/types.js +0 -110
- package/lib/simple-tree/core/types.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +1 -1
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +1 -0
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +8 -8
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +26 -31
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/tableSchema.d.ts +302 -83
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +299 -57
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts +1 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +30 -75
- package/lib/treeFactory.js.map +1 -1
- package/package.json +21 -21
- package/src/codec/codec.ts +6 -1
- package/src/codec/index.ts +1 -0
- package/src/core/index.ts +1 -2
- package/src/core/schema-stored/index.ts +3 -3
- package/src/core/schema-stored/schema.ts +3 -1
- package/src/core/schema-stored/storedSchemaRepository.ts +1 -1
- package/src/core/schema-view/index.ts +0 -1
- package/src/core/schema-view/view.ts +0 -31
- package/src/core/tree/persistedTreeTextFormat.ts +2 -2
- package/src/feature-libraries/forest-summary/format.ts +2 -2
- package/src/feature-libraries/index.ts +7 -1
- package/src/feature-libraries/mapTreeCursor.ts +3 -3
- package/src/feature-libraries/modular-schema/modularChangeFormat.ts +3 -3
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +38 -9
- package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +3 -4
- package/src/feature-libraries/schema-index/codec.ts +80 -12
- package/src/feature-libraries/schema-index/{format.ts → formatV1.ts} +4 -4
- package/src/feature-libraries/schema-index/index.ts +7 -2
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +9 -9
- package/src/index.ts +1 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +3 -2
- package/src/shared-tree/index.ts +2 -0
- package/src/shared-tree/schematizeTree.ts +5 -35
- package/src/shared-tree/schematizingTreeView.ts +2 -10
- package/src/shared-tree/sharedTree.ts +67 -6
- package/src/shared-tree/tree.ts +24 -0
- package/src/shared-tree/treeAlpha.ts +6 -3
- package/src/shared-tree-core/branchCommitEnricher.ts +0 -1
- package/src/shared-tree-core/transactionEnricher.ts +4 -1
- package/src/simple-tree/api/index.ts +2 -0
- package/src/simple-tree/api/schemaFactory.ts +9 -0
- package/src/simple-tree/api/storedSchema.ts +24 -13
- package/src/simple-tree/api/tree.ts +25 -0
- package/src/simple-tree/api/treeBeta.ts +3 -1
- package/src/simple-tree/api/treeChangeEvents.ts +84 -0
- package/src/simple-tree/api/treeNodeApi.ts +1 -1
- package/src/simple-tree/arrayNode.ts +28 -0
- package/src/simple-tree/core/getOrCreateNode.ts +1 -1
- package/src/simple-tree/core/index.ts +5 -4
- package/src/simple-tree/core/treeNode.ts +163 -0
- package/src/simple-tree/core/treeNodeKernel.ts +2 -1
- package/src/simple-tree/core/treeNodeSchema.ts +3 -1
- package/src/simple-tree/core/types.ts +0 -234
- package/src/simple-tree/core/withType.ts +1 -1
- package/src/simple-tree/index.ts +2 -1
- package/src/simple-tree/schemaTypes.ts +1 -0
- package/src/simple-tree/toStoredSchema.ts +42 -41
- package/src/tableSchema.ts +665 -197
- package/src/treeFactory.ts +56 -173
- package/dist/core/schema-stored/format.d.ts.map +0 -1
- package/dist/core/schema-stored/format.js.map +0 -1
- package/dist/feature-libraries/schema-index/format.d.ts.map +0 -1
- package/dist/feature-libraries/schema-index/format.js.map +0 -1
- package/lib/core/schema-stored/format.d.ts.map +0 -1
- package/lib/core/schema-stored/format.js.map +0 -1
- package/lib/feature-libraries/schema-index/format.d.ts.map +0 -1
- package/lib/feature-libraries/schema-index/format.js.map +0 -1
- /package/src/core/schema-stored/{format.ts → formatV1.ts} +0 -0
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,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAE1D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EASN,aAAa,EAWb,aAAa,GAGb,MAAM,wBAAwB,CAAC;AAEhC,yFAAyF;AACzF,oDAAoD;AACpD,2EAA2E;AAE3E,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAE3C;;;;;;;;;GASG;AACH,MAAM,KAAW,kBAAkB,CA8jBlC;AA9jBD,WAAiB,kBAAkB;IA2ClC;;;OAGG;IACH,sIAAsI;IACtI,SAAgB,oBAAoB,CAGlC,kBAAmD,EAAE,WAAyB;QAC/E,MAAM,aAAa,GAAG,kBAAkB,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;QAGnF,gFAAgF;QAChF,yCAAyC;QACzC,kDAAkD;QAClD,MAAM,wBAAwB,GAAG;YAChC,EAAE,EAAE,aAAa,CAAC,UAAU;SACnB,CAAC;QACX,MAAM,qBAAqB,GAAG;YAC7B,KAAK,EAAE,WAAW;SACT,CAAC;QAEX;;;;;;;;;;WAUG;QACH,MA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C,mBAAmB,CAAC,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IACjF,CAAC;IAfe,uBAAW,cAe1B,CAAA;IAED,aAAa;AACd,CAAC,EAzZgB,WAAW,KAAX,WAAW,QAyZ3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { oob } from \"@fluidframework/core-utils/internal\";\n\nimport { Tree } from \"./shared-tree/index.js\";\nimport {\n\ttype FieldHasDefault,\n\ttype ImplicitAllowedTypes,\n\ttype ImplicitFieldSchema,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeKind,\n\ttype SchemaFactoryAlpha,\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\ttype FieldSchema,\n\ttype FieldKind,\n\tSchemaFactory,\n\ttype ImplicitAnnotatedFieldSchema,\n\ttype UnannotateImplicitFieldSchema,\n} from \"./simple-tree/index.js\";\n\n// Future improvement TODOs (ideally to be done before promoting these APIs to `@alpha`):\n// - Record-like type parameters / input parameters?\n// - Omit `props` properties from Row and Column schemas when not provided?\n\nconst tableSchemaFactorySubScope = \"table\";\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 @internal\n */\nexport namespace System_TableSchema {\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 @internal\n\t */\n\texport interface OptionsWithSchemaFactory<\n\t\tTScope extends string | undefined = string | undefined,\n\t> {\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: SchemaFactoryAlpha<TScope>;\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 @internal\n\t */\n\texport interface OptionsWithCellSchema<\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> {\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 @internal\n\t */\n\texport type CreateColumnOptionsBase<\n\t\tTInputScope extends string | undefined = string | undefined,\n\t> = OptionsWithSchemaFactory<TInputScope>;\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @system @internal\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 createColumnInternal<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TPropsSchema extends ImplicitAnnotatedFieldSchema,\n\t>(inputSchemaFactory: SchemaFactoryAlpha<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.objectAlpha(\"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.IColumn<TPropsSchema> {}\n\n\t\ttype ColumnValueType = TreeNode &\n\t\t\tTableSchema.IColumn<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<UnannotateImplicitFieldSchema<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 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<\n\t\t\t\t\t\t\tUnannotateImplicitFieldSchema<TPropsSchema>\n\t\t\t\t\t\t>;\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<\n\t\t\t\t\t\t\tUnannotateImplicitFieldSchema<TPropsSchema>\n\t\t\t\t\t\t>;\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 @internal\n\t */\n\texport type ColumnSchemaBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> = ReturnType<typeof TableSchema.createColumn<TScope, 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 @internal\n\t */\n\texport type CreateRowOptionsBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TScope> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating new table row schema.\n\t *\n\t * @sealed @internal\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 createRowInternal<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TPropsSchema extends ImplicitFieldSchema,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryAlpha<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\ttype CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\t\ttype CellInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TCellSchema>;\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\tcells: schemaFactory.required(schemaFactory.map(\"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 Row} 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 Row\n\t\t\textends schemaFactory.objectAlpha(\"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 TableSchema.IRow<TCellSchema, TPropsSchema>\n\t\t{\n\t\t\tpublic getCell(columnOrId: TableSchema.IColumn | string): CellValueType | undefined {\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t\treturn this.cells.get(columnId) as CellValueType | undefined;\n\t\t\t}\n\n\t\t\tpublic setCell(\n\t\t\t\tcolumnOrId: TableSchema.IColumn | string,\n\t\t\t\tvalue: CellInsertableType | undefined,\n\t\t\t): void {\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t\tthis.cells.set(columnId, value);\n\t\t\t}\n\n\t\t\tpublic removeCell(columnOrId: TableSchema.IColumn | string): void {\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t\tif (!this.cells.has(columnId)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.cells.delete(columnId);\n\t\t\t}\n\t\t}\n\n\t\ttype RowValueType = TreeNode &\n\t\t\tTableSchema.IRow<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 `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 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 Row]: (typeof Row)[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) => Row) & {\n\t\t\t\tcreateFromInsertable(parameters: RowInsertableType): Row;\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> = Row as RowSchemaModifiedType;\n\n\t\treturn RowSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @internal\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 TableSchema.createRow<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 @internal\n\t */\n\texport type TableFactoryOptionsBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TScope> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating new table schema.\n\t * @system @internal\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 createTableInternal<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TColumnSchema extends ColumnSchemaBase<TInputScope> = ColumnSchemaBase<TInputScope>,\n\t\tconst TRowSchema extends RowSchemaBase<TInputScope, TCellSchema> = RowSchemaBase<\n\t\t\tTInputScope,\n\t\t\tTCellSchema\n\t\t>,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryAlpha<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 CellInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\n\t\ttype ColumnValueType = TreeNodeFromImplicitAllowedTypes<TColumnSchema>;\n\t\ttype ColumnInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>;\n\n\t\ttype RowValueType = TreeNodeFromImplicitAllowedTypes<TRowSchema>;\n\t\ttype RowInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>;\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.objectAlpha(\"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.ITable<TCellSchema, TColumnSchema, TRowSchema>\n\t\t{\n\t\t\tpublic getColumn(id: string): ColumnValueType | undefined {\n\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.columns.find((column) => (column as ColumnValueType).id === id) as\n\t\t\t\t\t| ColumnValueType\n\t\t\t\t\t| undefined;\n\t\t\t}\n\n\t\t\tpublic getRow(id: string): RowValueType | undefined {\n\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.rows.find((_row) => (_row as RowValueType).id === id) as\n\t\t\t\t\t| RowValueType\n\t\t\t\t\t| undefined;\n\t\t\t}\n\n\t\t\tpublic getCell(key: TableSchema.CellKey): CellValueType | undefined {\n\t\t\t\tconst { columnId, rowId } = key;\n\t\t\t\tconst row = this.getRow(rowId);\n\t\t\t\tif (row !== undefined) {\n\t\t\t\t\tconst column = this.getColumn(columnId);\n\t\t\t\t\tif (column !== undefined) {\n\t\t\t\t\t\treturn row.getCell(column.id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the cell does not exist return undefined\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tpublic insertColumn({\n\t\t\t\tcolumn,\n\t\t\t\tindex,\n\t\t\t}: TableSchema.InsertColumnParameters<ColumnInsertableType>): ColumnValueType {\n\t\t\t\tif (index === undefined) {\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\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.columns.insertAtEnd(column as any);\n\t\t\t\t} else {\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\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.columns.insertAt(index, column as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input node into the tree hydrates it, making it usable as a node.\n\t\t\t\treturn column 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<RowInsertableType>): RowValueType[] {\n\t\t\t\tif (index === undefined) {\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\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// 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\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({ key, cell }: TableSchema.SetCellParameters<CellInsertableType>): void {\n\t\t\t\tconst { columnId, rowId } = key;\n\t\t\t\tconst row = this.getRow(rowId);\n\t\t\t\tif (row !== undefined) {\n\t\t\t\t\tconst column = this.getColumn(columnId);\n\t\t\t\t\tif (column !== undefined) {\n\t\t\t\t\t\trow.setCell(column.id, cell);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic removeColumn(column: ColumnValueType): void {\n\t\t\t\tconst index = this.columns.indexOf(column);\n\t\t\t\t// If the column is not in the table, do nothing\n\t\t\t\tif (index === -1) return;\n\t\t\t\tthis.columns.removeAt(index);\n\t\t\t}\n\n\t\t\tpublic removeRows(rows: readonly RowValueType[]): void {\n\t\t\t\t// If there are no rows to remove, do nothing\n\t\t\t\tif (rows.length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If there is only one row to remove, remove it\n\t\t\t\tif (rows.length === 1) {\n\t\t\t\t\tconst index = this.rows.indexOf(rows[0] ?? oob());\n\t\t\t\t\tthis.rows.removeAt(index);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// If there are multiple rows to remove, remove them in a transaction\n\t\t\t\t// This is to avoid the performance issues of deleting multiple rows at once\n\t\t\t\tTree.runTransaction(this, () => {\n\t\t\t\t\t// Iterate over the rows and remove them\n\t\t\t\t\tfor (const row of rows) {\n\t\t\t\t\t\tconst index = this.rows.indexOf(row);\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}\n\n\t\t\tpublic removeAllRows(): void {\n\t\t\t\tthis.rows.removeRange();\n\t\t\t}\n\n\t\t\tpublic removeCell(key: TableSchema.CellKey): void {\n\t\t\t\tconst { columnId, rowId } = key;\n\t\t\t\tconst row = this.getRow(rowId);\n\t\t\t\tif (row !== undefined) {\n\t\t\t\t\tconst column = this.getColumn(columnId);\n\t\t\t\t\tif (column !== undefined) {\n\t\t\t\t\t\trow.removeCell(column.id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttype TableValueType = TreeNode &\n\t\t\tTableSchema.ITable<TCellSchema, TColumnSchema, TRowSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Table\">>;\n\t\ttype TableInsertableType = InsertableObjectFromSchemaRecord<typeof tableFields>;\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> = 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 @internal\n\t */\n\texport type TableSchemaBase<\n\t\tTScope extends string | undefined,\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ColumnSchemaBase<TScope> = ColumnSchemaBase<TScope>,\n\t\tTRow extends RowSchemaBase<TScope, TCell, ImplicitAllowedTypes> = RowSchemaBase<\n\t\t\tTScope,\n\t\t\tTCell,\n\t\t\tImplicitAllowedTypes\n\t\t>,\n\t> = ReturnType<typeof TableSchema.createTable<TScope, TCell, TColumn, TRow>>;\n\n\t// #endregion\n}\n\n/**\n * Contains types and factories for creating schema to represent dynamic tabular data.\n * @privateRemarks TODO: document in more detail and add `@example`s.\n * @internal\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.(createColumn:2)}.\n\t * @sealed @internal\n\t */\n\texport interface IColumn<\n\t\tTProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema,\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 createColumn}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps>> | undefined;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<\n\t\t\tUnannotateImplicitFieldSchema<TProps>\n\t\t>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @internal\n\t */\n\texport function createColumn<const TScope extends string | undefined>({\n\t\tschemaFactory,\n\t}: System_TableSchema.CreateColumnOptionsBase<TScope>): ReturnType<\n\t\ttypeof System_TableSchema.createColumnInternal<\n\t\t\tTScope,\n\t\t\tFieldSchema<FieldKind.Optional, typeof SchemaFactoryAlpha.null>\n\t\t>\n\t>;\n\t/**\n\t * Factory for creating new table column schema.\n\t * @internal\n\t */\n\texport function createColumn<\n\t\tconst TScope extends string | undefined,\n\t\tconst TProps extends ImplicitFieldSchema,\n\t>({\n\t\tschemaFactory,\n\t\tprops,\n\t}: System_TableSchema.CreateColumnOptionsBase<TScope> & {\n\t\t/**\n\t\t * Optional column properties.\n\t\t */\n\t\treadonly props: TProps;\n\t}): ReturnType<typeof System_TableSchema.createColumnInternal<TScope, TProps>>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function createColumn({\n\t\tschemaFactory,\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.createColumnInternal(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.(createRow:2)}.\n\t * @sealed @internal\n\t */\n\texport interface IRow<\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema,\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 * Gets the cell in the specified column.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t */\n\t\tgetCell(column: IColumn): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\t\t/**\n\t\t * Gets the cell in the specified column, denoted by column ID.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t */\n\t\tgetCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * Sets the cell in the specified column.\n\t\t * @remarks To remove a cell, call {@link TableSchema.IRow.(removeCell:1)} instead.\n\t\t */\n\t\tsetCell(column: IColumn, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;\n\t\t/**\n\t\t * Sets the cell in the specified column, denoted by column ID.\n\t\t * @remarks To remove a cell, call {@link TableSchema.IRow.(removeCell:2)} instead.\n\t\t */\n\t\tsetCell(columnId: string, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;\n\n\t\t/**\n\t\t * Removes the cell in the specified column.\n\t\t * @privateRemarks TODO: return removed cell\n\t\t */\n\t\tremoveCell(column: IColumn): void;\n\t\t/**\n\t\t * Removes the cell in the specified column, denoted by column ID.\n\t\t * @privateRemarks TODO: return removed cell\n\t\t */\n\t\tremoveCell(columnId: string): void;\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 createColumn}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps>>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<\n\t\t\tUnannotateImplicitFieldSchema<TProps>\n\t\t>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @internal\n\t */\n\texport function createRow<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t}: System_TableSchema.CreateRowOptionsBase<TScope, TCell>): ReturnType<\n\t\ttypeof System_TableSchema.createRowInternal<\n\t\t\tTScope,\n\t\t\tTCell,\n\t\t\tFieldSchema<FieldKind.Optional, typeof SchemaFactoryAlpha.null>\n\t\t>\n\t>;\n\t/**\n\t * Factory for creating new table column schema.\n\t * @internal\n\t */\n\texport function createRow<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TProps extends ImplicitFieldSchema,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops,\n\t}: System_TableSchema.CreateRowOptionsBase<TScope, TCell> & {\n\t\t/**\n\t\t * Optional row properties.\n\t\t */\n\t\treadonly props: TProps;\n\t}): ReturnType<typeof System_TableSchema.createRowInternal<TScope, TCell, TProps>>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function createRow({\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.createRowInternal(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 in a table.\n\t * @internal\n\t */\n\texport interface CellKey {\n\t\t/**\n\t\t * {@link TableSchema.IColumn.id} of the containing {@link TableSchema.IColumn}.\n\t\t */\n\t\treadonly columnId: string;\n\n\t\t/**\n\t\t * {@link TableSchema.IRow.id} of the containing {@link TableSchema.IRow}.\n\t\t */\n\t\treadonly rowId: string;\n\t}\n\n\t/**\n\t * {@link TableSchema.ITable.insertColumn} parameters.\n\t * @internal\n\t */\n\texport interface InsertColumnParameters<TInsertableColumn> {\n\t\t/**\n\t\t * The index at which to insert the new column.\n\t\t * @remarks If not provided, the column 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 column to insert.\n\t\t */\n\t\treadonly column: TInsertableColumn;\n\t}\n\n\t/**\n\t * {@link TableSchema.ITable.insertRows} parameters.\n\t * @internal\n\t */\n\texport interface InsertRowsParameters<TInsertableRow> {\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: TInsertableRow[];\n\t}\n\n\t/**\n\t * {@link TableSchema.ITable.setCell} parameters.\n\t * @internal\n\t */\n\texport interface SetCellParameters<TInsertableCell> {\n\t\t/**\n\t\t * The key to uniquely identify a cell in a table.\n\t\t */\n\t\treadonly key: CellKey;\n\n\t\t/**\n\t\t * The cell to set.\n\t\t */\n\t\treadonly cell: TInsertableCell;\n\t}\n\n\t/**\n\t * A table.\n\t * @sealed @internal\n\t */\n\texport interface ITable<\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\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.IRow.id}.\n\t\t */\n\t\tgetColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;\n\n\t\t/**\n\t\t * Gets a table row by its {@link TableSchema.IRow.id}.\n\t\t */\n\t\tgetRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;\n\n\t\t/**\n\t\t * Gets a cell in the table by column and row IDs.\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 * @privateRemarks TODO: add overload that takes row and column nodes.\n\t\t */\n\t\tgetCell(key: CellKey): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * Inserts a column into the table.\n\t\t * @throws Throws an error if the column is already in the tree, or if the specified index is out of range.\n\t\t */\n\t\tinsertColumn(\n\t\t\tparams: InsertColumnParameters<InsertableTreeNodeFromImplicitAllowedTypes<TColumn>>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>;\n\n\t\t/**\n\t\t * Inserts 0 or more rows into the table.\n\t\t * @throws Throws an error if any of the rows are already in the tree, or if the specified index is out of range.\n\t\t */\n\t\tinsertRows(\n\t\t\tparams: InsertRowsParameters<InsertableTreeNodeFromImplicitAllowedTypes<TRow>>,\n\t\t): 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.ITable.removeCell} instead.\n\t\t * @privateRemarks TODO: add overload that takes column/row nodes?\n\t\t */\n\t\tsetCell(\n\t\t\tparams: SetCellParameters<InsertableTreeNodeFromImplicitAllowedTypes<TCell>>,\n\t\t): void;\n\n\t\t/**\n\t\t * Removes the specified column from the table.\n\t\t * @remarks Note: this does not remove any cells from the table's rows.\n\t\t * @privateRemarks\n\t\t * TODO:\n\t\t * - Policy for when the column is not in the table.\n\t\t * - Actually remove corresponding cells from table rows.\n\t\t */\n\t\tremoveColumn: (column: TreeNodeFromImplicitAllowedTypes<TColumn>) => void;\n\n\t\t/**\n\t\t * Removes 0 or more rows from the table.\n\t\t * @privateRemarks TODO: policy for when 1 or more rows are not in the table.\n\t\t */\n\t\tremoveRows: (rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]) => void;\n\n\t\t/**\n\t\t * Removes all rows from the table.\n\t\t */\n\t\tremoveAllRows: () => void;\n\n\t\t/**\n\t\t * Removes the cell at the specified location in the table.\n\t\t * @privateRemarks TODO: add overload that takes column/row nodes?\n\t\t */\n\t\tremoveCell: (key: CellKey) => void;\n\t}\n\n\t/**\n\t * Factory for creating new table schema without specifying row or column schema.\n\t * @internal\n\t */\n\texport function createTable<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t}: System_TableSchema.TableFactoryOptionsBase<TScope, TCell>): ReturnType<\n\t\ttypeof System_TableSchema.createTableInternal<TScope, TCell>\n\t>;\n\t/**\n\t * Factory for creating new table schema without specifying row schema.\n\t * @internal\n\t */\n\texport function createTable<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TScope>,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t\tcolumn,\n\t}: System_TableSchema.TableFactoryOptionsBase<TScope, TCell> & {\n\t\treadonly column: TColumn;\n\t}): ReturnType<typeof System_TableSchema.createTableInternal<TScope, TCell, TColumn>>;\n\t/**\n\t * Factory for creating new table schema.\n\t * @internal\n\t */\n\texport function createTable<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TScope>,\n\t\tconst TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t\tcolumn,\n\t\trow,\n\t}: System_TableSchema.TableFactoryOptionsBase<TScope, TCell> & {\n\t\treadonly column: TColumn;\n\t\treadonly row: TRow;\n\t}): ReturnType<typeof System_TableSchema.createTableInternal<TScope, TCell, TColumn, TRow>>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function createTable({\n\t\tschemaFactory,\n\t\tcell,\n\t\tcolumn = createColumn({\n\t\t\tschemaFactory,\n\t\t}),\n\t\trow = createRow({\n\t\t\tschemaFactory,\n\t\t\tcell,\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.createTableInternal(schemaFactory, cell, column, row);\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,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAQN,aAAa,EASb,aAAa,GAGb,MAAM,wBAAwB,CAAC;AAEhC,4BAA4B;AAC5B,mDAAmD;AACnD,oDAAoD;AACpD,2EAA2E;AAE3E,oBAAoB;AACpB,mGAAmG;AAEnG;;GAEG;AACH,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAE3C;;;;;;;;;GASG;AACH,MAAM,KAAW,kBAAkB,CA8xBlC;AA9xBD,WAAiB,kBAAkB;IAiDlC;;;OAGG;IACH,sIAAsI;IACtI,SAAgB,oBAAoB,CAGlC,kBAAmD,EAAE,WAAyB;QAC/E,MAAM,aAAa,GAAG,kBAAkB,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;QAGnF,gFAAgF;QAChF,yCAAyC;QACzC,kDAAkD;QAClD,MAAM,wBAAwB,GAAG;YAChC,EAAE,EAAE,aAAa,CAAC,UAAU;SACnB,CAAC;QACX,MAAM,qBAAqB,GAAG;YAC7B,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;QACf,aAAa;QACb,IAAI;KACJ,CAAC,GAIF;QACA,OAAO,kBAAkB,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IACjF,CAAC;IAfe,uBAAW,cAe1B,CAAA;IAED,aAAa;AACd,CAAC,EApjBgB,WAAW,KAAX,WAAW,QAojB3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { oob } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { Tree } from \"./shared-tree/index.js\";\nimport {\n\ttype FieldHasDefault,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeKind,\n\ttype SchemaFactoryAlpha,\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 ImplicitAnnotatedFieldSchema,\n\ttype UnannotateImplicitFieldSchema,\n} from \"./simple-tree/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 * 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 @internal\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 @internal\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 @internal\n\t */\n\texport interface OptionsWithSchemaFactory<TSchemaFactory extends SchemaFactoryAlpha> {\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 @internal\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 @internal\n\t */\n\texport type CreateColumnOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha,\n\t> = OptionsWithSchemaFactory<TSchemaFactory>;\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @system @internal\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 createColumnInternal<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TPropsSchema extends ImplicitAnnotatedFieldSchema,\n\t>(inputSchemaFactory: SchemaFactoryAlpha<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.objectAlpha(\"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<TPropsSchema> {}\n\n\t\ttype ColumnValueType = TreeNode &\n\t\t\tTableSchema.Column<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<UnannotateImplicitFieldSchema<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<\n\t\t\t\t\t\t\tUnannotateImplicitFieldSchema<TPropsSchema>\n\t\t\t\t\t\t>;\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<\n\t\t\t\t\t\t\tUnannotateImplicitFieldSchema<TPropsSchema>\n\t\t\t\t\t\t>;\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 @internal\n\t */\n\texport type ColumnSchemaBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTPropsSchema extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema,\n\t> = ReturnType<typeof createColumnInternal<TScope, 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 @internal\n\t */\n\texport type CreateRowOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating new table row schema.\n\t *\n\t * @sealed @internal\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 createRowInternal<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TPropsSchema extends ImplicitAnnotatedFieldSchema,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryAlpha<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\ttype CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\t\ttype CellInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TCellSchema>;\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\tcells: schemaFactory.required(schemaFactory.map(\"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 Row} 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 Row\n\t\t\textends schemaFactory.objectAlpha(\"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 TableSchema.Row<TCellSchema, TPropsSchema>\n\t\t{\n\t\t\tpublic getCell(columnOrId: TableSchema.Column | string): CellValueType | undefined {\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t\treturn this.cells.get(columnId) as CellValueType | undefined;\n\t\t\t}\n\n\t\t\tpublic setCell(\n\t\t\t\tcolumnOrId: TableSchema.Column | string,\n\t\t\t\tvalue: CellInsertableType | undefined,\n\t\t\t): void {\n\t\t\t\t// TODO: throw if column does not exist in the owning table.\n\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t\tthis.cells.set(columnId, value);\n\t\t\t}\n\n\t\t\tpublic removeCell(columnOrId: TableSchema.Column | string): CellValueType | undefined {\n\t\t\t\t// TODO: throw if column does not exist in the owning table.\n\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\n\t\t\t\tconst cell: CellValueType | undefined = this.cells.get(columnId);\n\t\t\t\tif (cell === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tthis.cells.delete(columnId);\n\t\t\t\treturn cell;\n\t\t\t}\n\t\t}\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<UnannotateImplicitFieldSchema<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<\n\t\t\t\t\t\t\tUnannotateImplicitFieldSchema<TPropsSchema>\n\t\t\t\t\t\t>;\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<\n\t\t\t\t\t\t\tUnannotateImplicitFieldSchema<TPropsSchema>\n\t\t\t\t\t\t>;\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 Row]: (typeof Row)[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) => Row) & {\n\t\t\t\tcreateFromInsertable(parameters: RowInsertableType): Row;\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> = Row as RowSchemaModifiedType;\n\n\t\treturn RowSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @internal\n\t */\n\texport type RowSchemaBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTPropsSchema extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema,\n\t> = ReturnType<typeof createRowInternal<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 @internal\n\t */\n\texport type TableFactoryOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating new table schema.\n\t * @system @internal\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 createTableInternal<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TColumnSchema extends ColumnSchemaBase<TInputScope>,\n\t\tconst TRowSchema extends RowSchemaBase<TInputScope, TCellSchema>,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryAlpha<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/**\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, ImplicitAnnotatedFieldSchema>;\n\n\t\t/**\n\t\t * The Table schema\n\t\t */\n\t\tclass Table\n\t\t\textends schemaFactory.objectAlpha(\"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<TCellSchema, TColumnSchema, TRowSchema>\n\t\t{\n\t\t\tpublic getColumn(id: string): ColumnValueType | undefined {\n\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.columns.find((column) => (column as ColumnValueType).id === id) as\n\t\t\t\t\t| ColumnValueType\n\t\t\t\t\t| undefined;\n\t\t\t}\n\n\t\t\tpublic getRow(id: string): RowValueType | undefined {\n\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.rows.find((_row) => (_row as RowValueType).id === id) as\n\t\t\t\t\t| RowValueType\n\t\t\t\t\t| undefined;\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: columnOrId, row: rowOrId } = key;\n\t\t\t\tconst row = this._getRow(rowOrId);\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._getColumn(columnOrId);\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.getCell(column);\n\t\t\t}\n\n\t\t\tpublic insertColumn({\n\t\t\t\tcolumn,\n\t\t\t\tindex,\n\t\t\t}: TableSchema.InsertColumnParameters<TColumnSchema>): ColumnValueType {\n\t\t\t\tconst inserted = this.insertColumns({\n\t\t\t\t\tcolumns: [column],\n\t\t\t\t\tindex,\n\t\t\t\t});\n\t\t\t\treturn inserted[0] ?? oob();\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 index is valid\n\t\t\t\tif (index !== undefined) {\n\t\t\t\t\tTable.validateInsertionIndex(index, this.columns);\n\t\t\t\t}\n\n\t\t\t\t// Check all of the columns being inserted an ensure the table does not already contain any with the same ID.\n\t\t\t\tfor (const column of columns) {\n\t\t\t\t\t// TypeScript is unable to narrow the type of the column type correctly here, hence the casts below.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\tconst maybeId = (column as ColumnValueType).id;\n\t\t\t\t\tif (maybeId !== undefined && this.containsColumnWithId(maybeId)) {\n\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t`A column with ID \"${(column as ColumnValueType).id}\" already exists in the table.`,\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 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// 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 insertRow({\n\t\t\t\trow,\n\t\t\t\tindex,\n\t\t\t}: TableSchema.InsertRowParameters<TRowSchema>): RowValueType {\n\t\t\t\tconst inserted = this.insertRows({\n\t\t\t\t\trows: [row],\n\t\t\t\t\tindex,\n\t\t\t\t});\n\t\t\t\treturn inserted[0] ?? oob();\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 index is valid\n\t\t\t\tif (index !== undefined) {\n\t\t\t\t\tTable.validateInsertionIndex(index, this.rows);\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// Check all of the rows being inserted an ensure the table does not already contain any with the same ID.\n\t\t\t\t\tconst maybeId = (newRow as RowValueType).id;\n\t\t\t\t\tif (maybeId !== undefined && this.containsRowWithId(maybeId)) {\n\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t`A row with ID \"${(newRow as RowValueType).id}\" already exists in the table.`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\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\tif (row === undefined) {\n\t\t\t\t\tconst rowId = this._getRowId(rowOrId);\n\t\t\t\t\tthrow new UsageError(`No row with ID \"${rowId}\" exists in the table.`);\n\t\t\t\t}\n\n\t\t\t\tconst column = this._getColumn(columnOrId);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\tconst columnId = this._getColumnId(columnOrId);\n\t\t\t\t\tthrow new UsageError(`No column with ID \"${columnId}\" exists in the table.`);\n\t\t\t\t}\n\n\t\t\t\trow.setCell(column, cell);\n\t\t\t}\n\n\t\t\tpublic removeColumns(\n\t\t\t\tcolumns: readonly string[] | readonly ColumnValueType[],\n\t\t\t): ColumnValueType[] {\n\t\t\t\t// If there are no columns to remove, do nothing\n\t\t\t\tif (columns.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\t// If there is only one column to remove, remove it (and don't incur cost of transaction)\n\t\t\t\tif (columns.length === 1) {\n\t\t\t\t\tconst removedColumn = this.removeColumn(columns[0] ?? oob());\n\t\t\t\t\treturn [removedColumn];\n\t\t\t\t}\n\n\t\t\t\t// If there are multiple columns to remove, remove them in a transaction.\n\t\t\t\tconst removedColumns: ColumnValueType[] = [];\n\t\t\t\tTree.runTransaction(this, () => {\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 columns will be removed.\n\t\t\t\t\tfor (const columnToRemove of columns) {\n\t\t\t\t\t\tconst removedRow = this.removeColumn(columnToRemove);\n\t\t\t\t\t\tremovedColumns.push(removedRow);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn removedColumns;\n\t\t\t}\n\n\t\t\tpublic removeColumn(columnOrId: string | ColumnValueType): ColumnValueType {\n\t\t\t\tconst column = this._getColumn(columnOrId);\n\t\t\t\tconst index = column === undefined ? -1 : this.columns.indexOf(column);\n\t\t\t\tif (index === -1) {\n\t\t\t\t\tconst columnId = this._getColumnId(columnOrId);\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Specified column with ID \"${columnId}\" does not exist in the table.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tthis.columns.removeAt(index);\n\t\t\t\treturn column as ColumnValueType;\n\t\t\t}\n\n\t\t\tpublic removeAllColumns(): ColumnValueType[] {\n\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the cast.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.removeColumns(this.columns as unknown as ColumnValueType[]);\n\t\t\t}\n\n\t\t\tpublic removeRows(rows: readonly string[] | readonly RowValueType[]): RowValueType[] {\n\t\t\t\t// If there are no rows to remove, do nothing\n\t\t\t\tif (rows.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\t// If there is only one row to remove, remove it (and don't incur cost of transaction)\n\t\t\t\tif (rows.length === 1) {\n\t\t\t\t\tconst removedRow = this.removeRow(rows[0] ?? oob());\n\t\t\t\t\treturn [removedRow];\n\t\t\t\t}\n\n\t\t\t\t// If there are multiple rows to remove, remove them in a transaction.\n\t\t\t\tconst removedRows: RowValueType[] = [];\n\t\t\t\tTree.runTransaction(this, () => {\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 rows) {\n\t\t\t\t\t\tconst removedRow = this.removeRow(rowToRemove);\n\t\t\t\t\t\tremovedRows.push(removedRow);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn removedRows;\n\t\t\t}\n\n\t\t\tpublic removeRow(rowOrId: string | RowValueType): RowValueType {\n\t\t\t\tconst rowToRemove = this._getRow(rowOrId);\n\t\t\t\tconst index = rowToRemove === undefined ? -1 : this.rows.indexOf(rowToRemove);\n\n\t\t\t\t// If the row does not exist in the table, throw an error.\n\t\t\t\tif (index === -1) {\n\t\t\t\t\tconst rowId = this._getRowId(rowOrId);\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Specified row with ID \"${rowId}\" does not exist in the table.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.rows.removeAt(index);\n\t\t\t\treturn rowToRemove as RowValueType;\n\t\t\t}\n\n\t\t\tpublic removeAllRows(): RowValueType[] {\n\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the cast.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.removeRows(this.rows as unknown as RowValueType[]);\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: columnOrId, row: rowOrId } = key;\n\t\t\t\tconst row = this._getRow(rowOrId);\n\t\t\t\tif (row === undefined) {\n\t\t\t\t\tconst rowId = this._getRowId(rowOrId);\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Specified row with ID \"${rowId}\" does not exist in the table.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst column = this._getColumn(columnOrId);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\tconst columnId = this._getColumnId(columnOrId);\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Specified column with ID \"${columnId}\" does not exist in the table.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst cell: CellValueType | undefined = row.getCell(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\trow.removeCell(column.id);\n\t\t\t\treturn cell;\n\t\t\t}\n\n\t\t\tprivate _getColumn(columnOrId: string | ColumnValueType): ColumnValueType | undefined {\n\t\t\t\treturn typeof columnOrId === \"string\" ? this.getColumn(columnOrId) : columnOrId;\n\t\t\t}\n\n\t\t\tprivate _getColumnId(columnOrId: string | ColumnValueType): string {\n\t\t\t\treturn typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t}\n\n\t\t\tprivate _getRow(rowOrId: string | RowValueType): RowValueType | undefined {\n\t\t\t\treturn typeof rowOrId === \"string\" ? this.getRow(rowOrId) : rowOrId;\n\t\t\t}\n\n\t\t\tprivate _getRowId(rowOrId: string | RowValueType): string {\n\t\t\t\treturn typeof rowOrId === \"string\" ? rowOrId : rowOrId.id;\n\t\t\t}\n\n\t\t\tprivate containsColumnWithId(columnId: string): boolean {\n\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn (\n\t\t\t\t\tthis.columns.find((column) => (column as TableSchema.Column).id === columnId) !==\n\t\t\t\t\tundefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tprivate containsRowWithId(rowId: string): boolean {\n\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.rows.find((row) => (row as TableSchema.Row).id === rowId) !== undefined;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Ensure that the specified index is a valid location for item insertion in the destination list.\n\t\t\t * @throws Throws a usage error if the destination is invalid.\n\t\t\t */\n\t\t\tprivate static validateInsertionIndex(\n\t\t\t\tindex: number,\n\t\t\t\tdestinationList: readonly unknown[],\n\t\t\t): void {\n\t\t\t\tif (index < 0) {\n\t\t\t\t\tthrow new UsageError(\"The index must be greater than or equal to 0.\");\n\t\t\t\t}\n\n\t\t\t\tif (index > destinationList.length) {\n\t\t\t\t\tthrow new UsageError(\"The index specified for insertion is out of bounds.\");\n\t\t\t\t}\n\n\t\t\t\tif (!Number.isInteger(index)) {\n\t\t\t\t\tthrow new UsageError(\"The index must be an integer.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttype TableValueType = TreeNode &\n\t\t\tTableSchema.Table<TCellSchema, TColumnSchema, TRowSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Table\">>;\n\t\ttype TableInsertableType = InsertableObjectFromSchemaRecord<typeof tableFields>;\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> = 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 @internal\n\t */\n\texport type TableSchemaBase<\n\t\tTScope extends string | undefined,\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ColumnSchemaBase<TScope>,\n\t\tTRow extends RowSchemaBase<TScope, TCell>,\n\t> = ReturnType<typeof createTableInternal<TScope, TCell, TColumn, TRow>>;\n\n\t// #endregion\n}\n\n/**\n * Contains types and factories for creating schema to represent dynamic tabular data.\n *\n * @remarks\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 * Note: for now it is possible for table cells to 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 help avoid this situation, 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 Using default Column and Row schema\n *\n * ```typescript\n * class Cell extends schemaFactory.object(\"TableCell\", {\n * \tvalue: schemaFactory.string,\n * }) {}\n *\n * class Table extends TableSchema.createTable({\n * \tschemaFactory,\n * \tcell: Cell,\n * }) {}\n *\n * const table = new Table({\n * \tcolumns: [{ id: \"column-0\" }],\n * \trows: [{ id: \"row-0\", cells: {} }],\n * });\n * ```\n *\n * @example Customizing Column and Row schema\n *\n * ```typescript\n * class Cell extends schemaFactory.object(\"TableCell\", {\n * \tvalue: schemaFactory.string,\n * }) {}\n *\n * class ColumnProps extends schemaFactory.object(\"TableColumnProps\", {\n * \t// Column label to display.\n * \tlabel: schemaFactory.string,\n * \t// The type of data represented by the cells. Default: string.\n * \tdataType: schemaFactory.optional(schemaFactory.string),\n * }) {}\n *\n * class Column extends TableSchema.createColumn({\n * \tschemaFactory,\n * \tprops: ColumnProps,\n * }) {}\n *\n * class Row extends TableSchema.createRow({\n * \tschemaFactory,\n * \tcell: Cell,\n * }) {}\n *\n * class Table extends TableSchema.createTable({\n * \tschemaFactory,\n * \tcell: Cell,\n * \tcolumn: Column,\n * \trow: Row,\n * }) {}\n *\n * const table = new Table({\n * \tcolumns: [\n * \t\tnew Column({ props: { label: \"Entry\", dataType: \"string\" } }),\n * \t\tnew Column({ props: { label: \"Date\", dataType: \"date\" } }),\n * \t\tnew Column({ props: { label: \"Amount\", dataType: \"number\" } }),\n * \t],\n * \trows: [],\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 * @internal\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.(createColumn:2)}.\n\t * @sealed @internal\n\t */\n\texport interface Column<\n\t\tTProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema,\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 createColumn}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps>>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<\n\t\t\tUnannotateImplicitFieldSchema<TProps>\n\t\t>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @internal\n\t */\n\texport function createColumn<const TScope extends string | undefined>({\n\t\tschemaFactory,\n\t}: System_TableSchema.CreateColumnOptionsBase<\n\t\tSchemaFactoryAlpha<TScope>\n\t>): System_TableSchema.ColumnSchemaBase<TScope, System_TableSchema.DefaultPropsType>;\n\t/**\n\t * Factory for creating new table column schema.\n\t * @internal\n\t */\n\texport function createColumn<\n\t\tconst TScope extends string | undefined,\n\t\tconst TProps extends ImplicitAnnotatedFieldSchema,\n\t>({\n\t\tschemaFactory,\n\t\tprops,\n\t}: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryAlpha<TScope>> & {\n\t\t/**\n\t\t * Optional column properties.\n\t\t */\n\t\treadonly props: TProps;\n\t}): System_TableSchema.ColumnSchemaBase<TScope, TProps>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function createColumn({\n\t\tschemaFactory,\n\t\tprops = SchemaFactory.optional(SchemaFactory.null),\n\t}: System_TableSchema.CreateColumnOptionsBase & {\n\t\treadonly props?: ImplicitAnnotatedFieldSchema;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createColumnInternal(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.(createRow:2)}.\n\t * @sealed @internal\n\t */\n\texport interface Row<\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema,\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 * Gets the cell in the specified column.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t * @privateRemarks TODO: throw if the column does not belong to the same table as the row.\n\t\t */\n\t\tgetCell(column: Column): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\t\t/**\n\t\t * Gets the cell in the specified column, denoted by column ID.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t */\n\t\tgetCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * Sets the cell in the specified column.\n\t\t * @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:1)} instead.\n\t\t * @privateRemarks TODO: Throw an error if the column does not exist in the table.\n\t\t */\n\t\tsetCell(column: Column, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;\n\t\t/**\n\t\t * Sets the cell in the specified column, denoted by column ID.\n\t\t * @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:2)} instead.\n\t\t */\n\t\tsetCell(columnId: string, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;\n\n\t\t/**\n\t\t * Removes the cell in the specified column.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t * @privateRemarks TODO: Throw if the column does not belong to the same table as the row.\n\t\t */\n\t\tremoveCell(column: Column): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\t\t/**\n\t\t * Removes the cell in the specified column, denoted by column ID.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t */\n\t\tremoveCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\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 createColumn}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps>>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<\n\t\t\tUnannotateImplicitFieldSchema<TProps>\n\t\t>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @internal\n\t */\n\texport function createRow<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t}: System_TableSchema.CreateRowOptionsBase<\n\t\tSchemaFactoryAlpha<TScope>,\n\t\tTCell\n\t>): System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>;\n\t/**\n\t * Factory for creating new table column schema.\n\t * @internal\n\t */\n\texport function createRow<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TProps extends ImplicitAnnotatedFieldSchema,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops,\n\t}: System_TableSchema.CreateRowOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {\n\t\t/**\n\t\t * Optional row properties.\n\t\t */\n\t\treadonly props: TProps;\n\t}): System_TableSchema.RowSchemaBase<TScope, TCell, TProps>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function createRow({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops = SchemaFactory.optional(SchemaFactory.null),\n\t}: System_TableSchema.CreateRowOptionsBase & {\n\t\treadonly props?: ImplicitAnnotatedFieldSchema;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createRowInternal(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 * @internal\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} or {@link TableSchema.Column.id} at which the cell is located.\n\t\t */\n\t\treadonly column: string | TreeNodeFromImplicitAllowedTypes<TColumn>;\n\n\t\t/**\n\t\t * {@link TableSchema.Row} or {@link TableSchema.Row.id} at which the cell is located.\n\t\t */\n\t\treadonly row: string | TreeNodeFromImplicitAllowedTypes<TRow>;\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertColumn} parameters.\n\t * @internal\n\t */\n\texport interface InsertColumnParameters<TColumn extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new column.\n\t\t * @remarks If not provided, the column 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 column to insert.\n\t\t */\n\t\treadonly column: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>;\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertColumns} parameters.\n\t * @internal\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.insertRow} parameters.\n\t * @internal\n\t */\n\texport interface InsertRowParameters<TRow extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new row.\n\t\t * @remarks If not provided, the row 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 row to insert.\n\t\t */\n\t\treadonly row: InsertableTreeNodeFromImplicitAllowedTypes<TRow>;\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertRows} parameters.\n\t * @internal\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 * @internal\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 * @sealed @internal\n\t */\n\texport interface Table<\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\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 */\n\t\tgetColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;\n\n\t\t/**\n\t\t * Gets a table row by its {@link TableSchema.Row.id}.\n\t\t */\n\t\tgetRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;\n\n\t\t/**\n\t\t * Gets a cell in the table by column and row IDs.\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 */\n\t\tgetCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * Inserts a column 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 column, or a column with the same ID is already in the tree.\n\t\t *\n\t\t * - The specified index is out of range.\n\t\t *\n\t\t * No column is inserted in these cases.\n\t\t */\n\t\tinsertColumn(\n\t\t\tparams: InsertColumnParameters<TColumn>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>;\n\n\t\t/**\n\t\t * Inserts 0 or more columns 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 * - At least one column, or a column with the same ID is already in the tree.\n\t\t *\n\t\t * - The specified index is out of range.\n\t\t *\n\t\t * No columns are inserted in these cases.\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 a row 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, or a row with the same ID is already in the tree.\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 row is inserted in these cases.\n\t\t */\n\t\tinsertRow(params: InsertRowParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>;\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 * - At least one row, or a row with the same ID is already in the tree.\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 the specified column from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Note: this does not remove any cells from the table's rows.\n\t\t * To remove the corresponding cells, use {@link TableSchema.Table.removeCell}.\n\t\t *\n\t\t * @param column - The {@link TableSchema.Column | column} or {@link TableSchema.Column.id | column ID} to remove.\n\t\t * @throws Throws an error if the column is not in the table.\n\t\t * @privateRemarks TODO (future): Actually remove corresponding cells from table rows.\n\t\t */\n\t\tremoveColumn(\n\t\t\tcolumn: string | TreeNodeFromImplicitAllowedTypes<TColumn>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>;\n\n\t\t/**\n\t\t * Removes 0 or more columns from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Note: this does not remove any cells from the table's rows.\n\t\t * To remove the corresponding cells, use {@link TableSchema.Table.removeCell}.\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 * Note: this does not remove any cells from the table's rows.\n\t\t * To remove the corresponding cells, use {@link TableSchema.Table.removeCell}.\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 all columns from the table.\n\t\t * @returns The removed columns.\n\t\t */\n\t\tremoveAllColumns(): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\n\t\t/**\n\t\t * Removes the specified row from the table.\n\t\t * @param row - The {@link TableSchema.Row | row} or {@link TableSchema.Row.id | row ID} to remove.\n\t\t * @throws Throws an error if the row is not in the table.\n\t\t */\n\t\tremoveRow(\n\t\t\trow: string | TreeNodeFromImplicitAllowedTypes<TRow>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TRow>;\n\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 all rows from the table.\n\t\t * @returns The removed rows.\n\t\t */\n\t\tremoveAllRows(): 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 without specifying row or column schema.\n\t * @internal\n\t */\n\texport function createTable<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t}: System_TableSchema.TableFactoryOptionsBase<\n\t\tSchemaFactoryAlpha<TScope>,\n\t\tTCell\n\t>): System_TableSchema.TableSchemaBase<\n\t\tTScope,\n\t\tTCell,\n\t\tSystem_TableSchema.ColumnSchemaBase<TScope, 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 without specifying row schema.\n\t * @internal\n\t */\n\texport function createTable<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TScope>,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t\tcolumn,\n\t}: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {\n\t\treadonly column: TColumn;\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.\n\t * @internal\n\t */\n\texport function createTable<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TScope>,\n\t\tconst TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t\tcolumn,\n\t\trow,\n\t}: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {\n\t\treadonly column: TColumn;\n\t\treadonly row: TRow;\n\t}): System_TableSchema.TableSchemaBase<TScope, TCell, TColumn, TRow>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function createTable({\n\t\tschemaFactory,\n\t\tcell,\n\t\tcolumn = createColumn({\n\t\t\tschemaFactory,\n\t\t}),\n\t\trow = createRow({\n\t\t\tschemaFactory,\n\t\t\tcell,\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.createTableInternal(schemaFactory, cell, column, row);\n\t}\n\n\t// #endregion\n}\n"]}
|
package/lib/treeFactory.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { SharedObjectKind } from "@fluidframework/shared-object-base";
|
|
6
6
|
import { type ISharedObject, type ISharedObjectKind } from "@fluidframework/shared-object-base/internal";
|
|
7
|
-
import type
|
|
7
|
+
import { type ITreePrivate, type SharedTreeOptions } from "./shared-tree/index.js";
|
|
8
8
|
import type { ITree } from "./simple-tree/index.js";
|
|
9
9
|
/**
|
|
10
10
|
* {@link ITreePrivate} extended with ISharedObject.
|
package/lib/treeFactory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeFactory.d.ts","sourceRoot":"","sources":["../src/treeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"treeFactory.d.ts","sourceRoot":"","sources":["../src/treeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAMtB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAMpD;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,aAAa,EAAE,YAAY;CAAG;AA4CnE;;;;;GAKG;AACH,eAAO,MAAM,UAAU,oDAA2B,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,iBAAiB,GACxB,iBAAiB,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,CASpD"}
|
package/lib/treeFactory.js
CHANGED
|
@@ -2,82 +2,36 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { makeSharedObjectKind, } from "@fluidframework/shared-object-base/internal";
|
|
6
|
+
import { SharedTreeKernel, } from "./shared-tree/index.js";
|
|
7
7
|
import { Breakable } from "./util/index.js";
|
|
8
|
-
import { SharedTreeKernel } from "./shared-tree/index.js";
|
|
9
8
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
10
|
-
import {
|
|
9
|
+
import { SharedTreeFactoryType, SharedTreeAttributes } from "./sharedTreeAttributes.js";
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
11
|
+
* Creates a factory for shared tree kernels with the given options.
|
|
12
|
+
* @remarks
|
|
13
|
+
* Exposes {@link ITreePrivate} to allow access to internals in tests without a cast.
|
|
14
|
+
* Code exposing this beyond this package will need to update to a more public type.
|
|
13
15
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.breaker = new Breakable("Shared Tree");
|
|
18
|
-
if (runtime.idCompressor === undefined) {
|
|
16
|
+
function treeKernelFactory(options) {
|
|
17
|
+
function treeFromKernelArgs(args) {
|
|
18
|
+
if (args.idCompressor === undefined) {
|
|
19
19
|
throw new UsageError("IdCompressor must be enabled to use SharedTree");
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
exportVerbose() {
|
|
36
|
-
return this.kernel.exportVerbose();
|
|
37
|
-
}
|
|
38
|
-
exportSimpleSchema() {
|
|
39
|
-
return this.kernel.exportSimpleSchema();
|
|
40
|
-
}
|
|
41
|
-
contentSnapshot() {
|
|
42
|
-
return this.kernel.contentSnapshot();
|
|
43
|
-
}
|
|
44
|
-
viewWith(config) {
|
|
45
|
-
return this.kernel.viewWith(config);
|
|
46
|
-
}
|
|
47
|
-
async loadCore(services) {
|
|
48
|
-
await this.kernel.loadCore(services);
|
|
49
|
-
}
|
|
50
|
-
didAttach() {
|
|
51
|
-
this.kernel.didAttach();
|
|
52
|
-
}
|
|
53
|
-
applyStashedOp(...args) {
|
|
54
|
-
this.kernel.applyStashedOp(...args);
|
|
55
|
-
}
|
|
56
|
-
reSubmitCore(...args) {
|
|
57
|
-
this.kernel.reSubmitCore(...args);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* A channel factory that creates an {@link ITree}.
|
|
62
|
-
*/
|
|
63
|
-
class TreeFactory {
|
|
64
|
-
constructor(options) {
|
|
65
|
-
this.options = options;
|
|
66
|
-
this.type = SharedTreeFactoryType;
|
|
67
|
-
this.attributes = SharedTreeAttributes;
|
|
68
|
-
}
|
|
69
|
-
async load(runtime, id, services, channelAttributes) {
|
|
70
|
-
const tree = new SharedTreeImpl(id, runtime, channelAttributes, this.options);
|
|
71
|
-
await tree.load(services);
|
|
72
|
-
return tree;
|
|
73
|
-
}
|
|
74
|
-
create(runtime, id) {
|
|
75
|
-
const tree = new SharedTreeImpl(id, runtime, this.attributes, this.options);
|
|
76
|
-
tree.initializeLocal();
|
|
77
|
-
return tree;
|
|
78
|
-
}
|
|
21
|
+
return new SharedTreeKernel(new Breakable("SharedTree"), args.sharedObject, args.serializer, args.submitLocalMessage, args.lastSequenceNumber, args.logger, args.idCompressor, options);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
create: (args) => {
|
|
25
|
+
const k = treeFromKernelArgs(args);
|
|
26
|
+
return { kernel: k, view: k.view };
|
|
27
|
+
},
|
|
28
|
+
async loadCore(args, storage) {
|
|
29
|
+
const k = treeFromKernelArgs(args);
|
|
30
|
+
await k.loadCore(storage);
|
|
31
|
+
return { kernel: k, view: k.view };
|
|
32
|
+
},
|
|
33
|
+
};
|
|
79
34
|
}
|
|
80
|
-
TreeFactory.Type = SharedTreeFactoryType;
|
|
81
35
|
/**
|
|
82
36
|
* SharedTree is a hierarchical data structure for collaboratively editing strongly typed JSON-like trees
|
|
83
37
|
* of objects, arrays, and other data types.
|
|
@@ -112,11 +66,12 @@ export const SharedTree = configuredSharedTree({});
|
|
|
112
66
|
* @internal
|
|
113
67
|
*/
|
|
114
68
|
export function configuredSharedTree(options) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
69
|
+
const sharedObjectOptions = {
|
|
70
|
+
type: SharedTreeFactoryType,
|
|
71
|
+
attributes: SharedTreeAttributes,
|
|
72
|
+
telemetryContextPrefix: "fluid_sharedTree_",
|
|
73
|
+
factory: treeKernelFactory(options),
|
|
74
|
+
};
|
|
75
|
+
return makeSharedObjectKind(sharedObjectOptions);
|
|
121
76
|
}
|
|
122
77
|
//# sourceMappingURL=treeFactory.js.map
|
package/lib/treeFactory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeFactory.js","sourceRoot":"","sources":["../src/treeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH,OAAO,EAIN,YAAY,EACZ,sBAAsB,GACtB,MAAM,6CAA6C,CAAC;AAqBrD,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAA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AC1B,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5E,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;;AAtBa,gBAAI,GAAW,qBAAqB,AAAhC,CAAiC;AAyBpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,oBAAoB,CACnC,OAA0B;IAE1B,MAAM,iBAAkB,SAAQ,WAAW;QAC1C;YACC,KAAK,CAAC,OAAO,CAAC,CAAC;QAChB,CAAC;KACD;IACD,OAAO,sBAAsB,CAAQ,iBAAiB,CAAC,CAAC;AACzD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tITelemetryContext,\n\tIExperimentalIncrementalSummaryContext,\n\tISummaryTreeWithStats,\n\tIRuntimeMessageCollection,\n} from \"@fluidframework/runtime-definitions/internal\";\n\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport {\n\ttype IFluidSerializer,\n\ttype ISharedObject,\n\ttype ISharedObjectKind,\n\tSharedObject,\n\tcreateSharedObjectKind,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport type {\n\tSchematizingSimpleTreeView,\n\tSharedTreeContentSnapshot,\n\tSharedTreeOptions,\n\tSharedTreeOptionsInternal,\n\tSharedTreeEditBuilder,\n\tSharedTreeChange,\n\tITreePrivate,\n} from \"./shared-tree/index.js\";\nimport type {\n\tImplicitFieldSchema,\n\tITree,\n\tReadSchema,\n\tSimpleTreeSchema,\n\tTreeView,\n\tTreeViewConfiguration,\n\tUnsafeUnknownSchema,\n\tVerboseTree,\n} from \"./simple-tree/index.js\";\nimport { SharedTreeFactoryType, SharedTreeAttributes } from \"./sharedTreeAttributes.js\";\nimport { Breakable } from \"./util/index.js\";\nimport { SharedTreeKernel } from \"./shared-tree/index.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport type { SharedTreeCore } from \"./shared-tree-core/index.js\";\n\n/**\n * {@link ITreePrivate} extended with ISharedObject.\n * @remarks\n * This is used when integration testing this package with the Fluid runtime as it exposes the APIs the runtime consumes to manipulate the tree.\n */\nexport interface ISharedTree extends ISharedObject, ITreePrivate {}\n\n/**\n * Shared object wrapping {@link SharedTreeKernel}.\n */\nclass SharedTreeImpl extends SharedObject implements ISharedTree {\n\tprivate readonly breaker: Breakable = new Breakable(\"Shared Tree\");\n\n\tpublic readonly kernel: SharedTreeKernel;\n\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\toptionsParam: SharedTreeOptionsInternal,\n\t\ttelemetryContextPrefix: string = \"fluid_sharedTree_\",\n\t) {\n\t\tsuper(id, runtime, attributes, telemetryContextPrefix);\n\t\tif (runtime.idCompressor === undefined) {\n\t\t\tthrow new UsageError(\"IdCompressor must be enabled to use SharedTree\");\n\t\t}\n\t\tthis.kernel = new SharedTreeKernel(\n\t\t\tthis.breaker,\n\t\t\tthis,\n\t\t\tthis.serializer,\n\t\t\t(content, localOpMetadata) => this.submitLocalMessage(content, localOpMetadata),\n\t\t\t() => this.deltaManager.lastSequenceNumber,\n\t\t\tthis.logger,\n\t\t\truntime.idCompressor,\n\t\t\toptionsParam,\n\t\t);\n\t}\n\n\tpublic summarizeCore(\n\t\tserializer: IFluidSerializer,\n\t\ttelemetryContext?: ITelemetryContext,\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t): ISummaryTreeWithStats {\n\t\treturn this.kernel.summarizeCore(serializer, telemetryContext, incrementalSummaryContext);\n\t}\n\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tfail(0xb75 /* processCore should not be called on SharedTree */);\n\t}\n\n\tprotected override processMessagesCore(messagesCollection: IRuntimeMessageCollection): void {\n\t\tthis.kernel.processMessagesCore(messagesCollection);\n\t}\n\n\tprotected onDisconnect(): void {\n\t\tthis.kernel.onDisconnect();\n\t}\n\n\tpublic exportVerbose(): VerboseTree | undefined {\n\t\treturn this.kernel.exportVerbose();\n\t}\n\n\tpublic exportSimpleSchema(): SimpleTreeSchema {\n\t\treturn this.kernel.exportSimpleSchema();\n\t}\n\n\tpublic contentSnapshot(): SharedTreeContentSnapshot {\n\t\treturn this.kernel.contentSnapshot();\n\t}\n\n\t// For the new TreeViewAlpha API\n\tpublic viewWith<TRoot extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tconfig: TreeViewConfiguration<ReadSchema<TRoot>>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>>;\n\n\t// For the old TreeView API\n\tpublic viewWith<TRoot extends ImplicitFieldSchema>(\n\t\tconfig: TreeViewConfiguration<TRoot>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<TRoot>;\n\n\tpublic viewWith<TRoot extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tconfig: TreeViewConfiguration<ReadSchema<TRoot>>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>> {\n\t\treturn this.kernel.viewWith(config);\n\t}\n\n\tprotected override async loadCore(services: IChannelStorageService): Promise<void> {\n\t\tawait this.kernel.loadCore(services);\n\t}\n\n\tprotected override didAttach(): void {\n\t\tthis.kernel.didAttach();\n\t}\n\n\tprotected override applyStashedOp(\n\t\t...args: Parameters<\n\t\t\tSharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>[\"applyStashedOp\"]\n\t\t>\n\t): void {\n\t\tthis.kernel.applyStashedOp(...args);\n\t}\n\n\tprotected override reSubmitCore(\n\t\t...args: Parameters<\n\t\t\tSharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>[\"reSubmitCore\"]\n\t\t>\n\t): void {\n\t\tthis.kernel.reSubmitCore(...args);\n\t}\n}\n\n/**\n * A channel factory that creates an {@link ITree}.\n */\nclass TreeFactory implements IChannelFactory<ISharedTree> {\n\tpublic static Type: string = SharedTreeFactoryType;\n\tpublic readonly type: string = SharedTreeFactoryType;\n\n\tpublic readonly attributes: IChannelAttributes = SharedTreeAttributes;\n\n\tpublic constructor(private readonly options: SharedTreeOptionsInternal) {}\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tchannelAttributes: Readonly<IChannelAttributes>,\n\t): Promise<ISharedTree> {\n\t\tconst tree = new SharedTreeImpl(id, runtime, channelAttributes, this.options);\n\t\tawait tree.load(services);\n\t\treturn tree;\n\t}\n\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): ISharedTree {\n\t\tconst tree = new SharedTreeImpl(id, runtime, this.attributes, this.options);\n\t\ttree.initializeLocal();\n\t\treturn tree;\n\t}\n}\n\n/**\n * SharedTree is a hierarchical data structure for collaboratively editing strongly typed JSON-like trees\n * of objects, arrays, and other data types.\n * @legacy\n * @alpha\n */\nexport const SharedTree = configuredSharedTree({});\n\n/**\n * {@link SharedTree} but allowing a non-default configuration.\n * @remarks\n * This is useful for debugging and testing to opt into extra validation or see if opting out of some optimizations fixes an issue.\n * @example\n * ```typescript\n * import {\n * \tForestType,\n * \tTreeCompressionStrategy,\n * \tconfiguredSharedTree,\n * \ttypeboxValidator,\n * \t// eslint-disable-next-line import/no-internal-modules\n * } from \"@fluidframework/tree/internal\";\n * const SharedTree = configuredSharedTree({\n * \tforest: ForestType.Reference,\n * \tjsonValidator: typeboxValidator,\n * \ttreeEncodeType: TreeCompressionStrategy.Uncompressed,\n * });\n * ```\n * @privateRemarks\n * This should be legacy, but has to be internal due to limitations of API tagging preventing it from being both alpha and alpha+legacy.\n * TODO:\n * Expose Ajv validator for better error message quality somehow.\n * Maybe as part of a test utils or dev-tool package?\n * @internal\n */\nexport function configuredSharedTree(\n\toptions: SharedTreeOptions,\n): ISharedObjectKind<ITree> & SharedObjectKind<ITree> {\n\tclass ConfiguredFactory extends TreeFactory {\n\t\tpublic constructor() {\n\t\t\tsuper(options);\n\t\t}\n\t}\n\treturn createSharedObjectKind<ITree>(ConfiguredFactory);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"treeFactory.js","sourceRoot":"","sources":["../src/treeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAGN,oBAAoB,GAKpB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EACN,gBAAgB,GAKhB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AASxF;;;;;GAKG;AACH,SAAS,iBAAiB,CACzB,OAAkC;IAElC,SAAS,kBAAkB,CAAC,IAAgB;QAC3C,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACrC,MAAM,IAAI,UAAU,CAAC,gDAAgD,CAAC,CAAC;QACxE,CAAC;QACD,OAAO,IAAI,gBAAgB,CAC1B,IAAI,SAAS,CAAC,YAAY,CAAC,EAC3B,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,kBAAkB,EACvB,IAAI,CAAC,kBAAkB,EACvB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,YAAY,EACjB,OAAO,CACP,CAAC;IACH,CAAC;IAED,OAAO;QACN,MAAM,EAAE,CAAC,IAAgB,EAAoC,EAAE;YAC9D,MAAM,CAAC,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACnC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACpC,CAAC;QAED,KAAK,CAAC,QAAQ,CACb,IAAgB,EAChB,OAA+B;YAE/B,MAAM,CAAC,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACnC,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC1B,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACpC,CAAC;KACD,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,oBAAoB,CACnC,OAA0B;IAE1B,MAAM,mBAAmB,GAA+B;QACvD,IAAI,EAAE,qBAAqB;QAC3B,UAAU,EAAE,oBAAoB;QAChC,sBAAsB,EAAE,mBAAmB;QAC3C,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC;KACnC,CAAC;IAEF,OAAO,oBAAoB,CAAQ,mBAAmB,CAAC,CAAC;AACzD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\n\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport {\n\ttype ISharedObject,\n\ttype ISharedObjectKind,\n\tmakeSharedObjectKind,\n\ttype KernelArgs,\n\ttype SharedKernelFactory,\n\ttype SharedObjectOptions,\n\ttype FactoryOut,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport {\n\tSharedTreeKernel,\n\ttype ITreePrivate,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsInternal,\n\ttype SharedTreeKernelView,\n} from \"./shared-tree/index.js\";\nimport type { ITree } from \"./simple-tree/index.js\";\n\nimport { Breakable } from \"./util/index.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { SharedTreeFactoryType, SharedTreeAttributes } from \"./sharedTreeAttributes.js\";\n\n/**\n * {@link ITreePrivate} extended with ISharedObject.\n * @remarks\n * This is used when integration testing this package with the Fluid runtime as it exposes the APIs the runtime consumes to manipulate the tree.\n */\nexport interface ISharedTree extends ISharedObject, ITreePrivate {}\n\n/**\n * Creates a factory for shared tree kernels with the given options.\n * @remarks\n * Exposes {@link ITreePrivate} to allow access to internals in tests without a cast.\n * Code exposing this beyond this package will need to update to a more public type.\n */\nfunction treeKernelFactory(\n\toptions: SharedTreeOptionsInternal,\n): SharedKernelFactory<SharedTreeKernelView> {\n\tfunction treeFromKernelArgs(args: KernelArgs): SharedTreeKernel {\n\t\tif (args.idCompressor === undefined) {\n\t\t\tthrow new UsageError(\"IdCompressor must be enabled to use SharedTree\");\n\t\t}\n\t\treturn new SharedTreeKernel(\n\t\t\tnew Breakable(\"SharedTree\"),\n\t\t\targs.sharedObject,\n\t\t\targs.serializer,\n\t\t\targs.submitLocalMessage,\n\t\t\targs.lastSequenceNumber,\n\t\t\targs.logger,\n\t\t\targs.idCompressor,\n\t\t\toptions,\n\t\t);\n\t}\n\n\treturn {\n\t\tcreate: (args: KernelArgs): FactoryOut<SharedTreeKernelView> => {\n\t\t\tconst k = treeFromKernelArgs(args);\n\t\t\treturn { kernel: k, view: k.view };\n\t\t},\n\n\t\tasync loadCore(\n\t\t\targs: KernelArgs,\n\t\t\tstorage: IChannelStorageService,\n\t\t): Promise<FactoryOut<SharedTreeKernelView>> {\n\t\t\tconst k = treeFromKernelArgs(args);\n\t\t\tawait k.loadCore(storage);\n\t\t\treturn { kernel: k, view: k.view };\n\t\t},\n\t};\n}\n\n/**\n * SharedTree is a hierarchical data structure for collaboratively editing strongly typed JSON-like trees\n * of objects, arrays, and other data types.\n * @legacy\n * @alpha\n */\nexport const SharedTree = configuredSharedTree({});\n\n/**\n * {@link SharedTree} but allowing a non-default configuration.\n * @remarks\n * This is useful for debugging and testing to opt into extra validation or see if opting out of some optimizations fixes an issue.\n * @example\n * ```typescript\n * import {\n * \tForestType,\n * \tTreeCompressionStrategy,\n * \tconfiguredSharedTree,\n * \ttypeboxValidator,\n * \t// eslint-disable-next-line import/no-internal-modules\n * } from \"@fluidframework/tree/internal\";\n * const SharedTree = configuredSharedTree({\n * \tforest: ForestType.Reference,\n * \tjsonValidator: typeboxValidator,\n * \ttreeEncodeType: TreeCompressionStrategy.Uncompressed,\n * });\n * ```\n * @privateRemarks\n * This should be legacy, but has to be internal due to limitations of API tagging preventing it from being both alpha and alpha+legacy.\n * TODO:\n * Expose Ajv validator for better error message quality somehow.\n * Maybe as part of a test utils or dev-tool package?\n * @internal\n */\nexport function configuredSharedTree(\n\toptions: SharedTreeOptions,\n): ISharedObjectKind<ITree> & SharedObjectKind<ITree> {\n\tconst sharedObjectOptions: SharedObjectOptions<ITree> = {\n\t\ttype: SharedTreeFactoryType,\n\t\tattributes: SharedTreeAttributes,\n\t\ttelemetryContextPrefix: \"fluid_sharedTree_\",\n\t\tfactory: treeKernelFactory(options),\n\t};\n\n\treturn makeSharedObjectKind<ITree>(sharedObjectOptions);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/tree",
|
|
3
|
-
"version": "2.40.0
|
|
3
|
+
"version": "2.40.0",
|
|
4
4
|
"description": "Distributed tree",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -89,17 +89,17 @@
|
|
|
89
89
|
"temp-directory": "nyc/.nyc_output"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@fluid-internal/client-utils": "2.40.0
|
|
93
|
-
"@fluidframework/container-runtime": "2.40.0
|
|
94
|
-
"@fluidframework/core-interfaces": "2.40.0
|
|
95
|
-
"@fluidframework/core-utils": "2.40.0
|
|
96
|
-
"@fluidframework/datastore-definitions": "2.40.0
|
|
97
|
-
"@fluidframework/driver-definitions": "2.40.0
|
|
98
|
-
"@fluidframework/id-compressor": "2.40.0
|
|
99
|
-
"@fluidframework/runtime-definitions": "2.40.0
|
|
100
|
-
"@fluidframework/runtime-utils": "2.40.0
|
|
101
|
-
"@fluidframework/shared-object-base": "2.40.0
|
|
102
|
-
"@fluidframework/telemetry-utils": "2.40.0
|
|
92
|
+
"@fluid-internal/client-utils": "~2.40.0",
|
|
93
|
+
"@fluidframework/container-runtime": "~2.40.0",
|
|
94
|
+
"@fluidframework/core-interfaces": "~2.40.0",
|
|
95
|
+
"@fluidframework/core-utils": "~2.40.0",
|
|
96
|
+
"@fluidframework/datastore-definitions": "~2.40.0",
|
|
97
|
+
"@fluidframework/driver-definitions": "~2.40.0",
|
|
98
|
+
"@fluidframework/id-compressor": "~2.40.0",
|
|
99
|
+
"@fluidframework/runtime-definitions": "~2.40.0",
|
|
100
|
+
"@fluidframework/runtime-utils": "~2.40.0",
|
|
101
|
+
"@fluidframework/shared-object-base": "~2.40.0",
|
|
102
|
+
"@fluidframework/telemetry-utils": "~2.40.0",
|
|
103
103
|
"@sinclair/typebox": "^0.34.13",
|
|
104
104
|
"@tylerbu/sorted-btree-es6": "^1.8.0",
|
|
105
105
|
"@types/ungap__structured-clone": "^1.2.0",
|
|
@@ -109,19 +109,19 @@
|
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
111
111
|
"@biomejs/biome": "~1.9.3",
|
|
112
|
-
"@fluid-internal/mocha-test-setup": "2.40.0
|
|
113
|
-
"@fluid-private/stochastic-test-utils": "2.40.0
|
|
114
|
-
"@fluid-private/test-dds-utils": "2.40.0
|
|
115
|
-
"@fluid-private/test-drivers": "2.40.0
|
|
116
|
-
"@fluid-tools/benchmark": "^0.
|
|
112
|
+
"@fluid-internal/mocha-test-setup": "~2.40.0",
|
|
113
|
+
"@fluid-private/stochastic-test-utils": "~2.40.0",
|
|
114
|
+
"@fluid-private/test-dds-utils": "~2.40.0",
|
|
115
|
+
"@fluid-private/test-drivers": "~2.40.0",
|
|
116
|
+
"@fluid-tools/benchmark": "^0.51.0",
|
|
117
117
|
"@fluid-tools/build-cli": "^0.55.0",
|
|
118
118
|
"@fluidframework/build-common": "^2.0.3",
|
|
119
119
|
"@fluidframework/build-tools": "^0.55.0",
|
|
120
|
-
"@fluidframework/container-definitions": "2.40.0
|
|
121
|
-
"@fluidframework/container-loader": "2.40.0
|
|
120
|
+
"@fluidframework/container-definitions": "~2.40.0",
|
|
121
|
+
"@fluidframework/container-loader": "~2.40.0",
|
|
122
122
|
"@fluidframework/eslint-config-fluid": "^5.7.3",
|
|
123
|
-
"@fluidframework/test-runtime-utils": "2.40.0
|
|
124
|
-
"@fluidframework/test-utils": "2.40.0
|
|
123
|
+
"@fluidframework/test-runtime-utils": "~2.40.0",
|
|
124
|
+
"@fluidframework/test-utils": "~2.40.0",
|
|
125
125
|
"@fluidframework/tree-previous": "npm:@fluidframework/tree@2.33.0",
|
|
126
126
|
"@microsoft/api-extractor": "7.52.5",
|
|
127
127
|
"@types/diff": "^3.5.1",
|
package/src/codec/codec.ts
CHANGED
|
@@ -350,6 +350,11 @@ export enum FluidClientVersion {
|
|
|
350
350
|
v2_1 = "v2_1",
|
|
351
351
|
/** Fluid Framework Client 2.2 and newer. */
|
|
352
352
|
v2_2 = "v2_2",
|
|
353
|
-
/** Fluid Framework Client 2.
|
|
353
|
+
/** Fluid Framework Client 2.3 and newer. */
|
|
354
354
|
v2_3 = "v2_3",
|
|
355
355
|
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* The version of this code.
|
|
359
|
+
*/
|
|
360
|
+
export const currentVersion: FluidClientVersion = FluidClientVersion.v2_3;
|
package/src/codec/index.ts
CHANGED
package/src/core/index.ts
CHANGED
|
@@ -137,7 +137,7 @@ export {
|
|
|
137
137
|
identifierFieldKindIdentifier,
|
|
138
138
|
storedEmptyFieldSchema,
|
|
139
139
|
type StoredSchemaCollection,
|
|
140
|
-
|
|
140
|
+
schemaFormatV1,
|
|
141
141
|
LeafNodeStoredSchema,
|
|
142
142
|
ObjectNodeStoredSchema,
|
|
143
143
|
MapNodeStoredSchema,
|
|
@@ -208,7 +208,6 @@ export {
|
|
|
208
208
|
type Adapters,
|
|
209
209
|
AdaptedViewSchema,
|
|
210
210
|
type TreeAdapter,
|
|
211
|
-
AllowedUpdateType,
|
|
212
211
|
} from "./schema-view/index.js";
|
|
213
212
|
|
|
214
213
|
export {
|
|
@@ -32,7 +32,7 @@ export {
|
|
|
32
32
|
} from "./storedSchemaRepository.js";
|
|
33
33
|
export { Multiplicity } from "./multiplicity.js";
|
|
34
34
|
|
|
35
|
-
export type { TreeNodeSchemaIdentifier, FieldKey, FieldKindIdentifier } from "./
|
|
35
|
+
export type { TreeNodeSchemaIdentifier, FieldKey, FieldKindIdentifier } from "./formatV1.js";
|
|
36
36
|
|
|
37
|
-
import * as
|
|
38
|
-
export {
|
|
37
|
+
import * as schemaFormatV1 from "./formatV1.js";
|
|
38
|
+
export { schemaFormatV1 };
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
PersistedValueSchema,
|
|
14
14
|
type TreeNodeSchemaDataFormat,
|
|
15
15
|
type TreeNodeSchemaIdentifier,
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./formatV1.js";
|
|
17
17
|
import type { Multiplicity } from "./multiplicity.js";
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -126,7 +126,9 @@ export interface TreeFieldStoredSchema {
|
|
|
126
126
|
*
|
|
127
127
|
* @remarks
|
|
128
128
|
* This mainly show up in:
|
|
129
|
+
*
|
|
129
130
|
* 1. The root default field for documents.
|
|
131
|
+
*
|
|
130
132
|
* 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.
|
|
131
133
|
*/
|
|
132
134
|
export const forbiddenFieldKindIdentifier = "Forbidden";
|