@fluidframework/tree 2.43.0 → 2.50.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 +100 -0
- package/api-report/tree.alpha.api.md +73 -16
- package/api-report/tree.beta.api.md +9 -3
- package/api-report/tree.legacy.alpha.api.md +8 -2
- package/api-report/tree.legacy.public.api.md +8 -2
- package/api-report/tree.public.api.md +8 -2
- package/dist/alpha.d.ts +9 -0
- package/dist/core/forest/editableForest.d.ts +0 -2
- package/dist/core/forest/editableForest.d.ts.map +1 -1
- package/dist/core/forest/editableForest.js.map +1 -1
- package/dist/core/forest/forest.d.ts +0 -4
- package/dist/core/forest/forest.d.ts.map +1 -1
- package/dist/core/forest/forest.js +0 -4
- package/dist/core/forest/forest.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +0 -6
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/types.d.ts +0 -2
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +0 -8
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +0 -8
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-view/view.d.ts +0 -2
- package/dist/core/schema-view/view.d.ts.map +1 -1
- package/dist/core/schema-view/view.js.map +1 -1
- package/dist/core/tree/cursor.d.ts +0 -2
- package/dist/core/tree/cursor.d.ts.map +1 -1
- package/dist/core/tree/cursor.js +0 -2
- package/dist/core/tree/cursor.js.map +1 -1
- package/dist/core/tree/delta.d.ts +0 -2
- package/dist/core/tree/delta.d.ts.map +1 -1
- package/dist/core/tree/delta.js.map +1 -1
- package/dist/core/tree/types.d.ts +0 -4
- package/dist/core/tree/types.d.ts.map +1 -1
- package/dist/core/tree/types.js +0 -2
- package/dist/core/tree/types.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +0 -4
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -10
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +0 -2
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +0 -2
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +0 -2
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +0 -10
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +0 -2
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +0 -6
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -12
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +0 -2
- package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/types.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts +2 -6
- package/dist/jsonDomainSchema.d.ts.map +1 -1
- package/dist/jsonDomainSchema.js +2 -2
- package/dist/jsonDomainSchema.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +3 -1
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts +8 -12
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +54 -46
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/resubmitMachine.d.ts +6 -0
- package/dist/shared-tree-core/resubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/resubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +16 -3
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +49 -17
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +1 -1
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +3 -4
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/jsonSchema.d.ts +32 -8
- package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/jsonSchema.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +2 -2
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +1 -1
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +97 -3
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +75 -0
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +5 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +2 -0
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +4 -4
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts +1 -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/treeNodeApi.js +1 -1
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +12 -0
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +5 -3
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +5 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js +4 -0
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +3 -3
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +3 -1
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts +2 -1
- package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/index.js +5 -1
- package/dist/simple-tree/node-kinds/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +5 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/index.d.ts +7 -0
- package/dist/simple-tree/node-kinds/record/index.d.ts.map +1 -0
- package/dist/simple-tree/node-kinds/record/index.js +13 -0
- package/dist/simple-tree/node-kinds/record/index.js.map +1 -0
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts +39 -0
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -0
- package/dist/simple-tree/node-kinds/record/recordNode.js +234 -0
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -0
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +70 -0
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -0
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js +30 -0
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -0
- package/dist/simple-tree/simpleSchema.d.ts +16 -1
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +4 -2
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +56 -32
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/tableSchema.d.ts +7 -2
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +21 -7
- package/dist/tableSchema.js.map +1 -1
- package/dist/util/brandedMap.d.ts +0 -2
- package/dist/util/brandedMap.d.ts.map +1 -1
- package/dist/util/brandedMap.js.map +1 -1
- package/docs/main/compatibility.md +15 -1
- package/lib/alpha.d.ts +9 -0
- package/lib/core/forest/editableForest.d.ts +0 -2
- package/lib/core/forest/editableForest.d.ts.map +1 -1
- package/lib/core/forest/editableForest.js.map +1 -1
- package/lib/core/forest/forest.d.ts +0 -4
- package/lib/core/forest/forest.d.ts.map +1 -1
- package/lib/core/forest/forest.js +0 -4
- package/lib/core/forest/forest.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +0 -6
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.js.map +1 -1
- package/lib/core/rebase/types.d.ts +0 -2
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +0 -8
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +0 -8
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-view/view.d.ts +0 -2
- package/lib/core/schema-view/view.d.ts.map +1 -1
- package/lib/core/schema-view/view.js.map +1 -1
- package/lib/core/tree/cursor.d.ts +0 -2
- package/lib/core/tree/cursor.d.ts.map +1 -1
- package/lib/core/tree/cursor.js +0 -2
- package/lib/core/tree/cursor.js.map +1 -1
- package/lib/core/tree/delta.d.ts +0 -2
- package/lib/core/tree/delta.d.ts.map +1 -1
- package/lib/core/tree/delta.js.map +1 -1
- package/lib/core/tree/types.d.ts +0 -4
- package/lib/core/tree/types.d.ts.map +1 -1
- package/lib/core/tree/types.js +0 -2
- package/lib/core/tree/types.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +0 -4
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -10
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +0 -2
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +0 -2
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js +0 -2
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +0 -10
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js +0 -2
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +0 -6
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -12
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +0 -2
- package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/types.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts +2 -6
- package/lib/jsonDomainSchema.d.ts.map +1 -1
- package/lib/jsonDomainSchema.js +3 -3
- package/lib/jsonDomainSchema.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +3 -1
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts +8 -12
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +55 -47
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/resubmitMachine.d.ts +6 -0
- package/lib/shared-tree-core/resubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/resubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +16 -3
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +51 -19
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +1 -1
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +2 -3
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/jsonSchema.d.ts +32 -8
- package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/jsonSchema.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +2 -2
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +1 -1
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +97 -3
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +77 -2
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +5 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +2 -0
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +5 -5
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts +1 -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/treeNodeApi.js +2 -2
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +12 -0
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +6 -4
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +5 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js +4 -0
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +3 -3
- 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/node-kinds/index.d.ts +2 -1
- package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/index.js +1 -0
- package/lib/simple-tree/node-kinds/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.js +1 -1
- package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +5 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/index.d.ts +7 -0
- package/lib/simple-tree/node-kinds/record/index.d.ts.map +1 -0
- package/lib/simple-tree/node-kinds/record/index.js +7 -0
- package/lib/simple-tree/node-kinds/record/index.js.map +1 -0
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts +39 -0
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -0
- package/lib/simple-tree/node-kinds/record/recordNode.js +232 -0
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -0
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +70 -0
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -0
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js +26 -0
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -0
- package/lib/simple-tree/simpleSchema.d.ts +16 -1
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +4 -2
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +58 -34
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/tableSchema.d.ts +7 -2
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +22 -8
- package/lib/tableSchema.js.map +1 -1
- package/lib/util/brandedMap.d.ts +0 -2
- package/lib/util/brandedMap.d.ts.map +1 -1
- package/lib/util/brandedMap.js.map +1 -1
- package/package.json +34 -22
- package/src/core/forest/editableForest.ts +0 -2
- package/src/core/forest/forest.ts +0 -4
- package/src/core/rebase/changeRebaser.ts +0 -6
- package/src/core/rebase/types.ts +0 -2
- package/src/core/schema-stored/schema.ts +0 -8
- package/src/core/schema-view/view.ts +0 -2
- package/src/core/tree/cursor.ts +0 -2
- package/src/core/tree/delta.ts +0 -2
- package/src/core/tree/types.ts +0 -4
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +0 -4
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +0 -10
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +0 -2
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +0 -2
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +0 -10
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +0 -8
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +0 -12
- package/src/feature-libraries/sequence-field/types.ts +0 -2
- package/src/index.ts +9 -0
- package/src/jsonDomainSchema.ts +3 -3
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/treeAlpha.ts +3 -1
- package/src/shared-tree-core/defaultResubmitMachine.ts +99 -52
- package/src/shared-tree-core/resubmitMachine.ts +7 -0
- package/src/shared-tree-core/sharedTreeCore.ts +18 -6
- package/src/simple-tree/api/configuration.ts +73 -19
- package/src/simple-tree/api/customTree.ts +3 -3
- package/src/simple-tree/api/index.ts +3 -0
- package/src/simple-tree/api/jsonSchema.ts +35 -8
- package/src/simple-tree/api/schemaFactory.ts +5 -13
- package/src/simple-tree/api/schemaFactoryAlpha.ts +268 -1
- package/src/simple-tree/api/schemaFactoryRecursive.ts +5 -1
- package/src/simple-tree/api/schemaFromSimple.ts +6 -0
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +16 -7
- package/src/simple-tree/api/treeBeta.ts +2 -2
- package/src/simple-tree/api/treeNodeApi.ts +2 -2
- package/src/simple-tree/api/typesUnsafe.ts +15 -0
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +14 -6
- package/src/simple-tree/core/index.ts +1 -0
- package/src/simple-tree/core/treeNodeSchema.ts +8 -4
- package/src/simple-tree/index.ts +11 -0
- package/src/simple-tree/node-kinds/index.ts +11 -0
- package/src/simple-tree/node-kinds/object/index.ts +5 -1
- package/src/simple-tree/node-kinds/object/objectNode.ts +3 -2
- package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -3
- package/src/simple-tree/node-kinds/record/index.ts +14 -0
- package/src/simple-tree/node-kinds/record/recordNode.ts +410 -0
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +136 -0
- package/src/simple-tree/simpleSchema.ts +19 -1
- package/src/simple-tree/toStoredSchema.ts +4 -2
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +83 -40
- package/src/tableSchema.ts +27 -8
- package/src/util/brandedMap.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,105 @@
|
|
|
1
1
|
# @fluidframework/tree
|
|
2
2
|
|
|
3
|
+
## 2.50.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Record node kind was added (alpha) ([#24908](https://github.com/microsoft/FluidFramework/pull/24908)) [b25667bcdc](https://github.com/microsoft/FluidFramework/commit/b25667bcdcad5584f35783f6a32270803b6dfb1c)
|
|
8
|
+
|
|
9
|
+
Adds a new kind of node to SharedTree that models a TypeScript record.
|
|
10
|
+
As is the case with map nodes, record nodes only support string keys.
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
class MyRecord extends schemaFactory.record("my-record", [
|
|
14
|
+
schemaFactory.number,
|
|
15
|
+
schemaFactory.string,
|
|
16
|
+
]) {}
|
|
17
|
+
const myRecord = new MyRecord({
|
|
18
|
+
foo: 42,
|
|
19
|
+
bar: "Hello world!",
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const foo = myRecord.foo; // 42
|
|
23
|
+
|
|
24
|
+
delete myRecord.foo;
|
|
25
|
+
|
|
26
|
+
myRecord.baz = 37;
|
|
27
|
+
|
|
28
|
+
const keys = Object.keys(myRecord); // ["bar", "baz"]
|
|
29
|
+
const values = Object.values(myRecord); // ["Hello world!", 37]
|
|
30
|
+
const entries = Object.entries(myRecord); // [["bar", "Hello world!"], ["baz", 37]]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### `NodeKind` enum update
|
|
34
|
+
|
|
35
|
+
This change includes the addition of a new flag to the [NodeKind](https://fluidframework.com/docs/api/fluid-framework/nodekind-enum) enum.
|
|
36
|
+
This API notes in its documentation that users should not treat its flags as an exhaustive set.
|
|
37
|
+
|
|
38
|
+
This change may break code that treats it that way.
|
|
39
|
+
We recommend updating your code to be more tolerant of unknown node kinds going forward.
|
|
40
|
+
|
|
41
|
+
Also see alternative options for schema-agnostic tree traversal if needed:
|
|
42
|
+
|
|
43
|
+
- [Tree.parent](https://fluidframework.com/docs/api/fluid-framework/treenodeapi-interface#parent-methodsignature)
|
|
44
|
+
- [TreeAlpha.child](https://fluidframework.com/docs/api/fluid-framework/treealpha-interface#child-methodsignature)
|
|
45
|
+
- [TreeAlpha.children](https://fluidframework.com/docs/api/fluid-framework/treealpha-interface#children-methodsignature)
|
|
46
|
+
|
|
47
|
+
#### Additional features
|
|
48
|
+
|
|
49
|
+
In addition to the operations afforded by TypeScript records, SharedTree record nodes can be iterated (equivalent to Object.entries).
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
class MyRecord extends schemaFactory.record("my-record", [schemaFactory.number, schemaFactory.string]) {}
|
|
53
|
+
const myRecord = new MyRecord({
|
|
54
|
+
foo: 42,
|
|
55
|
+
bar: "Hello world!"
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
for (const [key, value] of myRecord) {
|
|
59
|
+
...
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const a = { ...myRecord }; // { foo: 42, bar: "Hello world!" }
|
|
63
|
+
const b = [...myRecord]; // [["foo", 42], ["bar, "Hello world!"]]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Recursive records
|
|
67
|
+
|
|
68
|
+
Recursive record schema can be defined using `recordRecursive` on [SchemaFactoryAlpha](https://fluidframework.com/docs/api/fluid-framework/schemafactoryalpha-class).
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
class MyRecord extends schemaFactory.recordRecursive("my-record", [
|
|
72
|
+
schemaFactory.string,
|
|
73
|
+
() => MyRecord,
|
|
74
|
+
]) {}
|
|
75
|
+
const myRecord = new MyRecord({
|
|
76
|
+
foo: "Hello world!",
|
|
77
|
+
bar: new MyRecord({
|
|
78
|
+
x: "foo",
|
|
79
|
+
y: new MyRecord({}),
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### TableSchema update (alpha)
|
|
85
|
+
|
|
86
|
+
The [TableSchema](https://fluidframework.com/docs/api/fluid-framework/tableschema-namespace/) APIs have been updated to use record nodes in the schema they generate.
|
|
87
|
+
Specifically, the `Row` representation now uses a record to store its column-cell pairs, rather than a map.
|
|
88
|
+
|
|
89
|
+
The node types derived from these APIs model their data in a row-major format.
|
|
90
|
+
That is, each row in the table contains the set of cells that belong to that row, where each cell is indexed by its corresponding column.
|
|
91
|
+
|
|
92
|
+
Previously, this was modeled using a [MapNode](https://fluidframework.com/docs/api/fluid-framework/treemapnode-interface).
|
|
93
|
+
This format proved cumbersome to interop with popular table rendering libraries like [tanstack](https://tanstack.com/table), which expect a record-like format.
|
|
94
|
+
|
|
95
|
+
The persisted format of documents containing trees derived from these APIs is the same, so this change is forward and backward compatible.
|
|
96
|
+
|
|
97
|
+
#### JsonDomainSchema update (alpha)
|
|
98
|
+
|
|
99
|
+
[JsonObject](https://fluidframework.com/docs/api/fluid-framework/jsonastree-namespace/jsonobject-class) has been updated to a record rather than a map.
|
|
100
|
+
|
|
101
|
+
The persisted format of documents containing trees derived from these APIs is the same, so this change is forward and backward compatible.
|
|
102
|
+
|
|
3
103
|
## 2.43.0
|
|
4
104
|
|
|
5
105
|
### Minor Changes
|
|
@@ -429,9 +429,7 @@ export namespace JsonAsTree {
|
|
|
429
429
|
export class JsonObject extends _APIExtractorWorkaroundObjectBase {
|
|
430
430
|
}
|
|
431
431
|
const // @system
|
|
432
|
-
_APIExtractorWorkaroundObjectBase: TreeNodeSchemaClass<"com.fluidframework.json.object", NodeKind.
|
|
433
|
-
[Symbol.iterator](): Iterator<[string, string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null], any, undefined>;
|
|
434
|
-
} | {
|
|
432
|
+
_APIExtractorWorkaroundObjectBase: TreeNodeSchemaClass<"com.fluidframework.json.object", NodeKind.Record, TreeRecordNodeUnsafe_2<readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.object", NodeKind.Record, unknown>, {
|
|
435
433
|
readonly [x: string]: string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null;
|
|
436
434
|
}, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>;
|
|
437
435
|
// (undocumented)
|
|
@@ -439,9 +437,7 @@ export namespace JsonAsTree {
|
|
|
439
437
|
// @system
|
|
440
438
|
export type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<typeof Array>;
|
|
441
439
|
const // @system
|
|
442
|
-
_APIExtractorWorkaroundArrayBase:
|
|
443
|
-
[Symbol.iterator](): Iterator<string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null, any, undefined>;
|
|
444
|
-
}, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>;
|
|
440
|
+
_APIExtractorWorkaroundArrayBase: ArrayNodeCustomizableSchemaUnsafe_2<"com.fluidframework.json.array", readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], unknown>;
|
|
445
441
|
// (undocumented)
|
|
446
442
|
export type Tree = TreeNodeFromImplicitAllowedTypes<typeof Tree>;
|
|
447
443
|
}
|
|
@@ -479,13 +475,11 @@ export type JsonLeafSchemaType = "string" | "number" | "boolean" | "null";
|
|
|
479
475
|
|
|
480
476
|
// @alpha @sealed
|
|
481
477
|
export interface JsonMapNodeSchema extends JsonNodeSchemaBase<NodeKind.Map, "object"> {
|
|
482
|
-
readonly patternProperties:
|
|
483
|
-
"^.*$": JsonFieldSchema;
|
|
484
|
-
};
|
|
478
|
+
readonly patternProperties: JsonStringKeyPatternProperties;
|
|
485
479
|
}
|
|
486
480
|
|
|
487
481
|
// @alpha
|
|
488
|
-
export type JsonNodeSchema = JsonLeafNodeSchema | JsonMapNodeSchema | JsonArrayNodeSchema | JsonObjectNodeSchema;
|
|
482
|
+
export type JsonNodeSchema = JsonLeafNodeSchema | JsonMapNodeSchema | JsonArrayNodeSchema | JsonObjectNodeSchema | JsonRecordNodeSchema;
|
|
489
483
|
|
|
490
484
|
// @alpha @sealed
|
|
491
485
|
export interface JsonNodeSchemaBase<TNodeKind extends NodeKind, TJsonSchemaType extends JsonSchemaType> {
|
|
@@ -501,6 +495,11 @@ export interface JsonObjectNodeSchema extends JsonNodeSchemaBase<NodeKind.Object
|
|
|
501
495
|
readonly required?: string[];
|
|
502
496
|
}
|
|
503
497
|
|
|
498
|
+
// @alpha @sealed
|
|
499
|
+
export interface JsonRecordNodeSchema extends JsonNodeSchemaBase<NodeKind.Record, "object"> {
|
|
500
|
+
readonly patternProperties: JsonStringKeyPatternProperties;
|
|
501
|
+
}
|
|
502
|
+
|
|
504
503
|
// @alpha
|
|
505
504
|
export type JsonRefPath = `#/$defs/${JsonSchemaId}`;
|
|
506
505
|
|
|
@@ -515,6 +514,11 @@ export interface JsonSchemaRef {
|
|
|
515
514
|
// @alpha
|
|
516
515
|
export type JsonSchemaType = "object" | "array" | JsonLeafSchemaType;
|
|
517
516
|
|
|
517
|
+
// @alpha @sealed
|
|
518
|
+
export interface JsonStringKeyPatternProperties {
|
|
519
|
+
"^.*$": JsonFieldSchema;
|
|
520
|
+
}
|
|
521
|
+
|
|
518
522
|
// @alpha @sealed
|
|
519
523
|
export type JsonTreeSchema = JsonFieldSchema & {
|
|
520
524
|
readonly $defs: Record<JsonSchemaId, JsonNodeSchema>;
|
|
@@ -596,7 +600,8 @@ export enum NodeKind {
|
|
|
596
600
|
Array = 1,
|
|
597
601
|
Leaf = 3,
|
|
598
602
|
Map = 0,
|
|
599
|
-
Object = 2
|
|
603
|
+
Object = 2,
|
|
604
|
+
Record = 4
|
|
600
605
|
}
|
|
601
606
|
|
|
602
607
|
// @public @sealed
|
|
@@ -660,6 +665,25 @@ export type ReadSchema<TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema
|
|
|
660
665
|
TSchema
|
|
661
666
|
] extends [ImplicitFieldSchema] ? TSchema : ImplicitFieldSchema;
|
|
662
667
|
|
|
668
|
+
// @alpha @sealed @system
|
|
669
|
+
export interface RecordNodeCustomizableSchema<out TName extends string = string, in out T extends ImplicitAnnotatedAllowedTypes = ImplicitAnnotatedAllowedTypes, out ImplicitlyConstructable extends boolean = true, out TCustomMetadata = unknown> extends TreeNodeSchemaClass<TName, NodeKind.Record, TreeRecordNode<UnannotateImplicitAllowedTypes<T>> & WithType<TName, NodeKind.Record, T>, RecordNodeInsertableData<UnannotateImplicitAllowedTypes<T>>, ImplicitlyConstructable, T, never, TCustomMetadata>, SimpleRecordNodeSchema<TCustomMetadata> {
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
// @alpha @system
|
|
673
|
+
export type RecordNodeInsertableData<T extends ImplicitAllowedTypes> = RestrictiveStringRecord<InsertableTreeNodeFromImplicitAllowedTypes<T>>;
|
|
674
|
+
|
|
675
|
+
// @alpha @sealed @system
|
|
676
|
+
export interface RecordNodePojoEmulationSchema<out TName extends string = string, in out T extends ImplicitAnnotatedAllowedTypes = ImplicitAnnotatedAllowedTypes, out ImplicitlyConstructable extends boolean = true, out TCustomMetadata = unknown> extends TreeNodeSchemaNonClass<TName, NodeKind.Record, TreeRecordNode<UnannotateImplicitAllowedTypes<T>> & WithType<TName, NodeKind.Record, T>, RecordNodeInsertableData<UnannotateImplicitAllowedTypes<T>>, ImplicitlyConstructable, T, never, TCustomMetadata>, SimpleRecordNodeSchema<TCustomMetadata> {
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// @alpha
|
|
680
|
+
export type RecordNodeSchema<TName extends string = string, T extends ImplicitAnnotatedAllowedTypes = ImplicitAnnotatedAllowedTypes, ImplicitlyConstructable extends boolean = true, TCustomMetadata = unknown> = RecordNodeCustomizableSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> | RecordNodePojoEmulationSchema<TName, T, ImplicitlyConstructable, TCustomMetadata>;
|
|
681
|
+
|
|
682
|
+
// @alpha (undocumented)
|
|
683
|
+
export const RecordNodeSchema: {
|
|
684
|
+
readonly [Symbol.hasInstance]: (value: TreeNodeSchema) => value is RecordNodeSchema<string, ImplicitAnnotatedAllowedTypes, true, unknown>;
|
|
685
|
+
};
|
|
686
|
+
|
|
663
687
|
// @alpha
|
|
664
688
|
export function replaceConciseTreeHandles<T>(tree: ConciseTree, replacer: HandleConverter<T>): ConciseTree<T>;
|
|
665
689
|
|
|
@@ -750,6 +774,7 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
750
774
|
}, false, T, undefined>;
|
|
751
775
|
readonly boolean: LeafSchema<"boolean", boolean>;
|
|
752
776
|
static readonly boolean: LeafSchema<"boolean", boolean>;
|
|
777
|
+
protected getStructuralType(fullName: string, types: TreeNodeSchema | readonly TreeNodeSchema[], builder: () => TreeNodeSchema): TreeNodeSchema;
|
|
753
778
|
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
754
779
|
static readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
755
780
|
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
@@ -807,6 +832,12 @@ export class SchemaFactoryAlpha<out TScope extends string | undefined = string |
|
|
|
807
832
|
};
|
|
808
833
|
static readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe_2<FieldKind_2.Optional, T, TCustomMetadata>;
|
|
809
834
|
readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe_2<FieldKind_2.Optional, T, TCustomMetadata>;
|
|
835
|
+
record<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchemaNonClass<ScopedSchemaName<TScope, `Record<${string}>`>, NodeKind.Record, TreeRecordNode<T> & WithType<ScopedSchemaName<TScope, `Record<${string}>`>, NodeKind.Record>, RecordNodeInsertableData<T>, true, T, undefined>;
|
|
836
|
+
record<const Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Record, TreeRecordNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Record>, RecordNodeInsertableData<T>, true, T, undefined>;
|
|
837
|
+
recordAlpha<const Name extends TName, const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): RecordNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
838
|
+
recordRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Record, TreeRecordNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Record, unknown>, {
|
|
839
|
+
readonly [x: string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
|
|
840
|
+
}, false, T, undefined>;
|
|
810
841
|
static readonly required: {
|
|
811
842
|
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha_2<TCustomMetadata>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Required, T, TCustomMetadata>;
|
|
812
843
|
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldPropsAlpha_2<TCustomMetadata_1>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Required, UnannotateImplicitAllowedTypes_2<T_1>, TCustomMetadata_1>;
|
|
@@ -897,7 +928,7 @@ export interface SimpleMapNodeSchema<out TCustomMetadata = unknown> extends Simp
|
|
|
897
928
|
}
|
|
898
929
|
|
|
899
930
|
// @alpha
|
|
900
|
-
export type SimpleNodeSchema = SimpleLeafNodeSchema | SimpleMapNodeSchema | SimpleArrayNodeSchema | SimpleObjectNodeSchema;
|
|
931
|
+
export type SimpleNodeSchema = SimpleLeafNodeSchema | SimpleMapNodeSchema | SimpleArrayNodeSchema | SimpleObjectNodeSchema | SimpleRecordNodeSchema;
|
|
901
932
|
|
|
902
933
|
// @public @sealed @system
|
|
903
934
|
export interface SimpleNodeSchemaBase<out TNodeKind extends NodeKind, out TCustomMetadata = unknown> {
|
|
@@ -920,6 +951,11 @@ export interface SimpleObjectNodeSchema<out TCustomMetadata = unknown> extends S
|
|
|
920
951
|
readonly fields: ReadonlyMap<string, SimpleObjectFieldSchema>;
|
|
921
952
|
}
|
|
922
953
|
|
|
954
|
+
// @alpha @sealed
|
|
955
|
+
export interface SimpleRecordNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Record, TCustomMetadata> {
|
|
956
|
+
readonly allowedTypesIdentifiers: ReadonlySet<string>;
|
|
957
|
+
}
|
|
958
|
+
|
|
923
959
|
// @alpha
|
|
924
960
|
export type SimpleTreeIndex<TKey extends TreeIndexKey, TValue> = TreeIndex<TKey, TValue>;
|
|
925
961
|
|
|
@@ -956,7 +992,7 @@ export namespace System_TableSchema {
|
|
|
956
992
|
// @sealed
|
|
957
993
|
export function createRowSchema<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 & {
|
|
958
994
|
readonly id?: string | undefined;
|
|
959
|
-
readonly cells: (InsertableTypedNode_2<TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.
|
|
995
|
+
readonly cells: (InsertableTypedNode_2<TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, TreeRecordNode_2<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, unknown>, RecordNodeInsertableData_2<TCellSchema>, true, TCellSchema, undefined>, TreeNodeSchemaCore_2<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, true, TCellSchema, RecordNodeInsertableData_2<TCellSchema>, unknown> & (new (data?: InternalTreeNode | RecordNodeInsertableData_2<TCellSchema> | undefined) => TreeRecordNode_2<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, unknown>)> | undefined) & InsertableTypedNode_2<TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, TreeRecordNode_2<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, unknown>, RecordNodeInsertableData_2<TCellSchema>, true, TCellSchema, undefined>, TreeNodeSchemaCore_2<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, true, TCellSchema, RecordNodeInsertableData_2<TCellSchema>, unknown> & (new (data?: InternalTreeNode | RecordNodeInsertableData_2<TCellSchema> | undefined) => TreeRecordNode_2<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, unknown>)>;
|
|
960
996
|
} & (FieldHasDefault<UnannotateImplicitFieldSchema<TPropsSchema>> extends true ? {
|
|
961
997
|
props?: InsertableTreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TPropsSchema>> | undefined;
|
|
962
998
|
} : {
|
|
@@ -964,7 +1000,7 @@ export namespace System_TableSchema {
|
|
|
964
1000
|
}), true, {
|
|
965
1001
|
readonly props: TPropsSchema;
|
|
966
1002
|
readonly id: FieldSchema_2<FieldKind_3.Identifier, LeafSchema_3<"string", string>, unknown>;
|
|
967
|
-
readonly cells: FieldSchemaAlpha_3<FieldKind_3.Required, TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.
|
|
1003
|
+
readonly cells: FieldSchemaAlpha_3<FieldKind_3.Required, TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, TreeRecordNode_2<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, unknown>, RecordNodeInsertableData_2<TCellSchema>, true, TCellSchema, undefined>, unknown>;
|
|
968
1004
|
}>;
|
|
969
1005
|
// @system
|
|
970
1006
|
export function createTableSchema<const TInputScope extends string | undefined, const TCellSchema extends ImplicitAllowedTypes, const TColumnSchema extends ColumnSchemaBase<TInputScope, TCellSchema>, const TRowSchema extends RowSchemaBase<TInputScope, TCellSchema>>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, _cellSchema: TCellSchema, columnSchema: TColumnSchema, rowSchema: TRowSchema): TreeNodeSchemaCore_2<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table">, NodeKind.Object, true, {
|
|
@@ -1308,7 +1344,7 @@ export interface TreeChangeEvents {
|
|
|
1308
1344
|
|
|
1309
1345
|
// @beta @sealed
|
|
1310
1346
|
export interface TreeChangeEventsBeta<TNode extends TreeNode = TreeNode> extends TreeChangeEvents {
|
|
1311
|
-
nodeChanged: (data: NodeChangedData<TNode> & (TNode extends WithType<string, NodeKind.Map | NodeKind.Object> ? Required<Pick<NodeChangedData<TNode>, "changedProperties">> : unknown)) => void;
|
|
1347
|
+
nodeChanged: (data: NodeChangedData<TNode> & (TNode extends WithType<string, NodeKind.Map | NodeKind.Object | NodeKind.Record> ? Required<Pick<NodeChangedData<TNode>, "changedProperties">> : unknown)) => void;
|
|
1312
1348
|
}
|
|
1313
1349
|
|
|
1314
1350
|
// @alpha
|
|
@@ -1413,6 +1449,23 @@ export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends No
|
|
|
1413
1449
|
// @public
|
|
1414
1450
|
export type TreeObjectNode<T extends RestrictiveStringRecord<ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object, T>;
|
|
1415
1451
|
|
|
1452
|
+
// @alpha
|
|
1453
|
+
export interface TreeRecordNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends TreeNode, Record<string, TreeNodeFromImplicitAllowedTypes<TAllowedTypes>> {
|
|
1454
|
+
[Symbol.iterator](): IterableIterator<[
|
|
1455
|
+
string,
|
|
1456
|
+
TreeNodeFromImplicitAllowedTypes<TAllowedTypes>
|
|
1457
|
+
]>;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
// @alpha @sealed @system
|
|
1461
|
+
export interface TreeRecordNodeUnsafe<TAllowedTypes extends System_Unsafe.ImplicitAllowedTypesUnsafe> extends Record<string, System_Unsafe.TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>>, TreeNode {
|
|
1462
|
+
// (undocumented)
|
|
1463
|
+
[Symbol.iterator](): IterableIterator<[
|
|
1464
|
+
string,
|
|
1465
|
+
System_Unsafe.TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>
|
|
1466
|
+
]>;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1416
1469
|
// @alpha @sealed (undocumented)
|
|
1417
1470
|
export interface TreeSchema extends SimpleTreeSchema {
|
|
1418
1471
|
readonly definitions: ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;
|
|
@@ -1539,15 +1592,19 @@ export type UnsafeUnknownSchema = typeof UnsafeUnknownSchema;
|
|
|
1539
1592
|
export type ValidateRecursiveSchema<T extends ValidateRecursiveSchemaTemplate<T>> = true;
|
|
1540
1593
|
|
|
1541
1594
|
// @public @system
|
|
1542
|
-
export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchema> = TreeNodeSchema<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
1595
|
+
export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchema> = TreeNodeSchema<string, NodeKind.Array | NodeKind.Map | NodeKind.Object | NodeKind.Record, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
1543
1596
|
[NodeKind.Object]: T["info"] extends RestrictiveStringRecord<ImplicitFieldSchema> ? InsertableObjectFromSchemaRecord<T["info"]> : unknown;
|
|
1544
1597
|
[NodeKind.Array]: T["info"] extends ImplicitAllowedTypes ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>> : unknown;
|
|
1545
1598
|
[NodeKind.Map]: T["info"] extends ImplicitAllowedTypes ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]> : unknown;
|
|
1599
|
+
[NodeKind.Record]: {
|
|
1600
|
+
readonly [P in string]: InsertableTreeNodeFromImplicitAllowedTypes<T>;
|
|
1601
|
+
};
|
|
1546
1602
|
[NodeKind.Leaf]: unknown;
|
|
1547
1603
|
}[T["kind"]], false, {
|
|
1548
1604
|
[NodeKind.Object]: RestrictiveStringRecord<ImplicitFieldSchema>;
|
|
1549
1605
|
[NodeKind.Array]: ImplicitAllowedTypes;
|
|
1550
1606
|
[NodeKind.Map]: ImplicitAllowedTypes;
|
|
1607
|
+
[NodeKind.Record]: ImplicitAllowedTypes;
|
|
1551
1608
|
[NodeKind.Leaf]: unknown;
|
|
1552
1609
|
}[T["kind"]]>;
|
|
1553
1610
|
|
|
@@ -242,7 +242,8 @@ export enum NodeKind {
|
|
|
242
242
|
Array = 1,
|
|
243
243
|
Leaf = 3,
|
|
244
244
|
Map = 0,
|
|
245
|
-
Object = 2
|
|
245
|
+
Object = 2,
|
|
246
|
+
Record = 4
|
|
246
247
|
}
|
|
247
248
|
|
|
248
249
|
// @public @sealed
|
|
@@ -339,6 +340,7 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
339
340
|
}, false, T, undefined>;
|
|
340
341
|
readonly boolean: LeafSchema<"boolean", boolean>;
|
|
341
342
|
static readonly boolean: LeafSchema<"boolean", boolean>;
|
|
343
|
+
protected getStructuralType(fullName: string, types: TreeNodeSchema | readonly TreeNodeSchema[], builder: () => TreeNodeSchema): TreeNodeSchema;
|
|
342
344
|
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
343
345
|
static readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
344
346
|
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
@@ -546,7 +548,7 @@ export interface TreeChangeEvents {
|
|
|
546
548
|
|
|
547
549
|
// @beta @sealed
|
|
548
550
|
export interface TreeChangeEventsBeta<TNode extends TreeNode = TreeNode> extends TreeChangeEvents {
|
|
549
|
-
nodeChanged: (data: NodeChangedData<TNode> & (TNode extends WithType<string, NodeKind.Map | NodeKind.Object> ? Required<Pick<NodeChangedData<TNode>, "changedProperties">> : unknown)) => void;
|
|
551
|
+
nodeChanged: (data: NodeChangedData<TNode> & (TNode extends WithType<string, NodeKind.Map | NodeKind.Object | NodeKind.Record> ? Required<Pick<NodeChangedData<TNode>, "changedProperties">> : unknown)) => void;
|
|
550
552
|
}
|
|
551
553
|
|
|
552
554
|
// @public
|
|
@@ -679,15 +681,19 @@ export type UnionToTuple<Union, A extends unknown[] = [], First = PopUnion<Union
|
|
|
679
681
|
export type ValidateRecursiveSchema<T extends ValidateRecursiveSchemaTemplate<T>> = true;
|
|
680
682
|
|
|
681
683
|
// @public @system
|
|
682
|
-
export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchema> = TreeNodeSchema<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
684
|
+
export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchema> = TreeNodeSchema<string, NodeKind.Array | NodeKind.Map | NodeKind.Object | NodeKind.Record, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
683
685
|
[NodeKind.Object]: T["info"] extends RestrictiveStringRecord<ImplicitFieldSchema> ? InsertableObjectFromSchemaRecord<T["info"]> : unknown;
|
|
684
686
|
[NodeKind.Array]: T["info"] extends ImplicitAllowedTypes ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>> : unknown;
|
|
685
687
|
[NodeKind.Map]: T["info"] extends ImplicitAllowedTypes ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]> : unknown;
|
|
688
|
+
[NodeKind.Record]: {
|
|
689
|
+
readonly [P in string]: InsertableTreeNodeFromImplicitAllowedTypes<T>;
|
|
690
|
+
};
|
|
686
691
|
[NodeKind.Leaf]: unknown;
|
|
687
692
|
}[T["kind"]], false, {
|
|
688
693
|
[NodeKind.Object]: RestrictiveStringRecord<ImplicitFieldSchema>;
|
|
689
694
|
[NodeKind.Array]: ImplicitAllowedTypes;
|
|
690
695
|
[NodeKind.Map]: ImplicitAllowedTypes;
|
|
696
|
+
[NodeKind.Record]: ImplicitAllowedTypes;
|
|
691
697
|
[NodeKind.Leaf]: unknown;
|
|
692
698
|
}[T["kind"]]>;
|
|
693
699
|
|
|
@@ -215,7 +215,8 @@ export enum NodeKind {
|
|
|
215
215
|
Array = 1,
|
|
216
216
|
Leaf = 3,
|
|
217
217
|
Map = 0,
|
|
218
|
-
Object = 2
|
|
218
|
+
Object = 2,
|
|
219
|
+
Record = 4
|
|
219
220
|
}
|
|
220
221
|
|
|
221
222
|
// @public @sealed
|
|
@@ -309,6 +310,7 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
309
310
|
}, false, T, undefined>;
|
|
310
311
|
readonly boolean: LeafSchema<"boolean", boolean>;
|
|
311
312
|
static readonly boolean: LeafSchema<"boolean", boolean>;
|
|
313
|
+
protected getStructuralType(fullName: string, types: TreeNodeSchema | readonly TreeNodeSchema[], builder: () => TreeNodeSchema): TreeNodeSchema;
|
|
312
314
|
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
313
315
|
static readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
314
316
|
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
@@ -636,15 +638,19 @@ export type UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) e
|
|
|
636
638
|
export type ValidateRecursiveSchema<T extends ValidateRecursiveSchemaTemplate<T>> = true;
|
|
637
639
|
|
|
638
640
|
// @public @system
|
|
639
|
-
export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchema> = TreeNodeSchema<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
641
|
+
export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchema> = TreeNodeSchema<string, NodeKind.Array | NodeKind.Map | NodeKind.Object | NodeKind.Record, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
640
642
|
[NodeKind.Object]: T["info"] extends RestrictiveStringRecord<ImplicitFieldSchema> ? InsertableObjectFromSchemaRecord<T["info"]> : unknown;
|
|
641
643
|
[NodeKind.Array]: T["info"] extends ImplicitAllowedTypes ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>> : unknown;
|
|
642
644
|
[NodeKind.Map]: T["info"] extends ImplicitAllowedTypes ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]> : unknown;
|
|
645
|
+
[NodeKind.Record]: {
|
|
646
|
+
readonly [P in string]: InsertableTreeNodeFromImplicitAllowedTypes<T>;
|
|
647
|
+
};
|
|
643
648
|
[NodeKind.Leaf]: unknown;
|
|
644
649
|
}[T["kind"]], false, {
|
|
645
650
|
[NodeKind.Object]: RestrictiveStringRecord<ImplicitFieldSchema>;
|
|
646
651
|
[NodeKind.Array]: ImplicitAllowedTypes;
|
|
647
652
|
[NodeKind.Map]: ImplicitAllowedTypes;
|
|
653
|
+
[NodeKind.Record]: ImplicitAllowedTypes;
|
|
648
654
|
[NodeKind.Leaf]: unknown;
|
|
649
655
|
}[T["kind"]]>;
|
|
650
656
|
|
|
@@ -215,7 +215,8 @@ export enum NodeKind {
|
|
|
215
215
|
Array = 1,
|
|
216
216
|
Leaf = 3,
|
|
217
217
|
Map = 0,
|
|
218
|
-
Object = 2
|
|
218
|
+
Object = 2,
|
|
219
|
+
Record = 4
|
|
219
220
|
}
|
|
220
221
|
|
|
221
222
|
// @public @sealed
|
|
@@ -309,6 +310,7 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
309
310
|
}, false, T, undefined>;
|
|
310
311
|
readonly boolean: LeafSchema<"boolean", boolean>;
|
|
311
312
|
static readonly boolean: LeafSchema<"boolean", boolean>;
|
|
313
|
+
protected getStructuralType(fullName: string, types: TreeNodeSchema | readonly TreeNodeSchema[], builder: () => TreeNodeSchema): TreeNodeSchema;
|
|
312
314
|
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
313
315
|
static readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
314
316
|
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
@@ -627,15 +629,19 @@ export type UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) e
|
|
|
627
629
|
export type ValidateRecursiveSchema<T extends ValidateRecursiveSchemaTemplate<T>> = true;
|
|
628
630
|
|
|
629
631
|
// @public @system
|
|
630
|
-
export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchema> = TreeNodeSchema<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
632
|
+
export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchema> = TreeNodeSchema<string, NodeKind.Array | NodeKind.Map | NodeKind.Object | NodeKind.Record, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
631
633
|
[NodeKind.Object]: T["info"] extends RestrictiveStringRecord<ImplicitFieldSchema> ? InsertableObjectFromSchemaRecord<T["info"]> : unknown;
|
|
632
634
|
[NodeKind.Array]: T["info"] extends ImplicitAllowedTypes ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>> : unknown;
|
|
633
635
|
[NodeKind.Map]: T["info"] extends ImplicitAllowedTypes ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]> : unknown;
|
|
636
|
+
[NodeKind.Record]: {
|
|
637
|
+
readonly [P in string]: InsertableTreeNodeFromImplicitAllowedTypes<T>;
|
|
638
|
+
};
|
|
634
639
|
[NodeKind.Leaf]: unknown;
|
|
635
640
|
}[T["kind"]], false, {
|
|
636
641
|
[NodeKind.Object]: RestrictiveStringRecord<ImplicitFieldSchema>;
|
|
637
642
|
[NodeKind.Array]: ImplicitAllowedTypes;
|
|
638
643
|
[NodeKind.Map]: ImplicitAllowedTypes;
|
|
644
|
+
[NodeKind.Record]: ImplicitAllowedTypes;
|
|
639
645
|
[NodeKind.Leaf]: unknown;
|
|
640
646
|
}[T["kind"]]>;
|
|
641
647
|
|
|
@@ -215,7 +215,8 @@ export enum NodeKind {
|
|
|
215
215
|
Array = 1,
|
|
216
216
|
Leaf = 3,
|
|
217
217
|
Map = 0,
|
|
218
|
-
Object = 2
|
|
218
|
+
Object = 2,
|
|
219
|
+
Record = 4
|
|
219
220
|
}
|
|
220
221
|
|
|
221
222
|
// @public @sealed
|
|
@@ -309,6 +310,7 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
309
310
|
}, false, T, undefined>;
|
|
310
311
|
readonly boolean: LeafSchema<"boolean", boolean>;
|
|
311
312
|
static readonly boolean: LeafSchema<"boolean", boolean>;
|
|
313
|
+
protected getStructuralType(fullName: string, types: TreeNodeSchema | readonly TreeNodeSchema[], builder: () => TreeNodeSchema): TreeNodeSchema;
|
|
312
314
|
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
313
315
|
static readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
314
316
|
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
@@ -627,15 +629,19 @@ export type UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) e
|
|
|
627
629
|
export type ValidateRecursiveSchema<T extends ValidateRecursiveSchemaTemplate<T>> = true;
|
|
628
630
|
|
|
629
631
|
// @public @system
|
|
630
|
-
export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchema> = TreeNodeSchema<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
632
|
+
export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchema> = TreeNodeSchema<string, NodeKind.Array | NodeKind.Map | NodeKind.Object | NodeKind.Record, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
631
633
|
[NodeKind.Object]: T["info"] extends RestrictiveStringRecord<ImplicitFieldSchema> ? InsertableObjectFromSchemaRecord<T["info"]> : unknown;
|
|
632
634
|
[NodeKind.Array]: T["info"] extends ImplicitAllowedTypes ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>> : unknown;
|
|
633
635
|
[NodeKind.Map]: T["info"] extends ImplicitAllowedTypes ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]> : unknown;
|
|
636
|
+
[NodeKind.Record]: {
|
|
637
|
+
readonly [P in string]: InsertableTreeNodeFromImplicitAllowedTypes<T>;
|
|
638
|
+
};
|
|
634
639
|
[NodeKind.Leaf]: unknown;
|
|
635
640
|
}[T["kind"]], false, {
|
|
636
641
|
[NodeKind.Object]: RestrictiveStringRecord<ImplicitFieldSchema>;
|
|
637
642
|
[NodeKind.Array]: ImplicitAllowedTypes;
|
|
638
643
|
[NodeKind.Map]: ImplicitAllowedTypes;
|
|
644
|
+
[NodeKind.Record]: ImplicitAllowedTypes;
|
|
639
645
|
[NodeKind.Leaf]: unknown;
|
|
640
646
|
}[T["kind"]]>;
|
|
641
647
|
|
package/dist/alpha.d.ts
CHANGED
|
@@ -145,10 +145,12 @@ export {
|
|
|
145
145
|
JsonNodeSchema,
|
|
146
146
|
JsonNodeSchemaBase,
|
|
147
147
|
JsonObjectNodeSchema,
|
|
148
|
+
JsonRecordNodeSchema,
|
|
148
149
|
JsonRefPath,
|
|
149
150
|
JsonSchemaId,
|
|
150
151
|
JsonSchemaRef,
|
|
151
152
|
JsonSchemaType,
|
|
153
|
+
JsonStringKeyPatternProperties,
|
|
152
154
|
JsonTreeSchema,
|
|
153
155
|
JsonValidator,
|
|
154
156
|
MapNodeCustomizableSchema,
|
|
@@ -160,6 +162,10 @@ export {
|
|
|
160
162
|
ObjectNodeSchema,
|
|
161
163
|
ReadSchema,
|
|
162
164
|
ReadableField,
|
|
165
|
+
RecordNodeCustomizableSchema,
|
|
166
|
+
RecordNodeInsertableData,
|
|
167
|
+
RecordNodePojoEmulationSchema,
|
|
168
|
+
RecordNodeSchema,
|
|
163
169
|
RevertibleAlpha,
|
|
164
170
|
RevertibleAlphaFactory,
|
|
165
171
|
RunTransactionParams,
|
|
@@ -177,6 +183,7 @@ export {
|
|
|
177
183
|
SimpleNodeSchemaBaseAlpha,
|
|
178
184
|
SimpleObjectFieldSchema,
|
|
179
185
|
SimpleObjectNodeSchema,
|
|
186
|
+
SimpleRecordNodeSchema,
|
|
180
187
|
SimpleTreeIndex,
|
|
181
188
|
SimpleTreeSchema,
|
|
182
189
|
System_TableSchema,
|
|
@@ -196,6 +203,8 @@ export {
|
|
|
196
203
|
TreeIndex,
|
|
197
204
|
TreeIndexKey,
|
|
198
205
|
TreeIndexNodes,
|
|
206
|
+
TreeRecordNode,
|
|
207
|
+
TreeRecordNodeUnsafe,
|
|
199
208
|
TreeSchema,
|
|
200
209
|
TreeSchemaEncodingOptions,
|
|
201
210
|
TreeViewAlpha,
|
|
@@ -25,8 +25,6 @@ export interface IEditableForest extends IForestSubscription {
|
|
|
25
25
|
* Ways to refer to a node in an IEditableForest.
|
|
26
26
|
*/
|
|
27
27
|
export type ForestLocation = ITreeSubscriptionCursor | Anchor;
|
|
28
|
-
/**
|
|
29
|
-
*/
|
|
30
28
|
export interface TreeLocation {
|
|
31
29
|
readonly range: FieldLocation | DetachedField;
|
|
32
30
|
readonly index: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editableForest.d.ts","sourceRoot":"","sources":["../../../src/core/forest/editableForest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC3D;;;;;;;;;OASG;IACH,cAAc,IAAI,YAAY,CAAC;CAC/B;AAID;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,uBAAuB,GAAG,MAAM,CAAC;AAE9D
|
|
1
|
+
{"version":3,"file":"editableForest.d.ts","sourceRoot":"","sources":["../../../src/core/forest/editableForest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC3D;;;;;;;;;OASG;IACH,cAAc,IAAI,YAAY,CAAC;CAC/B;AAID;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,uBAAuB,GAAG,MAAM,CAAC;AAE9D,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,GAAG,KAAK,IAAI,aAAa,CAE5F;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editableForest.js","sourceRoot":"","sources":["../../../src/core/forest/editableForest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"editableForest.js","sourceRoot":"","sources":["../../../src/core/forest/editableForest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoCH,SAAgB,eAAe,CAAC,KAAoC;IACnE,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AAClC,CAAC;AAFD,0CAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FieldKey } from \"../schema-stored/index.js\";\nimport type { Anchor, DeltaVisitor, DetachedField } from \"../tree/index.js\";\n\nimport type { IForestSubscription, ITreeSubscriptionCursor } from \"./forest.js\";\n\n/**\n * Editing APIs.\n */\nexport interface IEditableForest extends IForestSubscription {\n\t/**\n\t * Provides a visitor that can be used to mutate the forest.\n\t *\n\t * @returns a visitor that can be used to mutate the forest.\n\t *\n\t * @remarks\n\t * Mutating the forest does NOT update anchors.\n\t * The visitor must be released after use by calling {@link DeltaVisitor.free} on it.\n\t * It is invalid to acquire a visitor without releasing the previous one.\n\t */\n\tacquireVisitor(): DeltaVisitor;\n}\n\n// TODO: Types below here may be useful for input into edit building APIs, but are no longer used here directly.\n\n/**\n * Ways to refer to a node in an IEditableForest.\n */\nexport type ForestLocation = ITreeSubscriptionCursor | Anchor;\n\nexport interface TreeLocation {\n\treadonly range: FieldLocation | DetachedField;\n\treadonly index: number;\n}\n\nexport function isFieldLocation(range: FieldLocation | DetachedField): range is FieldLocation {\n\treturn typeof range === \"object\";\n}\n\n/**\n * Location of a field within a tree that is not a detached/root field.\n */\nexport interface FieldLocation {\n\treadonly key: FieldKey;\n\treadonly parent: ForestLocation;\n}\n"]}
|
|
@@ -184,8 +184,6 @@ export interface ITreeSubscriptionCursor extends ITreeCursor {
|
|
|
184
184
|
*/
|
|
185
185
|
readonly state: ITreeSubscriptionCursorState;
|
|
186
186
|
}
|
|
187
|
-
/**
|
|
188
|
-
*/
|
|
189
187
|
export declare enum ITreeSubscriptionCursorState {
|
|
190
188
|
/**
|
|
191
189
|
* On the current revision of the forest.
|
|
@@ -200,8 +198,6 @@ export declare enum ITreeSubscriptionCursorState {
|
|
|
200
198
|
*/
|
|
201
199
|
Freed = 2
|
|
202
200
|
}
|
|
203
|
-
/**
|
|
204
|
-
*/
|
|
205
201
|
export declare const enum TreeNavigationResult {
|
|
206
202
|
/**
|
|
207
203
|
* Attempt to navigate cursor to a key or index that is outside the client's view.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forest.d.ts","sourceRoot":"","sources":["../../../src/core/forest/forest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAG3E,OAAO,KAAK,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EACN,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,MAAM,EAGX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;GAOG;AAEH;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE3C;;;;;;;OAOG;IACH,YAAY,IAAI,IAAI,CAAC;CACrB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAE1C;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAE5B;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,4BAA4B,EAAE,OAAO,EAAE,SAAS,GAAG,eAAe,CAAC;IAEjF;;;;;;;;OAQG;IACH,UAAU,CAAC,MAAM,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAEtD;;;OAGG;IACH,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAAC;IAEzD;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;;OAGG;IACH,mBAAmB,CAClB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,uBAAuB,GACnC,oBAAoB,CAAC;IAExB;;;OAGG;IACH,oBAAoB,CACnB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,uBAAuB,GACnC,oBAAoB,CAAC;IAExB;;;;OAIG;IACH,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAEnF;;;;;;OAMG;IACH,4BAA4B,IAAI,sBAAsB,CAAC;IAEvD;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,wBAAwB,CAAC,OAAO,EAAE,MAAM,gBAAgB,GAAG,IAAI,CAAC;IAEhE;;OAEG;IACH,0BAA0B,CAAC,OAAO,EAAE,MAAM,gBAAgB,GAAG,IAAI,CAAC;CAClE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,GAAE,aAAyB,GAAG,WAAW,CAKxE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,uBAAuB,EACrC,KAAK,GAAE,aAAyB,GAC9B,IAAI,CAMN;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B;;;OAGG;IACH,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC3D;;;OAGG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAAC;IAE/C;;;OAGG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;;;;OAKG;IACH,WAAW,IAAI,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,gBAAgB,IAAI,WAAW,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,4BAA4B,CAAC;CAO7C;AAED
|
|
1
|
+
{"version":3,"file":"forest.d.ts","sourceRoot":"","sources":["../../../src/core/forest/forest.ts"],"names":[],"mappings":"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"}
|
|
@@ -30,8 +30,6 @@ function moveToDetachedField(forest, cursorToMove, field = index_js_1.rootField)
|
|
|
30
30
|
(0, internal_1.assert)(result === 1 /* TreeNavigationResult.Ok */, 0x42d /* Navigation to detached fields should never fail */);
|
|
31
31
|
}
|
|
32
32
|
exports.moveToDetachedField = moveToDetachedField;
|
|
33
|
-
/**
|
|
34
|
-
*/
|
|
35
33
|
var ITreeSubscriptionCursorState;
|
|
36
34
|
(function (ITreeSubscriptionCursorState) {
|
|
37
35
|
/**
|
|
@@ -47,8 +45,6 @@ var ITreeSubscriptionCursorState;
|
|
|
47
45
|
*/
|
|
48
46
|
ITreeSubscriptionCursorState[ITreeSubscriptionCursorState["Freed"] = 2] = "Freed";
|
|
49
47
|
})(ITreeSubscriptionCursorState || (exports.ITreeSubscriptionCursorState = ITreeSubscriptionCursorState = {}));
|
|
50
|
-
/**
|
|
51
|
-
*/
|
|
52
48
|
var TreeNavigationResult;
|
|
53
49
|
(function (TreeNavigationResult) {
|
|
54
50
|
/**
|