@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.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { type FieldHasDefault, type ImplicitAllowedTypes, type
|
|
5
|
+
import { type FieldHasDefault, type ImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type NodeKind, type SchemaFactoryAlpha, type ScopedSchemaName, TreeArrayNode, type TreeNode, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type WithType, type TreeFieldFromImplicitField, type InsertableTreeFieldFromImplicitField, type InternalTreeNode, SchemaFactory, type ImplicitAnnotatedFieldSchema, type UnannotateImplicitFieldSchema } from "./simple-tree/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* Not intended for use outside of this package.
|
|
8
8
|
*
|
|
@@ -14,18 +14,27 @@ import { type FieldHasDefault, type ImplicitAllowedTypes, type ImplicitFieldSche
|
|
|
14
14
|
* @system @internal
|
|
15
15
|
*/
|
|
16
16
|
export declare namespace System_TableSchema {
|
|
17
|
+
/**
|
|
18
|
+
* Default type used for column and row "props" fields.
|
|
19
|
+
* @privateRemarks
|
|
20
|
+
* Longer term, it would be better to simply omit "props" altogether by default.
|
|
21
|
+
* For now, this ensures that the user doesn't have to specify a "props" entry when initializing column/row nodes
|
|
22
|
+
* and ensures that they cannot set anything that might conflict with future evolutions of the schema.
|
|
23
|
+
* @system @internal
|
|
24
|
+
*/
|
|
25
|
+
type DefaultPropsType = ReturnType<typeof SchemaFactory.optional<[]>>;
|
|
17
26
|
/**
|
|
18
27
|
* A base interface for factory input options which include an schema factory.
|
|
19
28
|
* @remarks This interface should not be referenced directly.
|
|
20
29
|
* @privateRemarks This interface primarily exists to provide a single home for property documentation.
|
|
21
30
|
* @system @internal
|
|
22
31
|
*/
|
|
23
|
-
interface OptionsWithSchemaFactory<
|
|
32
|
+
interface OptionsWithSchemaFactory<TSchemaFactory extends SchemaFactoryAlpha> {
|
|
24
33
|
/**
|
|
25
34
|
* Schema factory with which the Column schema will be associated.
|
|
26
35
|
* @remarks Can be used to associate the resulting schema with an existing {@link SchemaFactory.scope|scope}.
|
|
27
36
|
*/
|
|
28
|
-
readonly schemaFactory:
|
|
37
|
+
readonly schemaFactory: TSchemaFactory;
|
|
29
38
|
}
|
|
30
39
|
/**
|
|
31
40
|
* A base interface for factory input options which include the table cell schema.
|
|
@@ -33,7 +42,7 @@ export declare namespace System_TableSchema {
|
|
|
33
42
|
* @privateRemarks This interface primarily exists to provide a single home for property documentation.
|
|
34
43
|
* @system @internal
|
|
35
44
|
*/
|
|
36
|
-
interface OptionsWithCellSchema<TCellSchema extends ImplicitAllowedTypes
|
|
45
|
+
interface OptionsWithCellSchema<TCellSchema extends ImplicitAllowedTypes> {
|
|
37
46
|
/**
|
|
38
47
|
* Schema for the table's cells.
|
|
39
48
|
*/
|
|
@@ -44,12 +53,12 @@ export declare namespace System_TableSchema {
|
|
|
44
53
|
* @remarks Includes parameters common to all column factory overloads.
|
|
45
54
|
* @system @internal
|
|
46
55
|
*/
|
|
47
|
-
type CreateColumnOptionsBase<
|
|
56
|
+
type CreateColumnOptionsBase<TSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha> = OptionsWithSchemaFactory<TSchemaFactory>;
|
|
48
57
|
/**
|
|
49
58
|
* Factory for creating new table column schema.
|
|
50
59
|
* @system @internal
|
|
51
60
|
*/
|
|
52
|
-
function createColumnInternal<const TInputScope extends string | undefined, const TPropsSchema extends ImplicitAnnotatedFieldSchema>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Column">, NodeKind.Object, TreeNode & TableSchema.
|
|
61
|
+
function createColumnInternal<const TInputScope extends string | undefined, const TPropsSchema extends ImplicitAnnotatedFieldSchema>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Column">, NodeKind.Object, TreeNode & TableSchema.Column<TPropsSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Column">, NodeKind, unknown>, object & {
|
|
53
62
|
readonly id?: string | undefined;
|
|
54
63
|
} & (FieldHasDefault<UnannotateImplicitFieldSchema<TPropsSchema>> extends true ? {
|
|
55
64
|
/**
|
|
@@ -65,62 +74,62 @@ export declare namespace System_TableSchema {
|
|
|
65
74
|
props: InsertableTreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TPropsSchema>>;
|
|
66
75
|
}), true, {
|
|
67
76
|
readonly props: TPropsSchema;
|
|
68
|
-
readonly id: FieldSchema<FieldKind.Identifier, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, unknown>;
|
|
77
|
+
readonly id: import("./simple-tree/schemaTypes.js").FieldSchema<import("./simple-tree/schemaTypes.js").FieldKind.Identifier, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, unknown>;
|
|
69
78
|
}>;
|
|
70
79
|
/**
|
|
71
80
|
* Base column schema type.
|
|
72
81
|
* @sealed @system @internal
|
|
73
82
|
*/
|
|
74
|
-
type ColumnSchemaBase<TScope extends string | undefined = string | undefined, TPropsSchema extends
|
|
83
|
+
type ColumnSchemaBase<TScope extends string | undefined = string | undefined, TPropsSchema extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema> = ReturnType<typeof createColumnInternal<TScope, TPropsSchema>>;
|
|
75
84
|
/**
|
|
76
85
|
* Base options for creating table row schema.
|
|
77
86
|
* @remarks Includes parameters common to all row factory overloads.
|
|
78
87
|
* @system @internal
|
|
79
88
|
*/
|
|
80
|
-
type CreateRowOptionsBase<
|
|
89
|
+
type CreateRowOptionsBase<TSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha, TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;
|
|
81
90
|
/**
|
|
82
91
|
* Factory for creating new table row schema.
|
|
83
92
|
*
|
|
84
93
|
* @sealed @internal
|
|
85
94
|
*/
|
|
86
|
-
function createRowInternal<const TInputScope extends string | undefined, const TCellSchema extends ImplicitAllowedTypes, const TPropsSchema extends
|
|
95
|
+
function createRowInternal<const TInputScope extends string | undefined, const TCellSchema extends ImplicitAllowedTypes, const TPropsSchema extends ImplicitAnnotatedFieldSchema>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, cellSchema: TCellSchema, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row">, NodeKind.Object, TreeNode & TableSchema.Row<TCellSchema, TPropsSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row">, NodeKind, unknown>, object & {
|
|
87
96
|
readonly id?: string | undefined;
|
|
88
97
|
readonly cells: (import("./simple-tree/schemaTypes.js").InsertableTypedNode<TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, import("./simple-tree/mapNode.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, true, TCellSchema, import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema>, unknown> & (new (data?: InternalTreeNode | import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema> | undefined) => import("./simple-tree/mapNode.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>)> | undefined) & import("./simple-tree/schemaTypes.js").InsertableTypedNode<TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, import("./simple-tree/mapNode.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, true, TCellSchema, import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema>, unknown> & (new (data?: InternalTreeNode | import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema> | undefined) => import("./simple-tree/mapNode.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>)>;
|
|
89
|
-
} & (FieldHasDefault<TPropsSchema
|
|
98
|
+
} & (FieldHasDefault<UnannotateImplicitFieldSchema<TPropsSchema>> extends true ? {
|
|
90
99
|
/**
|
|
91
100
|
* The row's properties.
|
|
92
101
|
* @remarks This is a user-defined schema that can be used to store additional information
|
|
93
102
|
* about the row.
|
|
94
103
|
*/
|
|
95
|
-
props?: InsertableTreeFieldFromImplicitField<TPropsSchema
|
|
104
|
+
props?: InsertableTreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TPropsSchema>> | undefined;
|
|
96
105
|
} : {
|
|
97
106
|
/**
|
|
98
107
|
* The row's properties.
|
|
99
108
|
* @remarks This is a user-defined schema that can be used to store additional information
|
|
100
109
|
* about the row.
|
|
101
110
|
*/
|
|
102
|
-
props: InsertableTreeFieldFromImplicitField<TPropsSchema
|
|
111
|
+
props: InsertableTreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TPropsSchema>>;
|
|
103
112
|
}), true, {
|
|
104
113
|
readonly props: TPropsSchema;
|
|
105
|
-
readonly id: FieldSchema<FieldKind.Identifier, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, unknown>;
|
|
106
|
-
readonly cells: FieldSchema<FieldKind.Required, TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, import("./simple-tree/mapNode.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, unknown>;
|
|
114
|
+
readonly id: import("./simple-tree/schemaTypes.js").FieldSchema<import("./simple-tree/schemaTypes.js").FieldKind.Identifier, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, unknown>;
|
|
115
|
+
readonly cells: import("./simple-tree/schemaTypes.js").FieldSchema<import("./simple-tree/schemaTypes.js").FieldKind.Required, TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, import("./simple-tree/mapNode.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, unknown>;
|
|
107
116
|
}>;
|
|
108
117
|
/**
|
|
109
118
|
* Base row schema type.
|
|
110
119
|
* @sealed @system @internal
|
|
111
120
|
*/
|
|
112
|
-
type RowSchemaBase<TScope extends string | undefined = string | undefined, TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes, TPropsSchema extends
|
|
121
|
+
type RowSchemaBase<TScope extends string | undefined = string | undefined, TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes, TPropsSchema extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema> = ReturnType<typeof createRowInternal<TScope, TCellSchema, TPropsSchema>>;
|
|
113
122
|
/**
|
|
114
123
|
* Base options for creating table schema.
|
|
115
124
|
* @remarks Includes parameters common to all table factory overloads.
|
|
116
125
|
* @system @internal
|
|
117
126
|
*/
|
|
118
|
-
type TableFactoryOptionsBase<
|
|
127
|
+
type TableFactoryOptionsBase<TSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha, TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;
|
|
119
128
|
/**
|
|
120
129
|
* Factory for creating new table schema.
|
|
121
130
|
* @system @internal
|
|
122
131
|
*/
|
|
123
|
-
function createTableInternal<const TInputScope extends string | undefined, const TCellSchema extends ImplicitAllowedTypes, const TColumnSchema extends ColumnSchemaBase<TInputScope
|
|
132
|
+
function createTableInternal<const TInputScope extends string | undefined, const TCellSchema extends ImplicitAllowedTypes, const TColumnSchema extends ColumnSchemaBase<TInputScope>, const TRowSchema extends RowSchemaBase<TInputScope, TCellSchema>>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, _cellSchema: TCellSchema, columnSchema: TColumnSchema, rowSchema: TRowSchema): TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table">, NodeKind.Object, TreeNode & TableSchema.Table<TCellSchema, TColumnSchema, TRowSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table">, NodeKind, unknown>, object & {
|
|
124
133
|
readonly rows: (import("./simple-tree/schemaTypes.js").InsertableTypedNode<import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, true, TRowSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>> | undefined) => TreeArrayNode<TRowSchema, [TRowSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TRowSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TRowSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, unknown>), import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, true, TRowSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>> | undefined) => TreeArrayNode<TRowSchema, [TRowSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TRowSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TRowSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, unknown>)> | undefined) & import("./simple-tree/schemaTypes.js").InsertableTypedNode<import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, true, TRowSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>> | undefined) => TreeArrayNode<TRowSchema, [TRowSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TRowSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TRowSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, unknown>), import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, true, TRowSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>> | undefined) => TreeArrayNode<TRowSchema, [TRowSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TRowSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TRowSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, unknown>)>;
|
|
125
134
|
readonly columns: (import("./simple-tree/schemaTypes.js").InsertableTypedNode<import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, true, TColumnSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>> | undefined) => TreeArrayNode<TColumnSchema, [TColumnSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TColumnSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TColumnSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, unknown>), import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, true, TColumnSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>> | undefined) => TreeArrayNode<TColumnSchema, [TColumnSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TColumnSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TColumnSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, unknown>)> | undefined) & import("./simple-tree/schemaTypes.js").InsertableTypedNode<import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, true, TColumnSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>> | undefined) => TreeArrayNode<TColumnSchema, [TColumnSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TColumnSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TColumnSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, unknown>), import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, true, TColumnSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>> | undefined) => TreeArrayNode<TColumnSchema, [TColumnSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TColumnSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TColumnSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, unknown>)>;
|
|
126
135
|
}, true, {
|
|
@@ -131,11 +140,95 @@ export declare namespace System_TableSchema {
|
|
|
131
140
|
* Base row schema type.
|
|
132
141
|
* @sealed @system @internal
|
|
133
142
|
*/
|
|
134
|
-
type TableSchemaBase<TScope extends string | undefined, TCell extends ImplicitAllowedTypes, TColumn extends ColumnSchemaBase<TScope
|
|
143
|
+
type TableSchemaBase<TScope extends string | undefined, TCell extends ImplicitAllowedTypes, TColumn extends ColumnSchemaBase<TScope>, TRow extends RowSchemaBase<TScope, TCell>> = ReturnType<typeof createTableInternal<TScope, TCell, TColumn, TRow>>;
|
|
135
144
|
}
|
|
136
145
|
/**
|
|
137
146
|
* Contains types and factories for creating schema to represent dynamic tabular data.
|
|
138
|
-
*
|
|
147
|
+
*
|
|
148
|
+
* @remarks
|
|
149
|
+
*
|
|
150
|
+
* Tables created using these APIs are...
|
|
151
|
+
*
|
|
152
|
+
* - sparse, meaning that cells may be omitted, and new rows are empty by default.
|
|
153
|
+
*
|
|
154
|
+
* - dynamic, meaning that their structure can be modified at runtime.
|
|
155
|
+
* Columns and rows can be inserted, removed, modified, and reordered.
|
|
156
|
+
* Cells can be inserted, removed, and modified.
|
|
157
|
+
*
|
|
158
|
+
* - row-major, meaning that operating on rows (including inserts, removal, moves, and traversal) is more efficient than operating on columns.
|
|
159
|
+
*
|
|
160
|
+
* Column and Row schema created using these APIs are extensible via the `props` field.
|
|
161
|
+
* This allows association of additional properties with column and row nodes.
|
|
162
|
+
*
|
|
163
|
+
* Note: for now it is possible for table cells to become "orphaned".
|
|
164
|
+
* That is, it is possible to enter a state where one or more rows contain cells with no corresponding column.
|
|
165
|
+
* To help avoid this situation, you can manually remove corresponding cells when removing columns.
|
|
166
|
+
* Either way, it is possible to enter such a state via the merging of edits.
|
|
167
|
+
* For example: one client might add a row while another concurrently removes a column, orphaning the cell where the column and row intersected.
|
|
168
|
+
*
|
|
169
|
+
* @example Using default Column and Row schema
|
|
170
|
+
*
|
|
171
|
+
* ```typescript
|
|
172
|
+
* class Cell extends schemaFactory.object("TableCell", {
|
|
173
|
+
* value: schemaFactory.string,
|
|
174
|
+
* }) {}
|
|
175
|
+
*
|
|
176
|
+
* class Table extends TableSchema.createTable({
|
|
177
|
+
* schemaFactory,
|
|
178
|
+
* cell: Cell,
|
|
179
|
+
* }) {}
|
|
180
|
+
*
|
|
181
|
+
* const table = new Table({
|
|
182
|
+
* columns: [{ id: "column-0" }],
|
|
183
|
+
* rows: [{ id: "row-0", cells: {} }],
|
|
184
|
+
* });
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* @example Customizing Column and Row schema
|
|
188
|
+
*
|
|
189
|
+
* ```typescript
|
|
190
|
+
* class Cell extends schemaFactory.object("TableCell", {
|
|
191
|
+
* value: schemaFactory.string,
|
|
192
|
+
* }) {}
|
|
193
|
+
*
|
|
194
|
+
* class ColumnProps extends schemaFactory.object("TableColumnProps", {
|
|
195
|
+
* // Column label to display.
|
|
196
|
+
* label: schemaFactory.string,
|
|
197
|
+
* // The type of data represented by the cells. Default: string.
|
|
198
|
+
* dataType: schemaFactory.optional(schemaFactory.string),
|
|
199
|
+
* }) {}
|
|
200
|
+
*
|
|
201
|
+
* class Column extends TableSchema.createColumn({
|
|
202
|
+
* schemaFactory,
|
|
203
|
+
* props: ColumnProps,
|
|
204
|
+
* }) {}
|
|
205
|
+
*
|
|
206
|
+
* class Row extends TableSchema.createRow({
|
|
207
|
+
* schemaFactory,
|
|
208
|
+
* cell: Cell,
|
|
209
|
+
* }) {}
|
|
210
|
+
*
|
|
211
|
+
* class Table extends TableSchema.createTable({
|
|
212
|
+
* schemaFactory,
|
|
213
|
+
* cell: Cell,
|
|
214
|
+
* column: Column,
|
|
215
|
+
* row: Row,
|
|
216
|
+
* }) {}
|
|
217
|
+
*
|
|
218
|
+
* const table = new Table({
|
|
219
|
+
* columns: [
|
|
220
|
+
* new Column({ props: { label: "Entry", dataType: "string" } }),
|
|
221
|
+
* new Column({ props: { label: "Date", dataType: "date" } }),
|
|
222
|
+
* new Column({ props: { label: "Amount", dataType: "number" } }),
|
|
223
|
+
* ],
|
|
224
|
+
* rows: [],
|
|
225
|
+
* });
|
|
226
|
+
* ```
|
|
227
|
+
*
|
|
228
|
+
* @privateRemarks
|
|
229
|
+
* The above examples are backed by tests in `tableSchema.spec.ts`.
|
|
230
|
+
* Those tests and these examples should be kept in-sync to ensure that the examples are correct.
|
|
231
|
+
*
|
|
139
232
|
* @internal
|
|
140
233
|
*/
|
|
141
234
|
export declare namespace TableSchema {
|
|
@@ -144,7 +237,7 @@ export declare namespace TableSchema {
|
|
|
144
237
|
* @remarks Implemented by the schema class returned from {@link TableSchema.(createColumn:2)}.
|
|
145
238
|
* @sealed @internal
|
|
146
239
|
*/
|
|
147
|
-
interface
|
|
240
|
+
interface Column<TProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema> {
|
|
148
241
|
/**
|
|
149
242
|
* The unique identifier of the column.
|
|
150
243
|
* @remarks Uniquely identifies the node within the entire tree, not just the table.
|
|
@@ -157,30 +250,30 @@ export declare namespace TableSchema {
|
|
|
157
250
|
* Note: these docs are duplicated on the inline type definitions in {@link createColumn}.
|
|
158
251
|
* If you update the docs here, please also update the inline type definitions.
|
|
159
252
|
*/
|
|
160
|
-
get props(): TreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps
|
|
253
|
+
get props(): TreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps>>;
|
|
161
254
|
set props(value: InsertableTreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps>>);
|
|
162
255
|
}
|
|
163
256
|
/**
|
|
164
257
|
* Factory for creating new table column schema.
|
|
165
258
|
* @internal
|
|
166
259
|
*/
|
|
167
|
-
function createColumn<const TScope extends string | undefined>({ schemaFactory, }: System_TableSchema.CreateColumnOptionsBase<TScope
|
|
260
|
+
function createColumn<const TScope extends string | undefined>({ schemaFactory, }: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryAlpha<TScope>>): System_TableSchema.ColumnSchemaBase<TScope, System_TableSchema.DefaultPropsType>;
|
|
168
261
|
/**
|
|
169
262
|
* Factory for creating new table column schema.
|
|
170
263
|
* @internal
|
|
171
264
|
*/
|
|
172
|
-
function createColumn<const TScope extends string | undefined, const TProps extends
|
|
265
|
+
function createColumn<const TScope extends string | undefined, const TProps extends ImplicitAnnotatedFieldSchema>({ schemaFactory, props, }: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryAlpha<TScope>> & {
|
|
173
266
|
/**
|
|
174
267
|
* Optional column properties.
|
|
175
268
|
*/
|
|
176
269
|
readonly props: TProps;
|
|
177
|
-
}):
|
|
270
|
+
}): System_TableSchema.ColumnSchemaBase<TScope, TProps>;
|
|
178
271
|
/**
|
|
179
272
|
* A row in a table.
|
|
180
273
|
* @remarks Implemented by the schema class returned from {@link TableSchema.(createRow:2)}.
|
|
181
274
|
* @sealed @internal
|
|
182
275
|
*/
|
|
183
|
-
interface
|
|
276
|
+
interface Row<TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes, TProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema> {
|
|
184
277
|
/**
|
|
185
278
|
* The unique identifier of the row.
|
|
186
279
|
* @remarks Uniquely identifies the node within the entire tree, not just the table.
|
|
@@ -189,8 +282,9 @@ export declare namespace TableSchema {
|
|
|
189
282
|
/**
|
|
190
283
|
* Gets the cell in the specified column.
|
|
191
284
|
* @returns The cell if it exists, otherwise undefined.
|
|
285
|
+
* @privateRemarks TODO: throw if the column does not belong to the same table as the row.
|
|
192
286
|
*/
|
|
193
|
-
getCell(column:
|
|
287
|
+
getCell(column: Column): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
194
288
|
/**
|
|
195
289
|
* Gets the cell in the specified column, denoted by column ID.
|
|
196
290
|
* @returns The cell if it exists, otherwise undefined.
|
|
@@ -198,24 +292,26 @@ export declare namespace TableSchema {
|
|
|
198
292
|
getCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
199
293
|
/**
|
|
200
294
|
* Sets the cell in the specified column.
|
|
201
|
-
* @remarks To remove a cell, call {@link TableSchema.
|
|
295
|
+
* @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:1)} instead.
|
|
296
|
+
* @privateRemarks TODO: Throw an error if the column does not exist in the table.
|
|
202
297
|
*/
|
|
203
|
-
setCell(column:
|
|
298
|
+
setCell(column: Column, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
|
|
204
299
|
/**
|
|
205
300
|
* Sets the cell in the specified column, denoted by column ID.
|
|
206
|
-
* @remarks To remove a cell, call {@link TableSchema.
|
|
301
|
+
* @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:2)} instead.
|
|
207
302
|
*/
|
|
208
303
|
setCell(columnId: string, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
|
|
209
304
|
/**
|
|
210
305
|
* Removes the cell in the specified column.
|
|
211
|
-
* @
|
|
306
|
+
* @returns The cell if it exists, otherwise undefined.
|
|
307
|
+
* @privateRemarks TODO: Throw if the column does not belong to the same table as the row.
|
|
212
308
|
*/
|
|
213
|
-
removeCell(column:
|
|
309
|
+
removeCell(column: Column): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
214
310
|
/**
|
|
215
311
|
* Removes the cell in the specified column, denoted by column ID.
|
|
216
|
-
* @
|
|
312
|
+
* @returns The cell if it exists, otherwise undefined.
|
|
217
313
|
*/
|
|
218
|
-
removeCell(columnId: string):
|
|
314
|
+
removeCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
219
315
|
/**
|
|
220
316
|
* The row's properties.
|
|
221
317
|
* @remarks This is a user-defined schema that can be used to store additional information about the row.
|
|
@@ -230,36 +326,36 @@ export declare namespace TableSchema {
|
|
|
230
326
|
* Factory for creating new table column schema.
|
|
231
327
|
* @internal
|
|
232
328
|
*/
|
|
233
|
-
function createRow<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes>({ schemaFactory, cell, }: System_TableSchema.CreateRowOptionsBase<TScope
|
|
329
|
+
function createRow<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes>({ schemaFactory, cell, }: System_TableSchema.CreateRowOptionsBase<SchemaFactoryAlpha<TScope>, TCell>): System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>;
|
|
234
330
|
/**
|
|
235
331
|
* Factory for creating new table column schema.
|
|
236
332
|
* @internal
|
|
237
333
|
*/
|
|
238
|
-
function createRow<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TProps extends
|
|
334
|
+
function createRow<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitAnnotatedFieldSchema>({ schemaFactory, cell, props, }: System_TableSchema.CreateRowOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {
|
|
239
335
|
/**
|
|
240
336
|
* Optional row properties.
|
|
241
337
|
*/
|
|
242
338
|
readonly props: TProps;
|
|
243
|
-
}):
|
|
339
|
+
}): System_TableSchema.RowSchemaBase<TScope, TCell, TProps>;
|
|
244
340
|
/**
|
|
245
|
-
* A key to uniquely identify a cell
|
|
341
|
+
* A key to uniquely identify a cell within a table.
|
|
246
342
|
* @internal
|
|
247
343
|
*/
|
|
248
|
-
interface CellKey {
|
|
344
|
+
interface CellKey<TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
|
|
249
345
|
/**
|
|
250
|
-
* {@link TableSchema.
|
|
346
|
+
* {@link TableSchema.Column} or {@link TableSchema.Column.id} at which the cell is located.
|
|
251
347
|
*/
|
|
252
|
-
readonly
|
|
348
|
+
readonly column: string | TreeNodeFromImplicitAllowedTypes<TColumn>;
|
|
253
349
|
/**
|
|
254
|
-
* {@link TableSchema.
|
|
350
|
+
* {@link TableSchema.Row} or {@link TableSchema.Row.id} at which the cell is located.
|
|
255
351
|
*/
|
|
256
|
-
readonly
|
|
352
|
+
readonly row: string | TreeNodeFromImplicitAllowedTypes<TRow>;
|
|
257
353
|
}
|
|
258
354
|
/**
|
|
259
|
-
* {@link TableSchema.
|
|
355
|
+
* {@link TableSchema.Table.insertColumn} parameters.
|
|
260
356
|
* @internal
|
|
261
357
|
*/
|
|
262
|
-
interface InsertColumnParameters<
|
|
358
|
+
interface InsertColumnParameters<TColumn extends ImplicitAllowedTypes> {
|
|
263
359
|
/**
|
|
264
360
|
* The index at which to insert the new column.
|
|
265
361
|
* @remarks If not provided, the column will be appended to the end of the table.
|
|
@@ -268,13 +364,43 @@ export declare namespace TableSchema {
|
|
|
268
364
|
/**
|
|
269
365
|
* The column to insert.
|
|
270
366
|
*/
|
|
271
|
-
readonly column:
|
|
367
|
+
readonly column: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* {@link TableSchema.Table.insertColumns} parameters.
|
|
371
|
+
* @internal
|
|
372
|
+
*/
|
|
373
|
+
interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
|
|
374
|
+
/**
|
|
375
|
+
* The index at which to insert the new columns.
|
|
376
|
+
* @remarks If not provided, the columns will be appended to the end of the table.
|
|
377
|
+
*/
|
|
378
|
+
readonly index?: number | undefined;
|
|
379
|
+
/**
|
|
380
|
+
* The columns to insert.
|
|
381
|
+
*/
|
|
382
|
+
readonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
272
383
|
}
|
|
273
384
|
/**
|
|
274
|
-
* {@link TableSchema.
|
|
385
|
+
* {@link TableSchema.Table.insertRow} parameters.
|
|
275
386
|
* @internal
|
|
276
387
|
*/
|
|
277
|
-
interface
|
|
388
|
+
interface InsertRowParameters<TRow extends ImplicitAllowedTypes> {
|
|
389
|
+
/**
|
|
390
|
+
* The index at which to insert the new row.
|
|
391
|
+
* @remarks If not provided, the row will be appended to the end of the table.
|
|
392
|
+
*/
|
|
393
|
+
readonly index?: number | undefined;
|
|
394
|
+
/**
|
|
395
|
+
* The row to insert.
|
|
396
|
+
*/
|
|
397
|
+
readonly row: InsertableTreeNodeFromImplicitAllowedTypes<TRow>;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* {@link TableSchema.Table.insertRows} parameters.
|
|
401
|
+
* @internal
|
|
402
|
+
*/
|
|
403
|
+
interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
|
|
278
404
|
/**
|
|
279
405
|
* The index at which to insert the new rows.
|
|
280
406
|
* @remarks If not provided, the rows will be appended to the end of the table.
|
|
@@ -283,27 +409,27 @@ export declare namespace TableSchema {
|
|
|
283
409
|
/**
|
|
284
410
|
* The rows to insert.
|
|
285
411
|
*/
|
|
286
|
-
readonly rows:
|
|
412
|
+
readonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
287
413
|
}
|
|
288
414
|
/**
|
|
289
|
-
* {@link TableSchema.
|
|
415
|
+
* {@link TableSchema.Table.setCell} parameters.
|
|
290
416
|
* @internal
|
|
291
417
|
*/
|
|
292
|
-
interface SetCellParameters<
|
|
418
|
+
interface SetCellParameters<TCell extends ImplicitAllowedTypes, TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
|
|
293
419
|
/**
|
|
294
420
|
* The key to uniquely identify a cell in a table.
|
|
295
421
|
*/
|
|
296
|
-
readonly key: CellKey
|
|
422
|
+
readonly key: CellKey<TColumn, TRow>;
|
|
297
423
|
/**
|
|
298
424
|
* The cell to set.
|
|
299
425
|
*/
|
|
300
|
-
readonly cell:
|
|
426
|
+
readonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;
|
|
301
427
|
}
|
|
302
428
|
/**
|
|
303
429
|
* A table.
|
|
304
430
|
* @sealed @internal
|
|
305
431
|
*/
|
|
306
|
-
interface
|
|
432
|
+
interface Table<TCell extends ImplicitAllowedTypes, TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
|
|
307
433
|
/**
|
|
308
434
|
* The table's columns.
|
|
309
435
|
*/
|
|
@@ -313,78 +439,171 @@ export declare namespace TableSchema {
|
|
|
313
439
|
*/
|
|
314
440
|
readonly rows: TreeArrayNode<TRow>;
|
|
315
441
|
/**
|
|
316
|
-
* Gets a table column by its {@link TableSchema.
|
|
442
|
+
* Gets a table column by its {@link TableSchema.Column.id}.
|
|
317
443
|
*/
|
|
318
444
|
getColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
|
|
319
445
|
/**
|
|
320
|
-
* Gets a table row by its {@link TableSchema.
|
|
446
|
+
* Gets a table row by its {@link TableSchema.Row.id}.
|
|
321
447
|
*/
|
|
322
448
|
getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
|
|
323
449
|
/**
|
|
324
450
|
* Gets a cell in the table by column and row IDs.
|
|
325
451
|
* @param key - A key that uniquely distinguishes a cell in the table, represented as a combination of the column ID and row ID.
|
|
326
|
-
* @privateRemarks TODO: add overload that takes row and column nodes.
|
|
327
452
|
*/
|
|
328
|
-
getCell(key: CellKey): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
453
|
+
getCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
329
454
|
/**
|
|
330
455
|
* Inserts a column into the table.
|
|
331
|
-
*
|
|
332
|
-
|
|
333
|
-
|
|
456
|
+
*
|
|
457
|
+
* @throws
|
|
458
|
+
* Throws an error in the following cases:
|
|
459
|
+
*
|
|
460
|
+
* - The column, or a column with the same ID is already in the tree.
|
|
461
|
+
*
|
|
462
|
+
* - The specified index is out of range.
|
|
463
|
+
*
|
|
464
|
+
* No column is inserted in these cases.
|
|
465
|
+
*/
|
|
466
|
+
insertColumn(params: InsertColumnParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>;
|
|
467
|
+
/**
|
|
468
|
+
* Inserts 0 or more columns into the table.
|
|
469
|
+
*
|
|
470
|
+
* @throws
|
|
471
|
+
* Throws an error in the following cases:
|
|
472
|
+
*
|
|
473
|
+
* - At least one column, or a column with the same ID is already in the tree.
|
|
474
|
+
*
|
|
475
|
+
* - The specified index is out of range.
|
|
476
|
+
*
|
|
477
|
+
* No columns are inserted in these cases.
|
|
478
|
+
*/
|
|
479
|
+
insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
480
|
+
/**
|
|
481
|
+
* Inserts a row into the table.
|
|
482
|
+
*
|
|
483
|
+
* @throws
|
|
484
|
+
* Throws an error in the following cases:
|
|
485
|
+
*
|
|
486
|
+
* - The row, or a row with the same ID is already in the tree.
|
|
487
|
+
*
|
|
488
|
+
* - The row contains cells, but the table does not contain matching columns for one or more of those cells.
|
|
489
|
+
*
|
|
490
|
+
* - The specified index is out of range.
|
|
491
|
+
*
|
|
492
|
+
* No row is inserted in these cases.
|
|
493
|
+
*/
|
|
494
|
+
insertRow(params: InsertRowParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>;
|
|
334
495
|
/**
|
|
335
496
|
* Inserts 0 or more rows into the table.
|
|
336
|
-
*
|
|
337
|
-
|
|
338
|
-
|
|
497
|
+
*
|
|
498
|
+
* @throws
|
|
499
|
+
* Throws an error in the following cases:
|
|
500
|
+
*
|
|
501
|
+
* - At least one row, or a row with the same ID is already in the tree.
|
|
502
|
+
*
|
|
503
|
+
* - The row contains cells, but the table does not contain matching columns for one or more of those cells.
|
|
504
|
+
*
|
|
505
|
+
* - The specified index is out of range.
|
|
506
|
+
*
|
|
507
|
+
* No rows are inserted in these cases.
|
|
508
|
+
*/
|
|
509
|
+
insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
339
510
|
/**
|
|
340
511
|
* Sets the cell at the specified location in the table.
|
|
341
|
-
* @remarks To remove a cell, call {@link TableSchema.
|
|
342
|
-
* @privateRemarks TODO: add overload that takes column/row nodes?
|
|
512
|
+
* @remarks To remove a cell, call {@link TableSchema.Table.removeCell} instead.
|
|
343
513
|
*/
|
|
344
|
-
setCell(params: SetCellParameters<
|
|
514
|
+
setCell(params: SetCellParameters<TCell, TColumn, TRow>): void;
|
|
345
515
|
/**
|
|
346
516
|
* Removes the specified column from the table.
|
|
347
|
-
*
|
|
348
|
-
* @
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
517
|
+
*
|
|
518
|
+
* @remarks
|
|
519
|
+
* Note: this does not remove any cells from the table's rows.
|
|
520
|
+
* To remove the corresponding cells, use {@link TableSchema.Table.removeCell}.
|
|
521
|
+
*
|
|
522
|
+
* @param column - The {@link TableSchema.Column | column} or {@link TableSchema.Column.id | column ID} to remove.
|
|
523
|
+
* @throws Throws an error if the column is not in the table.
|
|
524
|
+
* @privateRemarks TODO (future): Actually remove corresponding cells from table rows.
|
|
525
|
+
*/
|
|
526
|
+
removeColumn(column: string | TreeNodeFromImplicitAllowedTypes<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>;
|
|
527
|
+
/**
|
|
528
|
+
* Removes 0 or more columns from the table.
|
|
529
|
+
*
|
|
530
|
+
* @remarks
|
|
531
|
+
* Note: this does not remove any cells from the table's rows.
|
|
532
|
+
* To remove the corresponding cells, use {@link TableSchema.Table.removeCell}.
|
|
533
|
+
*
|
|
534
|
+
* @param columns - The columns to remove.
|
|
535
|
+
* @throws Throws an error if any of the columns are not in the table.
|
|
536
|
+
* In this case, no columns are removed.
|
|
537
|
+
*/
|
|
538
|
+
removeColumns(columns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
539
|
+
/**
|
|
540
|
+
* Removes 0 or more columns from the table.
|
|
541
|
+
*
|
|
542
|
+
* @remarks
|
|
543
|
+
* Note: this does not remove any cells from the table's rows.
|
|
544
|
+
* To remove the corresponding cells, use {@link TableSchema.Table.removeCell}.
|
|
545
|
+
*
|
|
546
|
+
* @param columns - The columns to remove, specified by their {@link TableSchema.Column.id}.
|
|
547
|
+
* @throws Throws an error if any of the columns are not in the table.
|
|
548
|
+
* In this case, no columns are removed.
|
|
549
|
+
*/
|
|
550
|
+
removeColumns(columns: readonly string[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
551
|
+
/**
|
|
552
|
+
* Removes all columns from the table.
|
|
553
|
+
* @returns The removed columns.
|
|
554
|
+
*/
|
|
555
|
+
removeAllColumns(): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
556
|
+
/**
|
|
557
|
+
* Removes the specified row from the table.
|
|
558
|
+
* @param row - The {@link TableSchema.Row | row} or {@link TableSchema.Row.id | row ID} to remove.
|
|
559
|
+
* @throws Throws an error if the row is not in the table.
|
|
560
|
+
*/
|
|
561
|
+
removeRow(row: string | TreeNodeFromImplicitAllowedTypes<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>;
|
|
562
|
+
/**
|
|
563
|
+
* Removes 0 or more rows from the table.
|
|
564
|
+
* @param rows - The rows to remove.
|
|
565
|
+
* @throws Throws an error if any of the rows are not in the table.
|
|
566
|
+
* In this case, no rows are removed.
|
|
352
567
|
*/
|
|
353
|
-
|
|
568
|
+
removeRows(rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
354
569
|
/**
|
|
355
570
|
* Removes 0 or more rows from the table.
|
|
356
|
-
* @
|
|
571
|
+
* @param rows - The rows to remove, specified by their {@link TableSchema.Row.id}.
|
|
572
|
+
* @throws Throws an error if any of the rows are not in the table.
|
|
573
|
+
* In this case, no rows are removed.
|
|
357
574
|
*/
|
|
358
|
-
removeRows
|
|
575
|
+
removeRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
359
576
|
/**
|
|
360
577
|
* Removes all rows from the table.
|
|
578
|
+
* @returns The removed rows.
|
|
361
579
|
*/
|
|
362
|
-
removeAllRows
|
|
580
|
+
removeAllRows(): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
363
581
|
/**
|
|
364
582
|
* Removes the cell at the specified location in the table.
|
|
365
|
-
* @
|
|
583
|
+
* @returns The cell if it exists, otherwise undefined.
|
|
584
|
+
* @throws Throws an error if the location does not exist in the table.
|
|
366
585
|
*/
|
|
367
|
-
removeCell
|
|
586
|
+
removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
368
587
|
}
|
|
369
588
|
/**
|
|
370
589
|
* Factory for creating new table schema without specifying row or column schema.
|
|
371
590
|
* @internal
|
|
372
591
|
*/
|
|
373
|
-
function createTable<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes>({ schemaFactory, cell, }: System_TableSchema.TableFactoryOptionsBase<TScope
|
|
592
|
+
function createTable<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes>({ schemaFactory, cell, }: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryAlpha<TScope>, TCell>): System_TableSchema.TableSchemaBase<TScope, TCell, System_TableSchema.ColumnSchemaBase<TScope, System_TableSchema.DefaultPropsType>, System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>>;
|
|
374
593
|
/**
|
|
375
594
|
* Factory for creating new table schema without specifying row schema.
|
|
376
595
|
* @internal
|
|
377
596
|
*/
|
|
378
|
-
function createTable<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TColumn extends System_TableSchema.ColumnSchemaBase<TScope>>({ schemaFactory, cell, column, }: System_TableSchema.TableFactoryOptionsBase<TScope
|
|
597
|
+
function createTable<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TColumn extends System_TableSchema.ColumnSchemaBase<TScope>>({ schemaFactory, cell, column, }: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {
|
|
379
598
|
readonly column: TColumn;
|
|
380
|
-
}):
|
|
599
|
+
}): System_TableSchema.TableSchemaBase<TScope, TCell, TColumn, System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>>;
|
|
381
600
|
/**
|
|
382
601
|
* Factory for creating new table schema.
|
|
383
602
|
* @internal
|
|
384
603
|
*/
|
|
385
|
-
function createTable<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TColumn extends System_TableSchema.ColumnSchemaBase<TScope>, const TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>>({ schemaFactory, cell, column, row, }: System_TableSchema.TableFactoryOptionsBase<TScope
|
|
604
|
+
function createTable<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TColumn extends System_TableSchema.ColumnSchemaBase<TScope>, const TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>>({ schemaFactory, cell, column, row, }: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {
|
|
386
605
|
readonly column: TColumn;
|
|
387
606
|
readonly row: TRow;
|
|
388
|
-
}):
|
|
607
|
+
}): System_TableSchema.TableSchemaBase<TScope, TCell, TColumn, TRow>;
|
|
389
608
|
}
|
|
390
609
|
//# sourceMappingURL=tableSchema.d.ts.map
|