@fluidframework/tree 2.43.0 → 2.50.0-345060
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/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.d.ts.map +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/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.d.ts.map +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/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/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
|
@@ -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,OAA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,GACpC,oBAAoB,CAAC,EAAE,GACvB,oBAAoB,CAAC,QAAQ,CAAC"}
|
|
@@ -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
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forest.js","sourceRoot":"","sources":["../../../src/core/forest/forest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAG7D,+CAW0B;AA4I1B;;;;GAIG;AACH,SAAgB,UAAU,CAAC,QAAuB,oBAAS;IAC1D,OAAO;QACN,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,IAAA,6BAAkB,EAAC,KAAK,CAAC;KACnC,CAAC;AACH,CAAC;AALD,gCAKC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAClC,MAA2B,EAC3B,YAAqC,EACrC,QAAuB,oBAAS;IAEhC,MAAM,MAAM,GAAG,MAAM,CAAC,oBAAoB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC;IAC5E,IAAA,iBAAM,EACL,MAAM,oCAA4B,EAClC,KAAK,CAAC,qDAAqD,CAC3D,CAAC;AACH,CAAC;AAVD,kDAUC;AAkED;GACG;AACH,IAAY,4BAaX;AAbD,WAAY,4BAA4B;IACvC;;OAEG;IACH,qFAAO,CAAA;IACP;;OAEG;IACH,qFAAO,CAAA;IACP;;OAEG;IACH,iFAAK,CAAA;AACN,CAAC,EAbW,4BAA4B,4CAA5B,4BAA4B,QAavC;AAED;GACG;AACH,IAAkB,oBAejB;AAfD,WAAkB,oBAAoB;IACrC;;OAEG;IACH,wEAAa,CAAA;IAEb;;OAEG;IACH,qEAAW,CAAA;IAEX;;OAEG;IACH,2DAAM,CAAA;AACP,CAAC,EAfiB,oBAAoB,oCAApB,oBAAoB,QAerC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable } from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { FieldKey, TreeStoredSchemaSubscription } from \"../schema-stored/index.js\";\nimport {\n\ttype Anchor,\n\ttype AnchorSet,\n\ttype AnnouncedVisitor,\n\ttype DetachedField,\n\ttype ITreeCursor,\n\ttype ITreeCursorSynchronous,\n\ttype TreeChunk,\n\ttype UpPath,\n\tdetachedFieldAsKey,\n\trootField,\n} from \"../tree/index.js\";\n\nimport type { IEditableForest } from \"./editableForest.js\";\n\n/**\n * APIs for forest designed so the implementation can be copy on write,\n * or mutate in place, and we can ensure no references are dangling into the forest to allow this.\n *\n * This results in rather manual memory management,\n * but makes it practical to provide highly optimized implementations,\n * for example WASM powered binary formats that can track reference counts and only copy when needed.\n */\n\n/**\n * Events for {@link IForestSubscription}.\n *\n * TODO: consider having before and after events per subtree instead while applying anchor (and this just shows what happens at the root).\n */\nexport interface ForestEvents {\n\t/**\n\t * A new root field was just created in this forest.\n\t */\n\tafterRootFieldCreated(key: FieldKey): void;\n\n\t/**\n\t * The forest is about to be changed.\n\t * Emitted before each change in a batch of changes.\n\t * @remarks\n\t * This is the last chance for users of the forest to remove cursors from the forest before the edit.\n\t * Removing these cursors is important since they are not allowed to live across edits and\n\t * not clearing them can lead to corruption of in memory structures.\n\t */\n\tbeforeChange(): void;\n}\n\n/**\n * Invalidates whenever the tree content changes.\n * For now (might change later) downloading new parts of the forest counts as a change.\n * Not invalidated when schema changes.\n *\n * When invalidating, all outstanding cursors must be freed or cleared.\n */\nexport interface IForestSubscription {\n\t/**\n\t * Events for this forest.\n\t */\n\treadonly events: Listenable<ForestEvents>;\n\n\t/**\n\t * Set of anchors this forest is tracking.\n\t *\n\t * To keep these anchors usable, this AnchorSet must be updated / rebased for any changes made to the forest.\n\t * It is the responsibility of the caller of the forest-editing methods to do this, not the forest itself.\n\t * The caller performs these updates because it has more semantic knowledge about the edits, which can be needed to\n\t * update the anchors in a semantically optimal way.\n\t */\n\treadonly anchors: AnchorSet;\n\n\t/**\n\t * Create an independent copy of this forest, that uses the provided schema and anchors.\n\t *\n\t * The new copy will not invalidate observers (dependents) of the old one.\n\t */\n\tclone(schema: TreeStoredSchemaSubscription, anchors: AnchorSet): IEditableForest;\n\n\t/**\n\t * Generate a TreeChunk for the content in the given field cursor.\n\t * This can be used to chunk data that is then inserted into the forest.\n\t *\n\t * @remarks\n\t * Like {@link chunkField}, but forces the results into a single TreeChunk.\n\t * While any TreeChunk is compatible with any forest, this method creates one optimized for this specific forest.\n\t * The provided data must be compatible with the forest's current schema.\n\t */\n\tchunkField(cursor: ITreeCursorSynchronous): TreeChunk;\n\n\t/**\n\t * Allocates a cursor in the \"cleared\" state.\n\t * @param source - optional string identifying the source of the cursor for debugging purposes when cursors are not properly cleaned up.\n\t */\n\tallocateCursor(source?: string): ITreeSubscriptionCursor;\n\n\t/**\n\t * Frees an Anchor, stopping tracking its position across edits.\n\t */\n\tforgetAnchor(anchor: Anchor): void;\n\n\t/**\n\t * It is an error not to free `cursorToMove` before the next edit.\n\t * Must provide a `cursorToMove` from this subscription (acquired via `allocateCursor`).\n\t */\n\ttryMoveCursorToNode(\n\t\tdestination: Anchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult;\n\n\t/**\n\t * It is an error not to free `cursorToMove` before the next edit.\n\t * Must provide a `cursorToMove` from this subscription (acquired via `allocateCursor`).\n\t */\n\ttryMoveCursorToField(\n\t\tdestination: FieldAnchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult;\n\n\t/**\n\t * Set `cursorToMove` to the {@link CursorLocationType.node} described by path.\n\t * This is NOT a relative move: current position is discarded.\n\t * Path must point to existing node.\n\t */\n\tmoveCursorToPath(destination: UpPath, cursorToMove: ITreeSubscriptionCursor): void;\n\n\t/**\n\t * The cursor is moved to a special dummy node above the detached fields.\n\t * This dummy node can be used to read the detached fields,\n\t * but other operations (such as inspecting the dummy node's type or path) should not be relied upon.\n\t * While this method does not return an {@link ITreeSubscriptionCursor}, similar restrictions apply to its use:\n\t * the returned cursor must not used after any edits are made to the forest.\n\t */\n\tgetCursorAboveDetachedFields(): ITreeCursorSynchronous;\n\n\t/**\n\t * True if there are no nodes in the forest at all.\n\t *\n\t * @remarks\n\t * This means no nodes under any detached field, not just the special document root one.\n\t */\n\treadonly isEmpty: boolean;\n\n\t/**\n\t * Obtains and registers an {@link AnnouncedVisitor} that responds to changes on the forest.\n\t */\n\tregisterAnnouncedVisitor(visitor: () => AnnouncedVisitor): void;\n\n\t/**\n\t * Deregister the given visitor so that it stops responding to updates\n\t */\n\tderegisterAnnouncedVisitor(visitor: () => AnnouncedVisitor): void;\n}\n\n/**\n * Returns an anchor to the given field.\n * @param field - defaults to {@link rootField}.\n * @returns anchor to `field`.\n */\nexport function rootAnchor(field: DetachedField = rootField): FieldAnchor {\n\treturn {\n\t\tparent: undefined,\n\t\tfieldKey: detachedFieldAsKey(field),\n\t};\n}\n\n/**\n * Moves the given cursor to the given detached fields in the given forest.\n * @param forest - forest to move cursor in.\n * @param cursorToMove - cursor to move, must be allocated by the given forest\n * @param field - defaults to {@link rootField}.\n */\nexport function moveToDetachedField(\n\tforest: IForestSubscription,\n\tcursorToMove: ITreeSubscriptionCursor,\n\tfield: DetachedField = rootField,\n): void {\n\tconst result = forest.tryMoveCursorToField(rootAnchor(field), cursorToMove);\n\tassert(\n\t\tresult === TreeNavigationResult.Ok,\n\t\t0x42d /* Navigation to detached fields should never fail */,\n\t);\n}\n\n/**\n * Anchor to a field.\n * This is structurally based on the parent, so it will move only as the parent moves.\n */\nexport interface FieldAnchor {\n\t/**\n\t * Node above this field.\n\t * If `undefined`, field is a detached field.\n\t */\n\tparent: Anchor | undefined;\n\tfieldKey: FieldKey;\n}\n\n/**\n * ITreeCursor supporting IForestSubscription and its changes over time.\n */\nexport interface ITreeSubscriptionCursor extends ITreeCursor {\n\t/**\n\t * @param source - optional string identifying the source of the cursor for debugging purposes when cursors are not properly cleaned up.\n\t * @returns an independent copy of this cursor at the same location in the tree.\n\t */\n\tfork(source?: string): ITreeSubscriptionCursor;\n\n\t/**\n\t * Release any resources this cursor is holding onto.\n\t * After doing this, further use of this object other than reading `state` is forbidden (undefined behavior).\n\t */\n\tfree(): void;\n\n\t/**\n\t * Release any resources this cursor is holding onto.\n\t * After doing this, further use of this object other than reading `state` or passing to `tryGet`\n\t * or calling `free` is forbidden (undefined behavior).\n\t */\n\tclear(): void;\n\n\t/**\n\t * Construct an `Anchor` which the IForestSubscription will keep rebased to `current`.\n\t * Note that maintaining an Anchor has cost: free them to stop incurring that cost.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\tbuildAnchor(): Anchor;\n\n\t/**\n\t * Construct a `FieldAnchor` which the IForestSubscription will keep rebased to `current`.\n\t * Note that maintaining an Anchor has cost: free them to stop incurring that cost.\n\t *\n\t * Only valid when `mode` is `Fields`.\n\t */\n\tbuildFieldAnchor(): FieldAnchor;\n\n\t/**\n\t * Current state.\n\t */\n\treadonly state: ITreeSubscriptionCursorState;\n\n\t/**\n\t * @returns location within parent field or range.\n\t */\n\t// TODO: maybe support this.\n\t// getParentInfo(id: NodeId): TreeLocation;\n}\n\n/**\n */\nexport enum ITreeSubscriptionCursorState {\n\t/**\n\t * On the current revision of the forest.\n\t */\n\tCurrent,\n\t/**\n\t * Empty, but can be reused.\n\t */\n\tCleared,\n\t/**\n\t * Freed and must not be used.\n\t */\n\tFreed,\n}\n\n/**\n */\nexport const enum TreeNavigationResult {\n\t/**\n\t * Attempt to navigate cursor to a key or index that is outside the client's view.\n\t */\n\tNotFound = -1,\n\n\t/**\n\t * Attempt to navigate cursor to a portion of the tree that has not yet been loaded.\n\t */\n\tPending = 0,\n\n\t/**\n\t * ITreeReader successfully navigated to the desired node.\n\t */\n\tOk = 1,\n}\n\n/**\n * TreeNavigationResult, but never \"Pending\".\n * Can be used when data is never pending.\n */\nexport type SynchronousNavigationResult =\n\t| TreeNavigationResult.Ok\n\t| TreeNavigationResult.NotFound;\n"]}
|
|
1
|
+
{"version":3,"file":"forest.js","sourceRoot":"","sources":["../../../src/core/forest/forest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAG7D,+CAW0B;AA4I1B;;;;GAIG;AACH,SAAgB,UAAU,CAAC,QAAuB,oBAAS;IAC1D,OAAO;QACN,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,IAAA,6BAAkB,EAAC,KAAK,CAAC;KACnC,CAAC;AACH,CAAC;AALD,gCAKC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAClC,MAA2B,EAC3B,YAAqC,EACrC,QAAuB,oBAAS;IAEhC,MAAM,MAAM,GAAG,MAAM,CAAC,oBAAoB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC;IAC5E,IAAA,iBAAM,EACL,MAAM,oCAA4B,EAClC,KAAK,CAAC,qDAAqD,CAC3D,CAAC;AACH,CAAC;AAVD,kDAUC;AAkED,IAAY,4BAaX;AAbD,WAAY,4BAA4B;IACvC;;OAEG;IACH,qFAAO,CAAA;IACP;;OAEG;IACH,qFAAO,CAAA;IACP;;OAEG;IACH,iFAAK,CAAA;AACN,CAAC,EAbW,4BAA4B,4CAA5B,4BAA4B,QAavC;AAED,IAAkB,oBAejB;AAfD,WAAkB,oBAAoB;IACrC;;OAEG;IACH,wEAAa,CAAA;IAEb;;OAEG;IACH,qEAAW,CAAA;IAEX;;OAEG;IACH,2DAAM,CAAA;AACP,CAAC,EAfiB,oBAAoB,oCAApB,oBAAoB,QAerC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable } from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { FieldKey, TreeStoredSchemaSubscription } from \"../schema-stored/index.js\";\nimport {\n\ttype Anchor,\n\ttype AnchorSet,\n\ttype AnnouncedVisitor,\n\ttype DetachedField,\n\ttype ITreeCursor,\n\ttype ITreeCursorSynchronous,\n\ttype TreeChunk,\n\ttype UpPath,\n\tdetachedFieldAsKey,\n\trootField,\n} from \"../tree/index.js\";\n\nimport type { IEditableForest } from \"./editableForest.js\";\n\n/**\n * APIs for forest designed so the implementation can be copy on write,\n * or mutate in place, and we can ensure no references are dangling into the forest to allow this.\n *\n * This results in rather manual memory management,\n * but makes it practical to provide highly optimized implementations,\n * for example WASM powered binary formats that can track reference counts and only copy when needed.\n */\n\n/**\n * Events for {@link IForestSubscription}.\n *\n * TODO: consider having before and after events per subtree instead while applying anchor (and this just shows what happens at the root).\n */\nexport interface ForestEvents {\n\t/**\n\t * A new root field was just created in this forest.\n\t */\n\tafterRootFieldCreated(key: FieldKey): void;\n\n\t/**\n\t * The forest is about to be changed.\n\t * Emitted before each change in a batch of changes.\n\t * @remarks\n\t * This is the last chance for users of the forest to remove cursors from the forest before the edit.\n\t * Removing these cursors is important since they are not allowed to live across edits and\n\t * not clearing them can lead to corruption of in memory structures.\n\t */\n\tbeforeChange(): void;\n}\n\n/**\n * Invalidates whenever the tree content changes.\n * For now (might change later) downloading new parts of the forest counts as a change.\n * Not invalidated when schema changes.\n *\n * When invalidating, all outstanding cursors must be freed or cleared.\n */\nexport interface IForestSubscription {\n\t/**\n\t * Events for this forest.\n\t */\n\treadonly events: Listenable<ForestEvents>;\n\n\t/**\n\t * Set of anchors this forest is tracking.\n\t *\n\t * To keep these anchors usable, this AnchorSet must be updated / rebased for any changes made to the forest.\n\t * It is the responsibility of the caller of the forest-editing methods to do this, not the forest itself.\n\t * The caller performs these updates because it has more semantic knowledge about the edits, which can be needed to\n\t * update the anchors in a semantically optimal way.\n\t */\n\treadonly anchors: AnchorSet;\n\n\t/**\n\t * Create an independent copy of this forest, that uses the provided schema and anchors.\n\t *\n\t * The new copy will not invalidate observers (dependents) of the old one.\n\t */\n\tclone(schema: TreeStoredSchemaSubscription, anchors: AnchorSet): IEditableForest;\n\n\t/**\n\t * Generate a TreeChunk for the content in the given field cursor.\n\t * This can be used to chunk data that is then inserted into the forest.\n\t *\n\t * @remarks\n\t * Like {@link chunkField}, but forces the results into a single TreeChunk.\n\t * While any TreeChunk is compatible with any forest, this method creates one optimized for this specific forest.\n\t * The provided data must be compatible with the forest's current schema.\n\t */\n\tchunkField(cursor: ITreeCursorSynchronous): TreeChunk;\n\n\t/**\n\t * Allocates a cursor in the \"cleared\" state.\n\t * @param source - optional string identifying the source of the cursor for debugging purposes when cursors are not properly cleaned up.\n\t */\n\tallocateCursor(source?: string): ITreeSubscriptionCursor;\n\n\t/**\n\t * Frees an Anchor, stopping tracking its position across edits.\n\t */\n\tforgetAnchor(anchor: Anchor): void;\n\n\t/**\n\t * It is an error not to free `cursorToMove` before the next edit.\n\t * Must provide a `cursorToMove` from this subscription (acquired via `allocateCursor`).\n\t */\n\ttryMoveCursorToNode(\n\t\tdestination: Anchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult;\n\n\t/**\n\t * It is an error not to free `cursorToMove` before the next edit.\n\t * Must provide a `cursorToMove` from this subscription (acquired via `allocateCursor`).\n\t */\n\ttryMoveCursorToField(\n\t\tdestination: FieldAnchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult;\n\n\t/**\n\t * Set `cursorToMove` to the {@link CursorLocationType.node} described by path.\n\t * This is NOT a relative move: current position is discarded.\n\t * Path must point to existing node.\n\t */\n\tmoveCursorToPath(destination: UpPath, cursorToMove: ITreeSubscriptionCursor): void;\n\n\t/**\n\t * The cursor is moved to a special dummy node above the detached fields.\n\t * This dummy node can be used to read the detached fields,\n\t * but other operations (such as inspecting the dummy node's type or path) should not be relied upon.\n\t * While this method does not return an {@link ITreeSubscriptionCursor}, similar restrictions apply to its use:\n\t * the returned cursor must not used after any edits are made to the forest.\n\t */\n\tgetCursorAboveDetachedFields(): ITreeCursorSynchronous;\n\n\t/**\n\t * True if there are no nodes in the forest at all.\n\t *\n\t * @remarks\n\t * This means no nodes under any detached field, not just the special document root one.\n\t */\n\treadonly isEmpty: boolean;\n\n\t/**\n\t * Obtains and registers an {@link AnnouncedVisitor} that responds to changes on the forest.\n\t */\n\tregisterAnnouncedVisitor(visitor: () => AnnouncedVisitor): void;\n\n\t/**\n\t * Deregister the given visitor so that it stops responding to updates\n\t */\n\tderegisterAnnouncedVisitor(visitor: () => AnnouncedVisitor): void;\n}\n\n/**\n * Returns an anchor to the given field.\n * @param field - defaults to {@link rootField}.\n * @returns anchor to `field`.\n */\nexport function rootAnchor(field: DetachedField = rootField): FieldAnchor {\n\treturn {\n\t\tparent: undefined,\n\t\tfieldKey: detachedFieldAsKey(field),\n\t};\n}\n\n/**\n * Moves the given cursor to the given detached fields in the given forest.\n * @param forest - forest to move cursor in.\n * @param cursorToMove - cursor to move, must be allocated by the given forest\n * @param field - defaults to {@link rootField}.\n */\nexport function moveToDetachedField(\n\tforest: IForestSubscription,\n\tcursorToMove: ITreeSubscriptionCursor,\n\tfield: DetachedField = rootField,\n): void {\n\tconst result = forest.tryMoveCursorToField(rootAnchor(field), cursorToMove);\n\tassert(\n\t\tresult === TreeNavigationResult.Ok,\n\t\t0x42d /* Navigation to detached fields should never fail */,\n\t);\n}\n\n/**\n * Anchor to a field.\n * This is structurally based on the parent, so it will move only as the parent moves.\n */\nexport interface FieldAnchor {\n\t/**\n\t * Node above this field.\n\t * If `undefined`, field is a detached field.\n\t */\n\tparent: Anchor | undefined;\n\tfieldKey: FieldKey;\n}\n\n/**\n * ITreeCursor supporting IForestSubscription and its changes over time.\n */\nexport interface ITreeSubscriptionCursor extends ITreeCursor {\n\t/**\n\t * @param source - optional string identifying the source of the cursor for debugging purposes when cursors are not properly cleaned up.\n\t * @returns an independent copy of this cursor at the same location in the tree.\n\t */\n\tfork(source?: string): ITreeSubscriptionCursor;\n\n\t/**\n\t * Release any resources this cursor is holding onto.\n\t * After doing this, further use of this object other than reading `state` is forbidden (undefined behavior).\n\t */\n\tfree(): void;\n\n\t/**\n\t * Release any resources this cursor is holding onto.\n\t * After doing this, further use of this object other than reading `state` or passing to `tryGet`\n\t * or calling `free` is forbidden (undefined behavior).\n\t */\n\tclear(): void;\n\n\t/**\n\t * Construct an `Anchor` which the IForestSubscription will keep rebased to `current`.\n\t * Note that maintaining an Anchor has cost: free them to stop incurring that cost.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\tbuildAnchor(): Anchor;\n\n\t/**\n\t * Construct a `FieldAnchor` which the IForestSubscription will keep rebased to `current`.\n\t * Note that maintaining an Anchor has cost: free them to stop incurring that cost.\n\t *\n\t * Only valid when `mode` is `Fields`.\n\t */\n\tbuildFieldAnchor(): FieldAnchor;\n\n\t/**\n\t * Current state.\n\t */\n\treadonly state: ITreeSubscriptionCursorState;\n\n\t/**\n\t * @returns location within parent field or range.\n\t */\n\t// TODO: maybe support this.\n\t// getParentInfo(id: NodeId): TreeLocation;\n}\n\nexport enum ITreeSubscriptionCursorState {\n\t/**\n\t * On the current revision of the forest.\n\t */\n\tCurrent,\n\t/**\n\t * Empty, but can be reused.\n\t */\n\tCleared,\n\t/**\n\t * Freed and must not be used.\n\t */\n\tFreed,\n}\n\nexport const enum TreeNavigationResult {\n\t/**\n\t * Attempt to navigate cursor to a key or index that is outside the client's view.\n\t */\n\tNotFound = -1,\n\n\t/**\n\t * Attempt to navigate cursor to a portion of the tree that has not yet been loaded.\n\t */\n\tPending = 0,\n\n\t/**\n\t * ITreeReader successfully navigated to the desired node.\n\t */\n\tOk = 1,\n}\n\n/**\n * TreeNavigationResult, but never \"Pending\".\n * Can be used when data is never pending.\n */\nexport type SynchronousNavigationResult =\n\t| TreeNavigationResult.Ok\n\t| TreeNavigationResult.NotFound;\n"]}
|
|
@@ -76,8 +76,6 @@ export interface ChangeRebaser<TChangeset> {
|
|
|
76
76
|
rebase(change: TaggedChange<TChangeset>, over: TaggedChange<TChangeset>, revisionMetadata: RevisionMetadataSource): TChangeset;
|
|
77
77
|
changeRevision(change: TChangeset, newRevision: RevisionTag | undefined, rollBackOf?: RevisionTag): TChangeset;
|
|
78
78
|
}
|
|
79
|
-
/**
|
|
80
|
-
*/
|
|
81
79
|
export interface TaggedChange<TChangeset, TTag = RevisionTag | undefined> {
|
|
82
80
|
readonly revision: TTag;
|
|
83
81
|
/**
|
|
@@ -99,15 +97,11 @@ export declare function mapTaggedChange<TIn, TOut>(input: TaggedChange<TIn>, cha
|
|
|
99
97
|
* During rebase, the indices of the base changes are all lower than the indices of the change being rebased.
|
|
100
98
|
*/
|
|
101
99
|
export type RevisionIndexer = (tag: RevisionTag) => number | undefined;
|
|
102
|
-
/**
|
|
103
|
-
*/
|
|
104
100
|
export interface RevisionMetadataSource {
|
|
105
101
|
readonly getIndex: RevisionIndexer;
|
|
106
102
|
readonly tryGetInfo: (tag: RevisionTag | undefined) => RevisionInfo | undefined;
|
|
107
103
|
readonly hasRollback: (tag: RevisionTag) => boolean;
|
|
108
104
|
}
|
|
109
|
-
/**
|
|
110
|
-
*/
|
|
111
105
|
export interface RevisionInfo {
|
|
112
106
|
readonly revision: RevisionTag;
|
|
113
107
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeRebaser.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/changeRebaser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,aAAa,CAAC,UAAU;IACxC,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAEnC;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,EAAE,GAAG,UAAU,CAAC;IAEzD;;;;;;;;;;;;OAYG;IACH,MAAM,CACL,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,EACjC,UAAU,EAAE,OAAO,EACnB,QAAQ,EAAE,WAAW,GACnB,UAAU,CAAC;IAEd;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CACL,MAAM,EAAE,YAAY,CAAC,UAAU,CAAC,EAChC,IAAI,EAAE,YAAY,CAAC,UAAU,CAAC,EAC9B,gBAAgB,EAAE,sBAAsB,GACtC,UAAU,CAAC;IAEd,cAAc,CACb,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,UAAU,CAAC,EAAE,WAAW,GACtB,UAAU,CAAC;CACd;AAED
|
|
1
|
+
{"version":3,"file":"changeRebaser.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/changeRebaser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,aAAa,CAAC,UAAU;IACxC,UAAU,CA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