@fluidframework/tree 2.62.0 → 2.63.0-359286
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/.eslintrc.cjs +4 -0
- package/api-report/tree.alpha.api.md +31 -5
- package/api-report/tree.beta.api.md +26 -0
- package/api-report/tree.legacy.beta.api.md +26 -0
- package/dist/alpha.d.ts +4 -3
- package/dist/beta.d.ts +3 -0
- package/dist/codec/codec.d.ts +32 -0
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +32 -1
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +3 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +4 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/index.d.ts +1 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +5 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +3 -6
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +4 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +5 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/core/tree/index.d.ts +1 -0
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +3 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +3 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +5 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +2 -0
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +19 -5
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -1
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +4 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +5 -1
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +1 -0
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -1
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +5 -5
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +7 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
- package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/index.js +2 -1
- package/dist/feature-libraries/schema-edits/index.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +4 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +9 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +2 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +5 -1
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/index.d.ts +1 -1
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +2 -1
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/legacy.d.ts +3 -0
- 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/serializableDomainSchema.d.ts +12 -16
- package/dist/serializableDomainSchema.d.ts.map +1 -1
- package/dist/serializableDomainSchema.js +8 -8
- package/dist/serializableDomainSchema.js.map +1 -1
- package/dist/shared-tree/index.d.ts +2 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +4 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +18 -2
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +122 -8
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +17 -2
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +31 -18
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts +7 -12
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +53 -73
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManager.js +8 -4
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +7 -4
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +42 -11
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +2 -1
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +6 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +7 -4
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +44 -23
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/resubmitMachine.d.ts +9 -18
- 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 +6 -4
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +12 -13
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +7 -166
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +11 -44
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +90 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js +55 -0
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts +12 -2
- package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js +6 -0
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts +3 -2
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNode.js +3 -2
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +2 -2
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/dist/util/brand.d.ts +1 -1
- package/dist/util/brand.js.map +1 -1
- package/docs/main/compatibility.md +8 -0
- package/lib/alpha.d.ts +4 -3
- package/lib/beta.d.ts +3 -0
- package/lib/codec/codec.d.ts +32 -0
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +28 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/schema-stored/index.d.ts +1 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +5 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -6
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +4 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +3 -0
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/core/tree/index.d.ts +1 -0
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -0
- package/lib/core/tree/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +3 -2
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +3 -0
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +2 -0
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +17 -4
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +4 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +3 -0
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +1 -0
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +1 -0
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +5 -5
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -5
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
- package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/index.js +1 -1
- package/lib/feature-libraries/schema-edits/index.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +4 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +2 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +3 -0
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/index.d.ts +1 -1
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +1 -1
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/legacy.d.ts +3 -0
- 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/serializableDomainSchema.d.ts +12 -16
- package/lib/serializableDomainSchema.d.ts.map +1 -1
- package/lib/serializableDomainSchema.js +9 -9
- package/lib/serializableDomainSchema.js.map +1 -1
- package/lib/shared-tree/index.d.ts +2 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +2 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +18 -2
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +126 -13
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +17 -2
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +30 -18
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts +7 -12
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +55 -75
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManager.js +8 -4
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +7 -4
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +40 -10
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +2 -1
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +2 -1
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +7 -4
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +42 -22
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/resubmitMachine.d.ts +9 -18
- 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 +6 -4
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +13 -14
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +7 -166
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +12 -45
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +90 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js +56 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts +12 -2
- package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js +7 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts +3 -2
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNode.js +3 -2
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +2 -2
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/lib/util/brand.d.ts +1 -1
- package/lib/util/brand.js.map +1 -1
- package/package.json +21 -21
- package/src/codec/codec.ts +60 -0
- package/src/codec/index.ts +3 -0
- package/src/core/index.ts +3 -0
- package/src/core/schema-stored/index.ts +1 -0
- package/src/core/schema-stored/schema.ts +5 -6
- package/src/core/tree/detachedFieldIndexCodecs.ts +9 -0
- package/src/core/tree/index.ts +6 -0
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +6 -1
- package/src/feature-libraries/chunked-forest/codec/format.ts +2 -0
- package/src/feature-libraries/chunked-forest/codec/index.ts +2 -1
- package/src/feature-libraries/chunked-forest/index.ts +2 -0
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +29 -5
- package/src/feature-libraries/default-schema/index.ts +2 -0
- package/src/feature-libraries/forest-summary/codec.ts +7 -0
- package/src/feature-libraries/forest-summary/index.ts +1 -0
- package/src/feature-libraries/index.ts +12 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +1 -1
- package/src/feature-libraries/schema-edits/index.ts +5 -1
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +17 -1
- package/src/feature-libraries/schema-index/codec.ts +5 -0
- package/src/feature-libraries/schema-index/index.ts +1 -0
- package/src/packageVersion.ts +1 -1
- package/src/serializableDomainSchema.ts +12 -11
- package/src/shared-tree/index.ts +6 -0
- package/src/shared-tree/sharedTree.ts +151 -11
- package/src/shared-tree/sharedTreeChangeCodecs.ts +68 -30
- package/src/shared-tree/treeCheckout.ts +1 -1
- package/src/shared-tree-core/defaultResubmitMachine.ts +77 -120
- package/src/shared-tree-core/editManager.ts +10 -4
- package/src/shared-tree-core/editManagerCodecs.ts +62 -9
- package/src/shared-tree-core/index.ts +12 -1
- package/src/shared-tree-core/messageCodecs.ts +70 -27
- package/src/shared-tree-core/resubmitMachine.ts +12 -20
- package/src/shared-tree-core/sharedTreeCore.ts +26 -18
- package/src/simple-tree/api/schemaFactoryAlpha.ts +16 -296
- package/src/simple-tree/api/schemaFactoryBeta.ts +269 -1
- package/src/simple-tree/api/treeBeta.ts +36 -1
- package/src/simple-tree/api/typesUnsafe.ts +1 -1
- package/src/simple-tree/core/treeNode.ts +3 -2
- package/src/simple-tree/core/treeNodeKernel.ts +1 -1
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +2 -2
- package/src/util/brand.ts +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { makeSchemaChangeCodecs } from "./schemaChangeCodecs.js";
|
|
5
|
+
export { makeSchemaChangeCodecs, getCodecTreeForSchemaChangeFormat, type SchemaChangeFormatVersion, } from "./schemaChangeCodecs.js";
|
|
6
6
|
export type { SchemaChange } from "./schemaChangeTypes.js";
|
|
7
7
|
export { EncodedSchemaChange } from "./schemaChangeFormat.js";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,sBAAsB,EACtB,iCAAiC,EACjC,KAAK,yBAAyB,GAC9B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { makeSchemaChangeCodecs } from "./schemaChangeCodecs.js";
|
|
5
|
+
export { makeSchemaChangeCodecs, getCodecTreeForSchemaChangeFormat, } from "./schemaChangeCodecs.js";
|
|
6
6
|
export { EncodedSchemaChange } from "./schemaChangeFormat.js";
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,sBAAsB,EACtB,iCAAiC,GAEjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tmakeSchemaChangeCodecs,\n\tgetCodecTreeForSchemaChangeFormat,\n\ttype SchemaChangeFormatVersion,\n} from \"./schemaChangeCodecs.js\";\nexport type { SchemaChange } from \"./schemaChangeTypes.js\";\nexport { EncodedSchemaChange } from \"./schemaChangeFormat.js\";\n"]}
|
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../../codec/index.js";
|
|
5
|
+
import { type CodecTree, type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../../codec/index.js";
|
|
6
6
|
import type { SchemaChange } from "./schemaChangeTypes.js";
|
|
7
7
|
import { SchemaVersion } from "../../core/index.js";
|
|
8
|
+
import type { Brand } from "../../util/index.js";
|
|
8
9
|
/**
|
|
9
10
|
* Create a family of schema change codecs.
|
|
10
11
|
* @param options - Specifies common codec options, including which `validator` to use.
|
|
11
12
|
* @returns The composed codec family.
|
|
12
13
|
*/
|
|
13
14
|
export declare function makeSchemaChangeCodecs(options: ICodecOptions): ICodecFamily<SchemaChange>;
|
|
15
|
+
export type SchemaChangeFormatVersion = Brand<SchemaVersion.v1 | SchemaVersion.v2, "SchemaChangeFormatVersion">;
|
|
16
|
+
export declare function getCodecTreeForSchemaChangeFormat(version: SchemaChangeFormatVersion): CodecTree;
|
|
14
17
|
/**
|
|
15
18
|
* Create a schema change codec.
|
|
16
19
|
* @param options - Specifies common codec options, including which `validator` to use.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaChangeCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemaChangeCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAAC,YAAY,CAAC,CAKzF;AAED,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAC5C,aAAa,CAAC,EAAE,GAAG,aAAa,CAAC,EAAE,EACnC,2BAA2B,CAC3B,CAAC;AACF,wBAAgB,iCAAiC,CAChD,OAAO,EAAE,yBAAyB,GAChC,SAAS,CAMX;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,aAAa,GACzB,UAAU,CAAC,YAAY,CAAC,CAG1B"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
6
|
import { makeCodecFamily, makeVersionDispatchingCodec, withSchemaValidation, } from "../../codec/index.js";
|
|
7
|
-
import { makeSchemaCodec } from "../schema-index/index.js";
|
|
7
|
+
import { getCodecTreeForSchemaFormat, makeSchemaCodec } from "../schema-index/index.js";
|
|
8
8
|
import { EncodedSchemaChange } from "./schemaChangeFormat.js";
|
|
9
9
|
import { SchemaVersion } from "../../core/index.js";
|
|
10
10
|
/**
|
|
@@ -18,6 +18,13 @@ export function makeSchemaChangeCodecs(options) {
|
|
|
18
18
|
[SchemaVersion.v2, makeSchemaChangeCodecV1(options, SchemaVersion.v2)],
|
|
19
19
|
]);
|
|
20
20
|
}
|
|
21
|
+
export function getCodecTreeForSchemaChangeFormat(version) {
|
|
22
|
+
return {
|
|
23
|
+
name: "SchemaChange",
|
|
24
|
+
version,
|
|
25
|
+
children: [getCodecTreeForSchemaFormat(version)],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
21
28
|
/**
|
|
22
29
|
* Create a schema change codec.
|
|
23
30
|
* @param options - Specifies common codec options, including which `validator` to use.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaChangeCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,
|
|
1
|
+
{"version":3,"file":"schemaChangeCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"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AAC,YAAY,CAAC,SAAS,EACvB,KAAK,CAAC,wDAAwD,CAC9D,CAAC;YACF,OAAO;gBACN,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;gBAChD,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;aAChD,CAAC;QACH,CAAC;QACD,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;YACnB,OAAO;gBACN,MAAM,EAAE;oBACP,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;oBACpC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;iBACpC;gBACD,SAAS,EAAE,KAAK;aAChB,CAAC;QACH,CAAC;QACD,aAAa,EAAE,mBAAmB;KAClC,CAAC;IAEF,OAAO,oBAAoB,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeVersionDispatchingCodec,\n\twithSchemaValidation,\n} from \"../../codec/index.js\";\nimport { getCodecTreeForSchemaFormat, makeSchemaCodec } from \"../schema-index/index.js\";\n\nimport { EncodedSchemaChange } from \"./schemaChangeFormat.js\";\nimport type { SchemaChange } from \"./schemaChangeTypes.js\";\nimport { SchemaVersion } from \"../../core/index.js\";\nimport type { Brand } from \"../../util/index.js\";\n\n/**\n * Create a family of schema change codecs.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The composed codec family.\n */\nexport function makeSchemaChangeCodecs(options: ICodecOptions): ICodecFamily<SchemaChange> {\n\treturn makeCodecFamily([\n\t\t[SchemaVersion.v1, makeSchemaChangeCodecV1(options, SchemaVersion.v1)],\n\t\t[SchemaVersion.v2, makeSchemaChangeCodecV1(options, SchemaVersion.v2)],\n\t]);\n}\n\nexport type SchemaChangeFormatVersion = Brand<\n\tSchemaVersion.v1 | SchemaVersion.v2,\n\t\"SchemaChangeFormatVersion\"\n>;\nexport function getCodecTreeForSchemaChangeFormat(\n\tversion: SchemaChangeFormatVersion,\n): CodecTree {\n\treturn {\n\t\tname: \"SchemaChange\",\n\t\tversion,\n\t\tchildren: [getCodecTreeForSchemaFormat(version)],\n\t};\n}\n\n/**\n * Create a schema change codec.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @param writeVersion - The schema change write version.\n * @returns The composed codec.\n */\nexport function makeSchemaChangeCodec(\n\toptions: ICodecOptions,\n\twriteVersion: SchemaVersion,\n): IJsonCodec<SchemaChange> {\n\tconst family = makeSchemaChangeCodecs(options);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\n/**\n * Compose the change codec using mostly v1 logic.\n * @param options - The codec options.\n * @param schemaWriteVersion - The schema write version.\n * @returns The composed schema change codec.\n */\nfunction makeSchemaChangeCodecV1(\n\toptions: ICodecOptions,\n\tschemaWriteVersion: SchemaVersion,\n): IJsonCodec<SchemaChange, EncodedSchemaChange> {\n\tconst schemaCodec = makeSchemaCodec(options, schemaWriteVersion);\n\tconst schemaChangeCodec: IJsonCodec<SchemaChange, EncodedSchemaChange> = {\n\t\tencode: (schemaChange) => {\n\t\t\tassert(\n\t\t\t\t!schemaChange.isInverse,\n\t\t\t\t0x933 /* Inverse schema changes should never be transmitted */,\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tnew: schemaCodec.encode(schemaChange.schema.new),\n\t\t\t\told: schemaCodec.encode(schemaChange.schema.old),\n\t\t\t};\n\t\t},\n\t\tdecode: (encoded) => {\n\t\t\treturn {\n\t\t\t\tschema: {\n\t\t\t\t\tnew: schemaCodec.decode(encoded.new),\n\t\t\t\t\told: schemaCodec.decode(encoded.old),\n\t\t\t\t},\n\t\t\t\tisInverse: false,\n\t\t\t};\n\t\t},\n\t\tencodedSchema: EncodedSchemaChange,\n\t};\n\n\treturn withSchemaValidation(EncodedSchemaChange, schemaChangeCodec, options.jsonValidator);\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { type FluidClientVersion, type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../../codec/index.js";
|
|
5
|
+
import { type CodecTree, type FluidClientVersion, type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../../codec/index.js";
|
|
6
6
|
import { SchemaVersion, type TreeStoredSchema } from "../../core/index.js";
|
|
7
7
|
import { type JsonCompatible } from "../../util/index.js";
|
|
8
8
|
/**
|
|
@@ -11,6 +11,7 @@ import { type JsonCompatible } from "../../util/index.js";
|
|
|
11
11
|
* @returns The SchemaVersion that corresponds to the provided FluidClientVersion.
|
|
12
12
|
*/
|
|
13
13
|
export declare function clientVersionToSchemaVersion(clientVersion: FluidClientVersion): SchemaVersion;
|
|
14
|
+
export declare function getCodecTreeForSchemaFormat(version: SchemaVersion): CodecTree;
|
|
14
15
|
/**
|
|
15
16
|
* Create a schema codec.
|
|
16
17
|
* @param options - Specifies common codec options, including which `validator` to use.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,aAAa,EAGb,KAAK,gBAAgB,EAKrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAS,KAAK,cAAc,EAAE,MAA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AgB,EAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CASzF"}
|
|
@@ -17,6 +17,9 @@ export function clientVersionToSchemaVersion(clientVersion) {
|
|
|
17
17
|
// Only one version of the schema codec is currently supported.
|
|
18
18
|
return SchemaVersion.v1;
|
|
19
19
|
}
|
|
20
|
+
export function getCodecTreeForSchemaFormat(version) {
|
|
21
|
+
return { name: "Schema", version };
|
|
22
|
+
}
|
|
20
23
|
/**
|
|
21
24
|
* Create a schema codec.
|
|
22
25
|
* @param options - Specifies common codec options, including which `validator` to use.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAKN,eAAe,EACf,2BAA2B,EAC3B,2BAA2B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,aAAa,EAIb,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAuB,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAC3C,aAAiC;IAEjC,+DAA+D;IAC/D,OAAO,aAAa,CAAC,EAAE,CAAC;AACzB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC9B,OAAsB,EACtB,YAA2B;IAE3B,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzC,OAAO,2BAA2B,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;AA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C,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACrD,MAAM,mBAAmB,GAAG,4BAA4B,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE/E,4BAA4B;QAC5B,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,OAAO;QACN,eAAe,EAAE,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1C,UAAU;KACV,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,OAAsB;IAChD,OAAO,2BAA2B,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE;QAClF,MAAM,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC;QACtD,MAAM,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;KAC1C,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,OAAsB;IAChD,OAAO,2BAA2B,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE;QAClF,MAAM,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC;QACtD,MAAM,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;KAC1C,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype FluidClientVersion,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeVersionDispatchingCodec,\n\tmakeVersionedValidatedCodec,\n} from \"../../codec/index.js\";\nimport {\n\tSchemaVersion,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchemaV1,\n\tencodeFieldSchemaV2,\n\tstoredSchemaDecodeDispatcher,\n} from \"../../core/index.js\";\nimport { brand, type JsonCompatible } from \"../../util/index.js\";\n\nimport { Format as FormatV1 } from \"./formatV1.js\";\nimport { Format as FormatV2 } from \"./formatV2.js\";\n\n/**\n * Convert a FluidClientVersion to a SchemaVersion.\n * @param clientVersion - The FluidClientVersion to convert.\n * @returns The SchemaVersion that corresponds to the provided FluidClientVersion.\n */\nexport function clientVersionToSchemaVersion(\n\tclientVersion: FluidClientVersion,\n): SchemaVersion {\n\t// Only one version of the schema codec is currently supported.\n\treturn SchemaVersion.v1;\n}\n\n/**\n * Create a schema codec.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @param writeVersion - The schema write version.\n * @returns The composed codec.\n *\n * @privateRemarks We should consider using the Shared Tree format version instead as it may be more valuable for application authors than the schema version.\n */\nexport function makeSchemaCodec(\n\toptions: ICodecOptions,\n\twriteVersion: SchemaVersion,\n): IJsonCodec<TreeStoredSchema> {\n\tconst family = makeSchemaCodecs(options);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\n/**\n * Create a family of schema codecs.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The composed codec family.\n */\nexport function makeSchemaCodecs(options: ICodecOptions): ICodecFamily<TreeStoredSchema> {\n\treturn makeCodecFamily([\n\t\t[SchemaVersion.v1, makeSchemaCodecV1(options)],\n\t\t[SchemaVersion.v2, makeSchemaCodecV2(options)],\n\t]);\n}\n\n/**\n * Encode an in-memory TreeStoredSchema into the specified format version.\n * @param repo - The in-memory schema.\n * @param version - The schema write version.\n * @returns The encoded schema.\n */\nexport function encodeRepo(repo: TreeStoredSchema, version: SchemaVersion): JsonCompatible {\n\tswitch (version) {\n\t\tcase SchemaVersion.v1:\n\t\t\treturn encodeRepoV1(repo) as JsonCompatible;\n\t\tcase SchemaVersion.v2:\n\t\t\treturn encodeRepoV2(repo) as JsonCompatible;\n\t\tdefault:\n\t\t\tunreachableCase(version);\n\t}\n}\n\nfunction encodeRepoV1(repo: TreeStoredSchema): FormatV1 {\n\tconst nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV1());\n\tconst rootFieldSchema = encodeFieldSchemaV1(repo.rootFieldSchema);\n\treturn {\n\t\tversion: SchemaVersion.v1,\n\t\tnodes: nodeSchema,\n\t\troot: rootFieldSchema,\n\t};\n}\n\nfunction encodeRepoV2(repo: TreeStoredSchema): FormatV2 {\n\tconst nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV2());\n\tconst rootFieldSchema = encodeFieldSchemaV2(repo.rootFieldSchema);\n\treturn {\n\t\tversion: SchemaVersion.v2,\n\t\tnodes: nodeSchema,\n\t\troot: rootFieldSchema,\n\t};\n}\n\n/**\n * Shared logic for encoding node schemas.\n * @param repo - The stored schema to encode.\n * @param encodeValue - A function which encodes a single node schema.\n * @returns The encoded node schema.\n */\nfunction encodeNodeSchema<TFormat>(\n\trepo: TreeStoredSchema,\n\tencodeValue: (schema: TreeNodeStoredSchema) => TFormat,\n): Record<string, TFormat> {\n\tconst nodeSchema: Record<string, TFormat> = Object.create(null);\n\tfor (const name of [...repo.nodeSchema.keys()].sort()) {\n\t\tconst schema = repo.nodeSchema.get(name) ?? fail(0xb28 /* missing schema */);\n\t\tObject.defineProperty(nodeSchema, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tvalue: encodeValue(schema),\n\t\t});\n\t}\n\n\treturn nodeSchema;\n}\n\nfunction decodeV1(f: FormatV1): TreeStoredSchema {\n\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();\n\tfor (const [key, schema] of Object.entries(f.nodes)) {\n\t\tconst storedSchemaDecoder = storedSchemaDecodeDispatcher.dispatch(schema);\n\n\t\t// No metadata in v1, so pass undefined\n\t\tnodeSchema.set(brand(key), storedSchemaDecoder(undefined));\n\t}\n\treturn {\n\t\trootFieldSchema: decodeFieldSchema(f.root),\n\t\tnodeSchema,\n\t};\n}\n\nfunction decodeV2(f: FormatV2): TreeStoredSchema {\n\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();\n\tfor (const [key, schema] of Object.entries(f.nodes)) {\n\t\tconst storedSchemaDecoder = storedSchemaDecodeDispatcher.dispatch(schema.kind);\n\n\t\t// Pass in the node metadata\n\t\tnodeSchema.set(brand(key), storedSchemaDecoder(schema.metadata));\n\t}\n\treturn {\n\t\trootFieldSchema: decodeFieldSchema(f.root),\n\t\tnodeSchema,\n\t};\n}\n\n/**\n * Creates a codec which performs synchronous monolithic encoding of schema content.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The codec.\n */\nfunction makeSchemaCodecV1(options: ICodecOptions): IJsonCodec<TreeStoredSchema, FormatV1> {\n\treturn makeVersionedValidatedCodec(options, new Set([SchemaVersion.v1]), FormatV1, {\n\t\tencode: (data: TreeStoredSchema) => encodeRepoV1(data),\n\t\tdecode: (data: FormatV1) => decodeV1(data),\n\t});\n}\n\n/**\n * Creates a codec which performs synchronous monolithic encoding of schema content.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The codec.\n */\nfunction makeSchemaCodecV2(options: ICodecOptions): IJsonCodec<TreeStoredSchema, FormatV2> {\n\treturn makeVersionedValidatedCodec(options, new Set([SchemaVersion.v2]), FormatV2, {\n\t\tencode: (data: TreeStoredSchema) => encodeRepoV2(data),\n\t\tdecode: (data: FormatV2) => decodeV2(data),\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/cod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AE,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1C,UAAU;KACV,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,OAAsB;IAChD,OAAO,2BAA2B,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE;QAClF,MAAM,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC;QACtD,MAAM,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;KAC1C,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,OAAsB;IAChD,OAAO,2BAA2B,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE;QAClF,MAAM,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC;QACtD,MAAM,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;KAC1C,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype FluidClientVersion,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeVersionDispatchingCodec,\n\tmakeVersionedValidatedCodec,\n} from \"../../codec/index.js\";\nimport {\n\tSchemaVersion,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchemaV1,\n\tencodeFieldSchemaV2,\n\tstoredSchemaDecodeDispatcher,\n} from \"../../core/index.js\";\nimport { brand, type JsonCompatible } from \"../../util/index.js\";\n\nimport { Format as FormatV1 } from \"./formatV1.js\";\nimport { Format as FormatV2 } from \"./formatV2.js\";\n\n/**\n * Convert a FluidClientVersion to a SchemaVersion.\n * @param clientVersion - The FluidClientVersion to convert.\n * @returns The SchemaVersion that corresponds to the provided FluidClientVersion.\n */\nexport function clientVersionToSchemaVersion(\n\tclientVersion: FluidClientVersion,\n): SchemaVersion {\n\t// Only one version of the schema codec is currently supported.\n\treturn SchemaVersion.v1;\n}\n\nexport function getCodecTreeForSchemaFormat(version: SchemaVersion): CodecTree {\n\treturn { name: \"Schema\", version };\n}\n\n/**\n * Create a schema codec.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @param writeVersion - The schema write version.\n * @returns The composed codec.\n *\n * @privateRemarks We should consider using the Shared Tree format version instead as it may be more valuable for application authors than the schema version.\n */\nexport function makeSchemaCodec(\n\toptions: ICodecOptions,\n\twriteVersion: SchemaVersion,\n): IJsonCodec<TreeStoredSchema> {\n\tconst family = makeSchemaCodecs(options);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\n/**\n * Create a family of schema codecs.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The composed codec family.\n */\nexport function makeSchemaCodecs(options: ICodecOptions): ICodecFamily<TreeStoredSchema> {\n\treturn makeCodecFamily([\n\t\t[SchemaVersion.v1, makeSchemaCodecV1(options)],\n\t\t[SchemaVersion.v2, makeSchemaCodecV2(options)],\n\t]);\n}\n\n/**\n * Encode an in-memory TreeStoredSchema into the specified format version.\n * @param repo - The in-memory schema.\n * @param version - The schema write version.\n * @returns The encoded schema.\n */\nexport function encodeRepo(repo: TreeStoredSchema, version: SchemaVersion): JsonCompatible {\n\tswitch (version) {\n\t\tcase SchemaVersion.v1:\n\t\t\treturn encodeRepoV1(repo) as JsonCompatible;\n\t\tcase SchemaVersion.v2:\n\t\t\treturn encodeRepoV2(repo) as JsonCompatible;\n\t\tdefault:\n\t\t\tunreachableCase(version);\n\t}\n}\n\nfunction encodeRepoV1(repo: TreeStoredSchema): FormatV1 {\n\tconst nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV1());\n\tconst rootFieldSchema = encodeFieldSchemaV1(repo.rootFieldSchema);\n\treturn {\n\t\tversion: SchemaVersion.v1,\n\t\tnodes: nodeSchema,\n\t\troot: rootFieldSchema,\n\t};\n}\n\nfunction encodeRepoV2(repo: TreeStoredSchema): FormatV2 {\n\tconst nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV2());\n\tconst rootFieldSchema = encodeFieldSchemaV2(repo.rootFieldSchema);\n\treturn {\n\t\tversion: SchemaVersion.v2,\n\t\tnodes: nodeSchema,\n\t\troot: rootFieldSchema,\n\t};\n}\n\n/**\n * Shared logic for encoding node schemas.\n * @param repo - The stored schema to encode.\n * @param encodeValue - A function which encodes a single node schema.\n * @returns The encoded node schema.\n */\nfunction encodeNodeSchema<TFormat>(\n\trepo: TreeStoredSchema,\n\tencodeValue: (schema: TreeNodeStoredSchema) => TFormat,\n): Record<string, TFormat> {\n\tconst nodeSchema: Record<string, TFormat> = Object.create(null);\n\tfor (const name of [...repo.nodeSchema.keys()].sort()) {\n\t\tconst schema = repo.nodeSchema.get(name) ?? fail(0xb28 /* missing schema */);\n\t\tObject.defineProperty(nodeSchema, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tvalue: encodeValue(schema),\n\t\t});\n\t}\n\n\treturn nodeSchema;\n}\n\nfunction decodeV1(f: FormatV1): TreeStoredSchema {\n\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();\n\tfor (const [key, schema] of Object.entries(f.nodes)) {\n\t\tconst storedSchemaDecoder = storedSchemaDecodeDispatcher.dispatch(schema);\n\n\t\t// No metadata in v1, so pass undefined\n\t\tnodeSchema.set(brand(key), storedSchemaDecoder(undefined));\n\t}\n\treturn {\n\t\trootFieldSchema: decodeFieldSchema(f.root),\n\t\tnodeSchema,\n\t};\n}\n\nfunction decodeV2(f: FormatV2): TreeStoredSchema {\n\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();\n\tfor (const [key, schema] of Object.entries(f.nodes)) {\n\t\tconst storedSchemaDecoder = storedSchemaDecodeDispatcher.dispatch(schema.kind);\n\n\t\t// Pass in the node metadata\n\t\tnodeSchema.set(brand(key), storedSchemaDecoder(schema.metadata));\n\t}\n\treturn {\n\t\trootFieldSchema: decodeFieldSchema(f.root),\n\t\tnodeSchema,\n\t};\n}\n\n/**\n * Creates a codec which performs synchronous monolithic encoding of schema content.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The codec.\n */\nfunction makeSchemaCodecV1(options: ICodecOptions): IJsonCodec<TreeStoredSchema, FormatV1> {\n\treturn makeVersionedValidatedCodec(options, new Set([SchemaVersion.v1]), FormatV1, {\n\t\tencode: (data: TreeStoredSchema) => encodeRepoV1(data),\n\t\tdecode: (data: FormatV1) => decodeV1(data),\n\t});\n}\n\n/**\n * Creates a codec which performs synchronous monolithic encoding of schema content.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The codec.\n */\nfunction makeSchemaCodecV2(options: ICodecOptions): IJsonCodec<TreeStoredSchema, FormatV2> {\n\treturn makeVersionedValidatedCodec(options, new Set([SchemaVersion.v2]), FormatV2, {\n\t\tencode: (data: TreeStoredSchema) => encodeRepoV2(data),\n\t\tdecode: (data: FormatV2) => decodeV2(data),\n\t});\n}\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { SchemaSummarizer, encodeTreeSchema } from "./schemaSummarizer.js";
|
|
6
|
-
export { makeSchemaCodec, makeSchemaCodecs, clientVersionToSchemaVersion, } from "./codec.js";
|
|
6
|
+
export { makeSchemaCodec, makeSchemaCodecs, clientVersionToSchemaVersion, getCodecTreeForSchemaFormat, } from "./codec.js";
|
|
7
7
|
export { Format as FormatV1 } from "./formatV1.js";
|
|
8
8
|
export { Format as FormatV2 } from "./formatV2.js";
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACN,eAAe,EACf,gBAAgB,EAChB,4BAA4B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACN,eAAe,EACf,gBAAgB,EAChB,4BAA4B,EAC5B,2BAA2B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { SchemaSummarizer, encodeTreeSchema } from "./schemaSummarizer.js";
|
|
6
|
-
export { makeSchemaCodec, makeSchemaCodecs, clientVersionToSchemaVersion, } from "./codec.js";
|
|
6
|
+
export { makeSchemaCodec, makeSchemaCodecs, clientVersionToSchemaVersion, getCodecTreeForSchemaFormat, } from "./codec.js";
|
|
7
7
|
export { Format as FormatV1 } from "./formatV1.js";
|
|
8
8
|
export { Format as FormatV2 } from "./formatV2.js";
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACN,eAAe,EACf,gBAAgB,EAChB,4BAA4B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACN,eAAe,EACf,gBAAgB,EAChB,4BAA4B,EAC5B,2BAA2B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { SchemaSummarizer, encodeTreeSchema } from \"./schemaSummarizer.js\";\nexport {\n\tmakeSchemaCodec,\n\tmakeSchemaCodecs,\n\tclientVersionToSchemaVersion,\n\tgetCodecTreeForSchemaFormat,\n} from \"./codec.js\";\nexport { Format as FormatV1 } from \"./formatV1.js\";\nexport { Format as FormatV2 } from \"./formatV2.js\";\n"]}
|
package/lib/legacy.d.ts
CHANGED
|
@@ -99,10 +99,13 @@ export {
|
|
|
99
99
|
ForestTypeReference,
|
|
100
100
|
NodeChangedData,
|
|
101
101
|
PopUnion,
|
|
102
|
+
RecordNodeInsertableData,
|
|
102
103
|
SchemaFactoryBeta,
|
|
103
104
|
SharedTreeOptionsBeta,
|
|
104
105
|
TreeBeta,
|
|
105
106
|
TreeChangeEventsBeta,
|
|
107
|
+
TreeRecordNode,
|
|
108
|
+
TreeRecordNodeUnsafe,
|
|
106
109
|
UnionToTuple,
|
|
107
110
|
adaptEnum,
|
|
108
111
|
configuredSharedTreeBeta,
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/tree";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.63.0-359286";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yBAAyB,CAAC;AAC9C,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yBAAyB,CAAC;AAC9C,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAC9C,MAAM,CAAC,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAC9C,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.63.0-359286\";\n"]}
|
|
@@ -13,14 +13,14 @@ import type { JsonCompatible } from "./util/index.js";
|
|
|
13
13
|
* Schema which replicate the Fluid Serializable data model with {@link TreeNode}s.
|
|
14
14
|
*
|
|
15
15
|
* Fluid Serializable data can be imported from the {@link FluidSerializableAsTree.Data|Fluid Serializable format} into this format using {@link (TreeAlpha:interface).importConcise} with the {@link FluidSerializableAsTree.(Tree:variable)} schema.
|
|
16
|
-
* @
|
|
16
|
+
* @alpha
|
|
17
17
|
*/
|
|
18
18
|
export declare namespace FluidSerializableAsTree {
|
|
19
19
|
/**
|
|
20
20
|
* Data which can be serialized by Fluid.
|
|
21
21
|
* @remarks
|
|
22
22
|
* Can be encoded as a {@link FluidSerializableAsTree.(Tree:type)} using {@link (TreeAlpha:interface).importConcise}.
|
|
23
|
-
* @
|
|
23
|
+
* @alpha
|
|
24
24
|
*/
|
|
25
25
|
type Data = JsonCompatible<IFluidHandle>;
|
|
26
26
|
/**
|
|
@@ -29,22 +29,20 @@ export declare namespace FluidSerializableAsTree {
|
|
|
29
29
|
* ```typescript
|
|
30
30
|
* const tree = TreeAlpha.importConcise(FluidSerializableAsTree.Tree, { example: { nested: true }, value: 5 });
|
|
31
31
|
* ```
|
|
32
|
-
* @
|
|
32
|
+
* @alpha
|
|
33
33
|
*/
|
|
34
34
|
const Tree: readonly [() => typeof FluidSerializableObject, () => typeof Array, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"number", number>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"null", null>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"handle", IFluidHandle<unknown>>];
|
|
35
35
|
/**
|
|
36
|
-
* @
|
|
36
|
+
* @alpha
|
|
37
37
|
*/
|
|
38
38
|
type Tree = TreeNodeFromImplicitAllowedTypes<typeof Tree>;
|
|
39
39
|
/**
|
|
40
40
|
* Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.
|
|
41
|
-
* @system @
|
|
41
|
+
* @system @alpha
|
|
42
42
|
*/
|
|
43
|
-
const _APIExtractorWorkaroundObjectBase: import("./simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.serializable.object", import("./simple-tree/index.js").NodeKind.
|
|
44
|
-
[Symbol.iterator](): Iterator<[string, string | number | IFluidHandle<unknown> | import("./simple-tree/index.js").System_Unsafe.InsertableTypedNodeUnsafe<import("./simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>> | FluidSerializableObject | Array | null], any, undefined>;
|
|
45
|
-
} | {
|
|
43
|
+
const _APIExtractorWorkaroundObjectBase: import("./simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.serializable.object", import("./simple-tree/index.js").NodeKind.Record, import("./simple-tree/index.js").TreeRecordNodeUnsafe<readonly [() => typeof FluidSerializableObject, () => typeof Array, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"number", number>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"null", null>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"handle", IFluidHandle<unknown>>]> & import("./simple-tree/index.js").WithType<"com.fluidframework.serializable.object", import("./simple-tree/index.js").NodeKind.Record, unknown>, {
|
|
46
44
|
readonly [x: string]: string | number | IFluidHandle<unknown> | import("./simple-tree/index.js").System_Unsafe.InsertableTypedNodeUnsafe<import("./simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>> | FluidSerializableObject | Array | null;
|
|
47
|
-
}, false, readonly [() => typeof FluidSerializableObject, () => typeof Array, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"number", number>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"null", null>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"handle", IFluidHandle<unknown>>], undefined>;
|
|
45
|
+
}, false, readonly [() => typeof FluidSerializableObject, () => typeof Array, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"number", number>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"null", null>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"handle", IFluidHandle<unknown>>], undefined, unknown>;
|
|
48
46
|
/**
|
|
49
47
|
* Arbitrary Fluid Serializable object as a {@link TreeNode}.
|
|
50
48
|
* @remarks
|
|
@@ -60,7 +58,7 @@ export declare namespace FluidSerializableAsTree {
|
|
|
60
58
|
* ```
|
|
61
59
|
* @privateRemarks
|
|
62
60
|
* Due to https://github.com/microsoft/TypeScript/issues/61270 this can't be named `Object`.
|
|
63
|
-
* @sealed @
|
|
61
|
+
* @sealed @alpha
|
|
64
62
|
*/
|
|
65
63
|
class FluidSerializableObject extends _APIExtractorWorkaroundObjectBase {
|
|
66
64
|
}
|
|
@@ -69,16 +67,14 @@ export declare namespace FluidSerializableAsTree {
|
|
|
69
67
|
* @privateRemarks
|
|
70
68
|
* In the past this this had to reference the base type (_APIExtractorWorkaroundArrayBase).
|
|
71
69
|
* Testing for this in examples/utils/import-testing now shows it has to reference FluidSerializableAsTree.Array instead.
|
|
72
|
-
* @system @
|
|
70
|
+
* @system @alpha
|
|
73
71
|
*/
|
|
74
72
|
type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<typeof Array>;
|
|
75
73
|
/**
|
|
76
74
|
* Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.
|
|
77
|
-
* @system @
|
|
75
|
+
* @system @alpha
|
|
78
76
|
*/
|
|
79
|
-
const _APIExtractorWorkaroundArrayBase: import("./simple-tree/index.js").
|
|
80
|
-
[Symbol.iterator](): Iterator<string | number | IFluidHandle<unknown> | import("./simple-tree/index.js").System_Unsafe.InsertableTypedNodeUnsafe<import("./simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>> | FluidSerializableObject | Array | null, any, undefined>;
|
|
81
|
-
}, false, readonly [() => typeof FluidSerializableObject, () => typeof Array, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"number", number>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"null", null>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"handle", IFluidHandle<unknown>>], undefined>;
|
|
77
|
+
const _APIExtractorWorkaroundArrayBase: import("./simple-tree/index.js").ArrayNodeCustomizableSchemaUnsafe<"com.fluidframework.serializable.array", readonly [() => typeof FluidSerializableObject, () => typeof Array, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"number", number>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"boolean", boolean>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"null", null>, import("./simple-tree/leafNodeSchema.js").LeafSchema<"handle", IFluidHandle<unknown>>], unknown>;
|
|
82
78
|
/**
|
|
83
79
|
* Arbitrary Fluid Serializable array as a {@link TreeNode}.
|
|
84
80
|
* @remarks
|
|
@@ -94,7 +90,7 @@ export declare namespace FluidSerializableAsTree {
|
|
|
94
90
|
* assert(Tree.is(inner, FluidSerializableAsTree.Array));
|
|
95
91
|
* const leaf = inner[0];
|
|
96
92
|
* ```
|
|
97
|
-
* @sealed @
|
|
93
|
+
* @sealed @alpha
|
|
98
94
|
*/
|
|
99
95
|
class Array extends _APIExtractorWorkaroundArrayBase {
|
|
100
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializableDomainSchema.d.ts","sourceRoot":"","sources":["../src/serializableDomainSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,
|
|
1
|
+
{"version":3,"file":"serializableDomainSchema.d.ts","sourceRoot":"","sources":["../src/serializableDomainSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAGN,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EAErC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAItD;;;;;;;;;GASG;AACH,yBAAiB,uBAAuB,CAAC;IACxC;;;;;OAKG;IACH,KAAY,IAAI,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC;IAEhD;;;;;;;OAOG;IACI,MAAM,IAAI,0bAIP,CAAC;IAEX;;OAEG;IACH,KAAY,IAAI,GAAG,gCAAgC,CAAC,OAAO,IAAI,CAAC,CAAC;IAEjE;;;OAGG;IACI,MAAM,iCAAiC;;2dAAqC,CAAC;IAEpF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,uBAAwB,SAAQ,iCAAiC;KAAG;IAKjF;;;;;;OAMG;IACH,KAAoB,kCAAkC,GAAG,uBAAuB,CAC/E,OAAO,KAAK,CACZ,CAAC;IAEF;;;OAGG;IACI,MAAM,gCAAgC,gjBAAmC,CAAC;IAEjF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,KAAM,SAAQ,gCAAgC;KAAG;CAI9D"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { SchemaFactory, } from "./simple-tree/index.js";
|
|
6
|
-
const sf = new
|
|
5
|
+
import { SchemaFactory, SchemaFactoryAlpha, } from "./simple-tree/index.js";
|
|
6
|
+
const sf = new SchemaFactoryAlpha("com.fluidframework.serializable");
|
|
7
7
|
/**
|
|
8
8
|
* Utilities for storing {@link FluidSerializableAsTree.Data|Fluid Serializable data} in {@link TreeNode}s.
|
|
9
9
|
*
|
|
@@ -12,7 +12,7 @@ const sf = new SchemaFactory("com.fluidframework.serializable");
|
|
|
12
12
|
* Schema which replicate the Fluid Serializable data model with {@link TreeNode}s.
|
|
13
13
|
*
|
|
14
14
|
* Fluid Serializable data can be imported from the {@link FluidSerializableAsTree.Data|Fluid Serializable format} into this format using {@link (TreeAlpha:interface).importConcise} with the {@link FluidSerializableAsTree.(Tree:variable)} schema.
|
|
15
|
-
* @
|
|
15
|
+
* @alpha
|
|
16
16
|
*/
|
|
17
17
|
export var FluidSerializableAsTree;
|
|
18
18
|
(function (FluidSerializableAsTree) {
|
|
@@ -22,7 +22,7 @@ export var FluidSerializableAsTree;
|
|
|
22
22
|
* ```typescript
|
|
23
23
|
* const tree = TreeAlpha.importConcise(FluidSerializableAsTree.Tree, { example: { nested: true }, value: 5 });
|
|
24
24
|
* ```
|
|
25
|
-
* @
|
|
25
|
+
* @alpha
|
|
26
26
|
*/
|
|
27
27
|
FluidSerializableAsTree.Tree = [
|
|
28
28
|
() => FluidSerializableObject,
|
|
@@ -31,9 +31,9 @@ export var FluidSerializableAsTree;
|
|
|
31
31
|
];
|
|
32
32
|
/**
|
|
33
33
|
* Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.
|
|
34
|
-
* @system @
|
|
34
|
+
* @system @alpha
|
|
35
35
|
*/
|
|
36
|
-
FluidSerializableAsTree._APIExtractorWorkaroundObjectBase = sf.
|
|
36
|
+
FluidSerializableAsTree._APIExtractorWorkaroundObjectBase = sf.recordRecursive("object", FluidSerializableAsTree.Tree);
|
|
37
37
|
/**
|
|
38
38
|
* Arbitrary Fluid Serializable object as a {@link TreeNode}.
|
|
39
39
|
* @remarks
|
|
@@ -49,7 +49,7 @@ export var FluidSerializableAsTree;
|
|
|
49
49
|
* ```
|
|
50
50
|
* @privateRemarks
|
|
51
51
|
* Due to https://github.com/microsoft/TypeScript/issues/61270 this can't be named `Object`.
|
|
52
|
-
* @sealed @
|
|
52
|
+
* @sealed @alpha
|
|
53
53
|
*/
|
|
54
54
|
class FluidSerializableObject extends FluidSerializableAsTree._APIExtractorWorkaroundObjectBase {
|
|
55
55
|
}
|
|
@@ -58,7 +58,7 @@ export var FluidSerializableAsTree;
|
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.
|
|
61
|
-
* @system @
|
|
61
|
+
* @system @alpha
|
|
62
62
|
*/
|
|
63
63
|
FluidSerializableAsTree._APIExtractorWorkaroundArrayBase = sf.arrayRecursive("array", FluidSerializableAsTree.Tree);
|
|
64
64
|
/**
|
|
@@ -76,7 +76,7 @@ export var FluidSerializableAsTree;
|
|
|
76
76
|
* assert(Tree.is(inner, FluidSerializableAsTree.Array));
|
|
77
77
|
* const leaf = inner[0];
|
|
78
78
|
* ```
|
|
79
|
-
* @sealed @
|
|
79
|
+
* @sealed @alpha
|
|
80
80
|
*/
|
|
81
81
|
class Array extends FluidSerializableAsTree._APIExtractorWorkaroundArrayBase {
|
|
82
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializableDomainSchema.js","sourceRoot":"","sources":["../src/serializableDomainSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,aAAa,
|
|
1
|
+
{"version":3,"file":"serializableDomainSchema.js","sourceRoot":"","sources":["../src/serializableDomainSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,aAAa,EACb,kBAAkB,GAIlB,MAAM,wBAAwB,CAAC;AAGhC,MAAM,EAAE,GAAG,IAAI,kBAAkB,CAAC,iCAAiC,CAAC,CAAC;AAErE;;;;;;;;;GASG;AACH,MAAM,KAAW,uBAAuB,CA8FvC;AA9FD,WAAiB,uBAAuB;IASvC;;;;;;;OAOG;IACU,4BAAI,GAAG;QACnB,GAAG,EAAE,CAAC,uBAAuB;QAC7B,GAAG,EAAE,CAAC,KAAK;QACX,GAAG,aAAa,CAAC,MAAM;KACd,CAAC;IAOX;;;OAGG;IACU,yDAAiC,GAAG,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,wBAAA,IAAI,CAAC,CAAC;IAEpF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,uBAAwB,SAAQ,wBAAA,iCAAiC;KAAG;IAApE,+CAAuB,0BAA6C,CAAA;IACjF,CAAC;IAED,CAAC;IAaD;;;OAGG;IACU,wDAAgC,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,wBAAA,IAAI,CAAC,CAAC;IAEjF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,KAAM,SAAQ,wBAAA,gCAAgC;KAAG;IAAjD,6BAAK,QAA4C,CAAA;IAC9D,CAAC;IAED,CAAC;AACF,CAAC,EA9FgB,uBAAuB,KAAvB,uBAAuB,QA8FvC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\nimport {\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\ttype FixRecursiveArraySchema,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype ValidateRecursiveSchema,\n} from \"./simple-tree/index.js\";\nimport type { JsonCompatible } from \"./util/index.js\";\n\nconst sf = new SchemaFactoryAlpha(\"com.fluidframework.serializable\");\n\n/**\n * Utilities for storing {@link FluidSerializableAsTree.Data|Fluid Serializable data} in {@link TreeNode}s.\n *\n * Same as {@link JsonAsTree} except allows {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}s.\n * @remarks\n * Schema which replicate the Fluid Serializable data model with {@link TreeNode}s.\n *\n * Fluid Serializable data can be imported from the {@link FluidSerializableAsTree.Data|Fluid Serializable format} into this format using {@link (TreeAlpha:interface).importConcise} with the {@link FluidSerializableAsTree.(Tree:variable)} schema.\n * @alpha\n */\nexport namespace FluidSerializableAsTree {\n\t/**\n\t * Data which can be serialized by Fluid.\n\t * @remarks\n\t * Can be encoded as a {@link FluidSerializableAsTree.(Tree:type)} using {@link (TreeAlpha:interface).importConcise}.\n\t * @alpha\n\t */\n\texport type Data = JsonCompatible<IFluidHandle>;\n\n\t/**\n\t * {@link AllowedTypes} for any content allowed in the {@link FluidSerializableAsTree} domain.\n\t * @example\n\t * ```typescript\n\t * const tree = TreeAlpha.importConcise(FluidSerializableAsTree.Tree, { example: { nested: true }, value: 5 });\n\t * ```\n\t * @alpha\n\t */\n\texport const Tree = [\n\t\t() => FluidSerializableObject,\n\t\t() => Array,\n\t\t...SchemaFactory.leaves,\n\t] as const;\n\n\t/**\n\t * @alpha\n\t */\n\texport type Tree = TreeNodeFromImplicitAllowedTypes<typeof Tree>;\n\n\t/**\n\t * Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.\n\t * @system @alpha\n\t */\n\texport const _APIExtractorWorkaroundObjectBase = sf.recordRecursive(\"object\", Tree);\n\n\t/**\n\t * Arbitrary Fluid Serializable object as a {@link TreeNode}.\n\t * @remarks\n\t * API of the tree node is more aligned with an es6 map than a JS object using its properties like a map.\n\t * @example\n\t * ```typescript\n\t * // Due to TypeScript restrictions on recursive types, the constructor and be somewhat limiting.\n\t * const fromArray = new JsonAsTreeObject([[\"a\", 0]]);\n\t * // Using `importConcise` can work better for Fluid Serializable data:\n\t * const imported = TreeAlpha.importConcise(FluidSerializableAsTree.Object, { a: 0 });\n\t * // Node API is like a Map:\n\t * const value = imported.get(\"a\");\n\t * ```\n\t * @privateRemarks\n\t * Due to https://github.com/microsoft/TypeScript/issues/61270 this can't be named `Object`.\n\t * @sealed @alpha\n\t */\n\texport class FluidSerializableObject extends _APIExtractorWorkaroundObjectBase {}\n\t{\n\t\ttype _check = ValidateRecursiveSchema<typeof FluidSerializableObject>;\n\t}\n\n\t/**\n\t * D.ts bug workaround, see {@link FixRecursiveArraySchema}.\n\t * @privateRemarks\n\t * In the past this this had to reference the base type (_APIExtractorWorkaroundArrayBase).\n\t * Testing for this in examples/utils/import-testing now shows it has to reference FluidSerializableAsTree.Array instead.\n\t * @system @alpha\n\t */\n\texport declare type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<\n\t\ttypeof Array\n\t>;\n\n\t/**\n\t * Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.\n\t * @system @alpha\n\t */\n\texport const _APIExtractorWorkaroundArrayBase = sf.arrayRecursive(\"array\", Tree);\n\n\t/**\n\t * Arbitrary Fluid Serializable array as a {@link TreeNode}.\n\t * @remarks\n\t * This can be imported using {@link (TreeAlpha:interface).importConcise}.\n\t * @example\n\t * ```typescript\n\t * // Due to TypeScript restrictions on recursive types, the constructor can be somewhat limiting.\n\t * const usingConstructor = new FluidSerializableAsTree.Array([\"a\", 0, new FluidSerializableAsTree.Array([1])]);\n\t * // Using `importConcise` can work better for Fluid Serializable data:\n\t * const imported = TreeAlpha.importConcise(FluidSerializableAsTree.Array, [\"a\", 0, [1]]);\n\t * // Node API is like an Array:\n\t * const inner: FluidSerializableAsTree.Tree = imported[2];\n\t * assert(Tree.is(inner, FluidSerializableAsTree.Array));\n\t * const leaf = inner[0];\n\t * ```\n\t * @sealed @alpha\n\t */\n\texport class Array extends _APIExtractorWorkaroundArrayBase {}\n\t{\n\t\ttype _check = ValidateRecursiveSchema<typeof Array>;\n\t}\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { type ITreePrivate, type SharedTreeOptionsInternal, type SharedTreeOptions, type SharedTreeOptionsBeta, SharedTreeKernel, getBranch, type ForestType, type SharedTreeContentSnapshot, type SharedTreeFormatOptions, SharedTreeFormatVersion, buildConfiguredForest, defaultSharedTreeOptions, type ForestOptions, type ITreeInternal, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, exportSimpleSchema, type SharedTreeKernelView, persistedToSimpleSchema, } from "./sharedTree.js";
|
|
5
|
+
export { type ITreePrivate, type SharedTreeOptionsInternal, type SharedTreeOptions, type SharedTreeOptionsBeta, SharedTreeKernel, getBranch, type ForestType, type SharedTreeContentSnapshot, type SharedTreeFormatOptions, SharedTreeFormatVersion, buildConfiguredForest, defaultSharedTreeOptions, type ForestOptions, type ITreeInternal, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, exportSimpleSchema, type SharedTreeKernelView, persistedToSimpleSchema, getCodecTreeForSharedTreeFormat, } from "./sharedTree.js";
|
|
6
6
|
export { createTreeCheckout, TreeCheckout, type ITreeCheckout, type CheckoutEvents, type ITreeCheckoutFork, type BranchableTree, type TreeBranchFork, } from "./treeCheckout.js";
|
|
7
7
|
export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
8
8
|
export type { ISharedTreeEditor, ISchemaEditor, SharedTreeEditBuilder, } from "./sharedTreeEditBuilder.js";
|
|
@@ -11,4 +11,5 @@ export type { RunTransaction } from "./tree.js";
|
|
|
11
11
|
export { TreeAlpha, type TreeIdentifierUtils, type ObservationResults, } from "./treeAlpha.js";
|
|
12
12
|
export { independentInitializedView, type ViewContent, independentView, } from "./independentView.js";
|
|
13
13
|
export type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|
|
14
|
+
export { getCodecTreeForChangeFormat, type SharedTreeChangeFormatVersion, } from "./sharedTreeChangeCodecs.js";
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,gBAAgB,EAChB,SAAS,EACT,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,gBAAgB,EAChB,SAAS,EACT,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,+BAA+B,GAC/B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE,YAAY,EACX,iBAAiB,EACjB,aAAa,EACb,qBAAqB,GACrB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EACN,SAAS,EACT,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,0BAA0B,EAC1B,KAAK,WAAW,EAChB,eAAe,GACf,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EACN,2BAA2B,EAC3B,KAAK,6BAA6B,GAClC,MAAM,6BAA6B,CAAC"}
|
package/lib/shared-tree/index.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { SharedTreeKernel, getBranch, SharedTreeFormatVersion, buildConfiguredForest, defaultSharedTreeOptions, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, exportSimpleSchema, persistedToSimpleSchema, } from "./sharedTree.js";
|
|
5
|
+
export { SharedTreeKernel, getBranch, SharedTreeFormatVersion, buildConfiguredForest, defaultSharedTreeOptions, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, exportSimpleSchema, persistedToSimpleSchema, getCodecTreeForSharedTreeFormat, } from "./sharedTree.js";
|
|
6
6
|
export { createTreeCheckout, TreeCheckout, } from "./treeCheckout.js";
|
|
7
7
|
export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
8
8
|
export { Tree } from "./tree.js";
|
|
9
9
|
export { TreeAlpha, } from "./treeAlpha.js";
|
|
10
10
|
export { independentInitializedView, independentView, } from "./independentView.js";
|
|
11
|
+
export { getCodecTreeForChangeFormat, } from "./sharedTreeChangeCodecs.js";
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKN,gBAAgB,EAChB,SAAS,EAIT,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EAGxB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAElB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKN,gBAAgB,EAChB,SAAS,EAIT,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EAGxB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAElB,uBAAuB,EACvB,+BAA+B,GAC/B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,kBAAkB,EAClB,YAAY,GAMZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAQvE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EACN,SAAS,GAGT,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,0BAA0B,EAE1B,eAAe,GACf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EACN,2BAA2B,GAE3B,MAAM,6BAA6B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ITreePrivate,\n\ttype SharedTreeOptionsInternal,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsBeta,\n\tSharedTreeKernel,\n\tgetBranch,\n\ttype ForestType,\n\ttype SharedTreeContentSnapshot,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\ttype ForestOptions,\n\ttype ITreeInternal,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n\texportSimpleSchema,\n\ttype SharedTreeKernelView,\n\tpersistedToSimpleSchema,\n\tgetCodecTreeForSharedTreeFormat,\n} from \"./sharedTree.js\";\n\nexport {\n\tcreateTreeCheckout,\n\tTreeCheckout,\n\ttype ITreeCheckout,\n\ttype CheckoutEvents,\n\ttype ITreeCheckoutFork,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n} from \"./treeCheckout.js\";\n\nexport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\n\nexport type {\n\tISharedTreeEditor,\n\tISchemaEditor,\n\tSharedTreeEditBuilder,\n} from \"./sharedTreeEditBuilder.js\";\n\nexport { Tree } from \"./tree.js\";\nexport type { RunTransaction } from \"./tree.js\";\n\nexport {\n\tTreeAlpha,\n\ttype TreeIdentifierUtils,\n\ttype ObservationResults,\n} from \"./treeAlpha.js\";\n\nexport {\n\tindependentInitializedView,\n\ttype ViewContent,\n\tindependentView,\n} from \"./independentView.js\";\n\nexport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\n\nexport {\n\tgetCodecTreeForChangeFormat,\n\ttype SharedTreeChangeFormatVersion,\n} from \"./sharedTreeChangeCodecs.js\";\n"]}
|
|
@@ -7,16 +7,17 @@ import type { IChannelStorageService } from "@fluidframework/datastore-definitio
|
|
|
7
7
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
8
8
|
import type { IChannelView, IFluidSerializer, SharedKernel } from "@fluidframework/shared-object-base/internal";
|
|
9
9
|
import { type ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
10
|
-
import { type CodecWriteOptions, type ICodecOptions } from "../codec/index.js";
|
|
10
|
+
import { type CodecTree, type CodecWriteOptions, type ICodecOptions } from "../codec/index.js";
|
|
11
11
|
import { type FieldKey, type GraphCommit, type IEditableForest, type JsonableTree, type TreeNodeSchemaIdentifier, type TreeStoredSchema, TreeStoredSchemaRepository, type TreeStoredSchemaSubscription } from "../core/index.js";
|
|
12
12
|
import { TreeCompressionStrategy, type TreeCompressionStrategyPrivate } from "../feature-libraries/index.js";
|
|
13
|
-
import { type BranchId, type ClonableSchemaAndPolicy, SharedTreeCore } from "../shared-tree-core/index.js";
|
|
13
|
+
import { type BranchId, type ClonableSchemaAndPolicy, type EditManagerFormatVersion, type MessageFormatVersion, SharedTreeCore } from "../shared-tree-core/index.js";
|
|
14
14
|
import { type ITree, type ImplicitFieldSchema, type ReadSchema, type SimpleTreeSchema, type TreeView, type TreeViewAlpha, type TreeViewConfiguration, type UnsafeUnknownSchema, type VerboseTree, type ITreeAlpha } from "../simple-tree/index.js";
|
|
15
15
|
import { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
16
16
|
import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|
|
17
17
|
import type { SharedTreeEditBuilder } from "./sharedTreeEditBuilder.js";
|
|
18
18
|
import { type TreeCheckout, type BranchableTree } from "./treeCheckout.js";
|
|
19
19
|
import { type Breakable, type JsonCompatible } from "../util/index.js";
|
|
20
|
+
import { type SharedTreeChangeFormatVersion } from "./sharedTreeChangeCodecs.js";
|
|
20
21
|
/**
|
|
21
22
|
* Copy of data from an {@link ITreePrivate} at some point in time.
|
|
22
23
|
* @remarks
|
|
@@ -181,6 +182,21 @@ export declare const SharedTreeFormatVersion: {
|
|
|
181
182
|
* Such an abstraction should probably be in the form of a Fluid-Framework wide compatibility enum.
|
|
182
183
|
*/
|
|
183
184
|
export type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;
|
|
185
|
+
/**
|
|
186
|
+
* Defines for each EditManagerFormatVersion the SharedTreeChangeFormatVersion to use.
|
|
187
|
+
* This is an arbitrary mapping that is injected in the EditManger codec.
|
|
188
|
+
* Once an entry is defined and used in production, it cannot be changed.
|
|
189
|
+
* This is because the format for SharedTree changes are not explicitly versioned.
|
|
190
|
+
*/
|
|
191
|
+
export declare const changeFormatVersionForEditManager: import("../codec/codec.js").MappedDependentFormatVersion<EditManagerFormatVersion, SharedTreeChangeFormatVersion>;
|
|
192
|
+
/**
|
|
193
|
+
* Defines for each MessageFormatVersion the SharedTreeChangeFormatVersion to use.
|
|
194
|
+
* This is an arbitrary mapping that is injected in the message codec.
|
|
195
|
+
* Once an entry is defined and used in production, it cannot be changed.
|
|
196
|
+
* This is because the format for SharedTree changes are not explicitly versioned.
|
|
197
|
+
*/
|
|
198
|
+
export declare const changeFormatVersionForMessage: import("../codec/codec.js").MappedDependentFormatVersion<MessageFormatVersion, SharedTreeChangeFormatVersion>;
|
|
199
|
+
export declare function getCodecTreeForSharedTreeFormat(version: SharedTreeFormatVersion[keyof SharedTreeFormatVersion]): CodecTree;
|
|
184
200
|
/**
|
|
185
201
|
* Configuration options for SharedTree.
|
|
186
202
|
* @beta @input
|