@fluidframework/tree 2.53.1 → 2.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +0 -19
- package/.mocharc.customBenchmarks.cjs +1 -9
- package/CHANGELOG.md +56 -0
- package/api-report/tree.alpha.api.md +50 -36
- package/api-report/tree.beta.api.md +15 -1
- package/api-report/{tree.legacy.alpha.api.md → tree.legacy.beta.api.md} +5 -5
- package/api-report/tree.legacy.public.api.md +1 -1
- package/api-report/tree.public.api.md +1 -1
- package/dist/alpha.d.ts +8 -2
- package/dist/beta.d.ts +3 -0
- package/dist/codec/codec.d.ts +43 -6
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +22 -2
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +4 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/external-utilities/index.d.ts +1 -1
- package/dist/external-utilities/index.d.ts.map +1 -1
- package/dist/external-utilities/index.js +2 -1
- package/dist/external-utilities/index.js.map +1 -1
- package/dist/external-utilities/typeboxValidator.d.ts +6 -1
- package/dist/external-utilities/typeboxValidator.d.ts.map +1 -1
- package/dist/external-utilities/typeboxValidator.js +7 -1
- package/dist/external-utilities/typeboxValidator.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +10 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +28 -5
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +19 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +10 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +59 -4
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +9 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +46 -8
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +91 -16
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +14 -0
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +10 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +8 -3
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +17 -6
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.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.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +3 -0
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +13 -8
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +76 -38
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +178 -0
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +322 -0
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -0
- package/dist/feature-libraries/forest-summary/index.d.ts +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +2 -1
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +2 -1
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +6 -9
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/treeCompressionUtils.d.ts +15 -0
- package/dist/feature-libraries/treeCompressionUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCompressionUtils.js +16 -1
- package/dist/feature-libraries/treeCompressionUtils.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts +1 -1
- package/dist/jsonDomainSchema.d.ts.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +23 -6
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +4 -1
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/tree.d.ts.map +1 -1
- package/dist/shared-tree/tree.js +3 -0
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +9 -11
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +2 -2
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +13 -0
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/sharedTreeAttributes.d.ts +2 -2
- package/dist/sharedTreeAttributes.js +2 -2
- package/dist/sharedTreeAttributes.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/conciseTree.js +1 -1
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +39 -11
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +79 -19
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.d.ts +7 -2
- package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.js +1 -0
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +4 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +9 -6
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +8 -7
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +13 -17
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +21 -25
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +20 -0
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -0
- package/dist/simple-tree/api/schemaFactoryBeta.js +26 -0
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -0
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +0 -2
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +6 -3
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +1 -0
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +68 -74
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +3 -3
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/core/simpleNodeSchemaBase.d.ts +6 -0
- package/dist/simple-tree/core/simpleNodeSchemaBase.d.ts.map +1 -1
- package/dist/simple-tree/core/simpleNodeSchemaBase.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +3 -4
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +0 -3
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +4 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +2 -3
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +12 -0
- 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 +0 -3
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +0 -3
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/tableSchema.d.ts +11 -80
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +200 -117
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts +1 -2
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +1 -2
- package/dist/treeFactory.js.map +1 -1
- package/lib/alpha.d.ts +8 -2
- package/lib/beta.d.ts +3 -0
- package/lib/codec/codec.d.ts +43 -6
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +19 -1
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/external-utilities/index.d.ts +1 -1
- package/lib/external-utilities/index.d.ts.map +1 -1
- package/lib/external-utilities/index.js +1 -1
- package/lib/external-utilities/index.js.map +1 -1
- package/lib/external-utilities/typeboxValidator.d.ts +6 -1
- package/lib/external-utilities/typeboxValidator.d.ts.map +1 -1
- package/lib/external-utilities/typeboxValidator.js +6 -0
- package/lib/external-utilities/typeboxValidator.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +10 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +27 -5
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +19 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +10 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +59 -4
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +10 -3
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +46 -8
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +87 -14
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +14 -0
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +9 -0
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +8 -3
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +18 -7
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.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.map +1 -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/forestSummarizer.d.ts +13 -8
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +75 -37
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +178 -0
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +318 -0
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -0
- package/lib/feature-libraries/forest-summary/index.d.ts +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +1 -1
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +3 -3
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +6 -9
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/treeCompressionUtils.d.ts +15 -0
- package/lib/feature-libraries/treeCompressionUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCompressionUtils.js +15 -0
- package/lib/feature-libraries/treeCompressionUtils.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts +1 -1
- package/lib/jsonDomainSchema.d.ts.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +23 -6
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +4 -1
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/tree.d.ts.map +1 -1
- package/lib/shared-tree/tree.js +3 -0
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +9 -11
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +2 -2
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +13 -0
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/sharedTreeAttributes.d.ts +2 -2
- package/lib/sharedTreeAttributes.js +2 -2
- package/lib/sharedTreeAttributes.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/conciseTree.js +2 -2
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +39 -11
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +79 -19
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/getJsonSchema.d.ts +7 -2
- package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getJsonSchema.js +1 -0
- package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +9 -6
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +6 -6
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +13 -17
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +22 -26
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +20 -0
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -0
- package/lib/simple-tree/api/schemaFactoryBeta.js +22 -0
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -0
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +0 -2
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +6 -3
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +1 -0
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +68 -74
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +4 -4
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/core/simpleNodeSchemaBase.d.ts +6 -0
- package/lib/simple-tree/core/simpleNodeSchemaBase.d.ts.map +1 -1
- package/lib/simple-tree/core/simpleNodeSchemaBase.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +3 -4
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +0 -3
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- 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/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +2 -3
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +12 -0
- 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 +0 -3
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +0 -3
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/tableSchema.d.ts +11 -80
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +201 -118
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts +1 -2
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +1 -2
- package/lib/treeFactory.js.map +1 -1
- package/package.json +21 -21
- package/src/codec/codec.ts +52 -7
- package/src/codec/index.ts +4 -0
- package/src/external-utilities/index.ts +1 -1
- package/src/external-utilities/typeboxValidator.ts +7 -1
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +38 -4
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +10 -3
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +96 -8
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +123 -19
- package/src/feature-libraries/chunked-forest/codec/format.ts +11 -0
- package/src/feature-libraries/chunked-forest/codec/index.ts +4 -0
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +28 -3
- package/src/feature-libraries/chunked-forest/index.ts +2 -0
- package/src/feature-libraries/forest-summary/codec.ts +3 -0
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +118 -50
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +511 -0
- package/src/feature-libraries/forest-summary/index.ts +1 -1
- package/src/feature-libraries/index.ts +5 -1
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +8 -4
- package/src/feature-libraries/treeCompressionUtils.ts +19 -0
- package/src/index.ts +6 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizingTreeView.ts +1 -1
- package/src/shared-tree/sharedTree.ts +37 -4
- package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
- package/src/shared-tree/tree.ts +3 -0
- package/src/shared-tree/treeAlpha.ts +10 -11
- package/src/shared-tree/treeCheckout.ts +2 -2
- package/src/shared-tree-core/sharedTreeCore.ts +17 -0
- package/src/sharedTreeAttributes.ts +2 -2
- package/src/simple-tree/api/conciseTree.ts +2 -1
- package/src/simple-tree/api/customTree.ts +102 -32
- package/src/simple-tree/api/getJsonSchema.ts +7 -2
- package/src/simple-tree/api/index.ts +3 -0
- package/src/simple-tree/api/schemaCreationUtilities.ts +1 -1
- package/src/simple-tree/api/schemaFactory.ts +21 -14
- package/src/simple-tree/api/schemaFactoryAlpha.ts +29 -30
- package/src/simple-tree/api/schemaFactoryBeta.ts +28 -0
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +7 -3
- package/src/simple-tree/api/transactionTypes.ts +1 -0
- package/src/simple-tree/api/tree.ts +75 -81
- package/src/simple-tree/api/verboseTree.ts +42 -39
- package/src/simple-tree/core/simpleNodeSchemaBase.ts +6 -0
- package/src/simple-tree/fieldSchema.ts +3 -4
- package/src/simple-tree/index.ts +3 -0
- package/src/simple-tree/node-kinds/record/recordNode.ts +2 -3
- package/src/simple-tree/simpleSchema.ts +12 -0
- package/src/simple-tree/toStoredSchema.ts +0 -3
- package/src/tableSchema.ts +261 -243
- package/src/treeFactory.ts +1 -2
package/.eslintrc.cjs
CHANGED
|
@@ -89,19 +89,6 @@ module.exports = {
|
|
|
89
89
|
"unicorn/switch-case-braces": "off",
|
|
90
90
|
"unicorn/text-encoding-identifier-case": "off",
|
|
91
91
|
|
|
92
|
-
"@typescript-eslint/no-restricted-imports": [
|
|
93
|
-
"error",
|
|
94
|
-
{
|
|
95
|
-
"patterns": [
|
|
96
|
-
{
|
|
97
|
-
"group": ["./index.js", "**/../index.js"],
|
|
98
|
-
"message":
|
|
99
|
-
"Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead.",
|
|
100
|
-
},
|
|
101
|
-
],
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
|
|
105
92
|
// #endregion
|
|
106
93
|
},
|
|
107
94
|
overrides: [
|
|
@@ -115,12 +102,6 @@ module.exports = {
|
|
|
115
102
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
116
103
|
},
|
|
117
104
|
},
|
|
118
|
-
{
|
|
119
|
-
files: ["src/test/**/*.generated.ts*"],
|
|
120
|
-
rules: {
|
|
121
|
-
"@typescript-eslint/no-restricted-imports": ["off"],
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
105
|
],
|
|
125
106
|
settings: {
|
|
126
107
|
"import/extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx"],
|
|
@@ -13,19 +13,11 @@ const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mochar
|
|
|
13
13
|
const packageDir = __dirname;
|
|
14
14
|
const baseConfig = getFluidTestMochaConfig(packageDir);
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
baseConfig["node-option"] !== undefined
|
|
18
|
-
? Array.isArray(baseConfig["node-option"])
|
|
19
|
-
? baseConfig["node-option"]
|
|
20
|
-
: [baseConfig["node-option"]] // If string, wrap as array to use spread operator
|
|
21
|
-
: []; // If undefined, use an empty array
|
|
22
|
-
|
|
23
|
-
nodeOptions.push("expose-gc", "gc-global", "unhandled-rejections=strict");
|
|
16
|
+
baseConfig["node-option"].push("gc-global");
|
|
24
17
|
|
|
25
18
|
module.exports = {
|
|
26
19
|
...baseConfig,
|
|
27
20
|
"fgrep": ["@CustomBenchmark"],
|
|
28
|
-
"node-option": nodeOptions, // without leading "--"
|
|
29
21
|
"recursive": true,
|
|
30
22
|
"reporter": "@fluid-tools/benchmark/dist/MochaReporter.js",
|
|
31
23
|
"reporterOptions": ["reportDir=.customBenchmarksOutput/"],
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# @fluidframework/tree
|
|
2
2
|
|
|
3
|
+
## 2.60.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- FormatValidator added to replace JsonValidator ([#25311](https://github.com/microsoft/FluidFramework/pull/25311)) [9db6e08ec12](https://github.com/microsoft/FluidFramework/commit/9db6e08ec12973e7cc4f7fe86fecd054bafcd1c0)
|
|
8
|
+
|
|
9
|
+
The existing `@alpha` type [`JsonValidator`](https://fluidframework.com/docs/api/fluid-framework/jsonvalidator-interface) has a new type-erased alternative, `FormatValidator`, which is planned to be stabilized to `@beta` in the future.
|
|
10
|
+
It replaces `JsonValidator` in `ICodecOptions`.
|
|
11
|
+
Existing code using `ICodecOptions` should migrate to use `FormatValidator`, but this is not required for adopting this release as `JsonValidator` is still supported.
|
|
12
|
+
|
|
13
|
+
- Single-node insertion/removal APIs have been removed from TableSchema (alpha) ([#25233](https://github.com/microsoft/FluidFramework/pull/25233)) [99281d2b24e](https://github.com/microsoft/FluidFramework/commit/99281d2b24ec406760c9029aad5aa72a9265a65d)
|
|
14
|
+
|
|
15
|
+
There is a significant performance benefit to inserting / removing rows / columns in batches.
|
|
16
|
+
To help encourage more performant usage patterns, single-node insertion and removal APIs have been removed.
|
|
17
|
+
The APIs that operate on batches should be used instead.
|
|
18
|
+
|
|
19
|
+
Specifically:
|
|
20
|
+
|
|
21
|
+
- `insertColumn`
|
|
22
|
+
- Use `insertColumns` instead
|
|
23
|
+
- `insertRow`
|
|
24
|
+
- Use `insertRows` instead
|
|
25
|
+
- `removeColumn`
|
|
26
|
+
- Use `removeColumns` instead
|
|
27
|
+
- `removeRow`
|
|
28
|
+
- Use `removeRows` instead
|
|
29
|
+
|
|
30
|
+
- Replace "TreeEncodingOptions.useStoredKeys" with "keys" and "KeyEncodingOptions" ([#25263](https://github.com/microsoft/FluidFramework/pull/25263)) [b65f2a86d44](https://github.com/microsoft/FluidFramework/commit/b65f2a86d44d690a675867600a0a7e3c1608a473)
|
|
31
|
+
|
|
32
|
+
The alpha API `TreeEncodingOptions` has had its `useStoredKeys` `boolean` replaced with `keys` that takes a `KeyEncodingOptions` allowing for three options instead of the previous two.
|
|
33
|
+
With the new API, it is now possible to control, for APIs which support it (like [`TreeAlpha.exportVerbose`](https://fluidframework.com/docs/api/fluid-framework/treealpha-interface#exportverbose-methodsignature)), if unknown optional fields will be included when exporting data using stored keys.
|
|
34
|
+
|
|
35
|
+
Additionally, the relevant options interfaces have been marked as `@input`, indicating that more options may be added as optional parameters in the future, and that should be considered non-breaking.
|
|
36
|
+
|
|
37
|
+
- SchemaFactoryAlpha.recordRecursive now supports metadata ([#25289](https://github.com/microsoft/FluidFramework/pull/25289)) [83241702d5f](https://github.com/microsoft/FluidFramework/commit/83241702d5fb5608cfa0add569c7803837abcf82)
|
|
38
|
+
|
|
39
|
+
`SchemaFactoryAlpha.recordRecursive` now support metadata like `SchemaFactoryAlpha.recordAlpha` and the other `TreeNodeSchema` creation methods on `SchemaFactoryAlpha` (except for `SchemaFactoryAlpha.record` which does not support metadata).
|
|
40
|
+
|
|
41
|
+
- Range-based row/column removal methods have been added to TableSchema APIs (alpha) ([#25235](https://github.com/microsoft/FluidFramework/pull/25235)) [c803393cec6](https://github.com/microsoft/FluidFramework/commit/c803393cec6847f4294dc34b4a074ec93baf111c)
|
|
42
|
+
|
|
43
|
+
Adds range-based overloads to `removeColumns` and `removeRows` for removing contiguous ranges of rows and columns.
|
|
44
|
+
|
|
45
|
+
The `removeAllColumns` and `removeAllRows` methods have been removed, as they can be trivially implemented in terms of the new methods.
|
|
46
|
+
|
|
47
|
+
- Hoist runTransaction method from TreeViewAlpha to TreeBranch ([#25280](https://github.com/microsoft/FluidFramework/pull/25280)) [a66b3b77df3](https://github.com/microsoft/FluidFramework/commit/a66b3b77df346d1689ddedcefc16846eda45991a)
|
|
48
|
+
|
|
49
|
+
Transactions are not view-schema-dependent, so it isn't necessary for them to be exclusive to the view type.
|
|
50
|
+
`runTransaction` is now available on `TreeBranch` (alpha).
|
|
51
|
+
`TreeViewAlpha` extends `TreeBranch`, so this change strictly makes the API more accessible.
|
|
52
|
+
|
|
53
|
+
- Add SchemaFactoryBeta ([#25313](https://github.com/microsoft/FluidFramework/pull/25313)) [dca2361d33d](https://github.com/microsoft/FluidFramework/commit/dca2361d33dd959f5d913cbb59601685f85ff6f0)
|
|
54
|
+
|
|
55
|
+
`SchemaFactoryBeta` is added to provide a place to partially stabilize APIs from [`SchemaFactoryAlpha`](https://fluidframework.com/docs/api/fluid-framework/schemafactoryalpha-class).
|
|
56
|
+
Initially just one APIs is added as `@beta`: `scopedFactory`.
|
|
57
|
+
Users of the existing `@alpha` `scopedFactory` API on `SchemaFactoryAlpha` will need to update to use `scopedFactoryAlpha` if they require the returned factory to be a `SchemaFactoryAlpha` instance.
|
|
58
|
+
|
|
3
59
|
## 2.53.0
|
|
4
60
|
|
|
5
61
|
### Minor Changes
|
|
@@ -216,6 +216,7 @@ export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends
|
|
|
216
216
|
// (undocumented)
|
|
217
217
|
readonly annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes;
|
|
218
218
|
get annotatedAllowedTypesNormalized(): NormalizedAnnotatedAllowedTypes;
|
|
219
|
+
// (undocumented)
|
|
219
220
|
get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined;
|
|
220
221
|
}
|
|
221
222
|
|
|
@@ -251,12 +252,12 @@ export enum FluidClientVersion {
|
|
|
251
252
|
v2_52 = 2.052
|
|
252
253
|
}
|
|
253
254
|
|
|
254
|
-
// @
|
|
255
|
+
// @beta @input
|
|
255
256
|
export interface ForestOptions {
|
|
256
257
|
readonly forest?: ForestType;
|
|
257
258
|
}
|
|
258
259
|
|
|
259
|
-
// @
|
|
260
|
+
// @beta @sealed
|
|
260
261
|
export interface ForestType extends ErasedType_2<"ForestType"> {
|
|
261
262
|
}
|
|
262
263
|
|
|
@@ -269,6 +270,16 @@ export const ForestTypeOptimized: ForestType;
|
|
|
269
270
|
// @alpha
|
|
270
271
|
export const ForestTypeReference: ForestType;
|
|
271
272
|
|
|
273
|
+
// @alpha @sealed
|
|
274
|
+
export interface FormatValidator extends ErasedType_2<"FormatValidator"> {
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// @alpha
|
|
278
|
+
export const FormatValidatorBasic: FormatValidator_2;
|
|
279
|
+
|
|
280
|
+
// @alpha
|
|
281
|
+
export const FormatValidatorNoOp: FormatValidator;
|
|
282
|
+
|
|
272
283
|
// @alpha
|
|
273
284
|
export function generateSchemaFromSimpleSchema(simple: SimpleTreeSchema): TreeSchema;
|
|
274
285
|
|
|
@@ -289,7 +300,7 @@ export type HandleConverter<TCustom> = (data: IFluidHandle) => TCustom;
|
|
|
289
300
|
|
|
290
301
|
// @alpha @input
|
|
291
302
|
export interface ICodecOptions {
|
|
292
|
-
readonly jsonValidator: JsonValidator;
|
|
303
|
+
readonly jsonValidator: JsonValidator | FormatValidator;
|
|
293
304
|
}
|
|
294
305
|
|
|
295
306
|
// @alpha
|
|
@@ -433,7 +444,7 @@ export namespace JsonAsTree {
|
|
|
433
444
|
const // @system
|
|
434
445
|
_APIExtractorWorkaroundObjectBase: TreeNodeSchemaClass<"com.fluidframework.json.object", NodeKind.Record, TreeRecordNodeUnsafe<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
446
|
readonly [x: string]: string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null;
|
|
436
|
-
}, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>;
|
|
447
|
+
}, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined, unknown>;
|
|
437
448
|
export type Primitive = TreeNodeFromImplicitAllowedTypes<typeof Primitive>;
|
|
438
449
|
// @system
|
|
439
450
|
export type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<typeof Array>;
|
|
@@ -529,6 +540,13 @@ export interface JsonValidator {
|
|
|
529
540
|
compile<Schema extends TSchema>(schema: Schema): SchemaValidationFunction<Schema>;
|
|
530
541
|
}
|
|
531
542
|
|
|
543
|
+
// @alpha @input
|
|
544
|
+
export enum KeyEncodingOptions {
|
|
545
|
+
allStoredKeys = "allStoredKeys",
|
|
546
|
+
knownStoredKeys = "knownStoredKeys",
|
|
547
|
+
usePropertyKeys = "usePropertyKeys"
|
|
548
|
+
}
|
|
549
|
+
|
|
532
550
|
// @public
|
|
533
551
|
export type LazyItem<Item = unknown> = Item | (() => Item);
|
|
534
552
|
|
|
@@ -610,12 +628,12 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
|
610
628
|
readonly description?: string | undefined;
|
|
611
629
|
}
|
|
612
630
|
|
|
613
|
-
// @public @
|
|
631
|
+
// @public @input
|
|
614
632
|
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
615
633
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
616
634
|
}
|
|
617
635
|
|
|
618
|
-
// @alpha
|
|
636
|
+
// @alpha @input
|
|
619
637
|
export interface NodeSchemaOptionsAlpha<out TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
|
|
620
638
|
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
621
639
|
}
|
|
@@ -748,7 +766,7 @@ export interface RunTransaction {
|
|
|
748
766
|
readonly rollback: typeof rollback;
|
|
749
767
|
}
|
|
750
768
|
|
|
751
|
-
// @alpha
|
|
769
|
+
// @alpha @input
|
|
752
770
|
export interface RunTransactionParams {
|
|
753
771
|
readonly preconditions?: readonly TransactionConstraint[];
|
|
754
772
|
}
|
|
@@ -808,7 +826,7 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
808
826
|
}
|
|
809
827
|
|
|
810
828
|
// @alpha
|
|
811
|
-
export class SchemaFactoryAlpha<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends
|
|
829
|
+
export class SchemaFactoryAlpha<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactoryBeta<TScope, TName> {
|
|
812
830
|
arrayAlpha<const Name extends TName, const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): ArrayNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
813
831
|
arrayRecursive<const Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): ArrayNodeCustomizableSchemaUnsafe<ScopedSchemaName<TScope, Name>, T, TCustomMetadata>;
|
|
814
832
|
static readonly identifier: <const TCustomMetadata = unknown>(props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Identifier, LeafSchema<"string", string> & SimpleLeafNodeSchema, TCustomMetadata>;
|
|
@@ -833,9 +851,9 @@ export class SchemaFactoryAlpha<out TScope extends string | undefined = string |
|
|
|
833
851
|
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>;
|
|
834
852
|
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>;
|
|
835
853
|
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>;
|
|
836
|
-
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>, {
|
|
854
|
+
recordRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Record, TreeRecordNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Record, unknown>, {
|
|
837
855
|
readonly [x: string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
|
|
838
|
-
}, false, T, undefined>;
|
|
856
|
+
}, false, T, undefined, TCustomMetadata>;
|
|
839
857
|
static readonly required: {
|
|
840
858
|
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined): FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata>;
|
|
841
859
|
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldPropsAlpha<TCustomMetadata_1>, "defaultProvider"> | undefined): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T_1>, TCustomMetadata_1>;
|
|
@@ -846,14 +864,19 @@ export class SchemaFactoryAlpha<out TScope extends string | undefined = string |
|
|
|
846
864
|
};
|
|
847
865
|
static readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata>;
|
|
848
866
|
readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata>;
|
|
849
|
-
|
|
867
|
+
scopedFactoryAlpha<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryAlpha<ScopedSchemaName<TScope, T>, TNameInner>;
|
|
850
868
|
static staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
|
|
851
869
|
staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
|
|
852
870
|
}
|
|
853
871
|
|
|
854
|
-
// @
|
|
872
|
+
// @beta
|
|
873
|
+
export class SchemaFactoryBeta<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactory<TScope, TName> {
|
|
874
|
+
scopedFactory<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryBeta<ScopedSchemaName<TScope, T>, TNameInner>;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
// @alpha @input
|
|
855
878
|
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends NodeSchemaOptionsAlpha<TCustomMetadata> {
|
|
856
|
-
allowUnknownOptionalFields?: boolean;
|
|
879
|
+
readonly allowUnknownOptionalFields?: boolean;
|
|
857
880
|
}
|
|
858
881
|
|
|
859
882
|
// @public @sealed @system
|
|
@@ -895,7 +918,7 @@ export interface SchemaValidationFunction<Schema extends TSchema> {
|
|
|
895
918
|
// @public @system
|
|
896
919
|
type ScopedSchemaName<TScope extends string | undefined, TName extends number | string> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;
|
|
897
920
|
|
|
898
|
-
// @alpha
|
|
921
|
+
// @alpha @input
|
|
899
922
|
export interface SharedTreeFormatOptions {
|
|
900
923
|
formatVersion: SharedTreeFormatVersion[keyof SharedTreeFormatVersion];
|
|
901
924
|
treeEncodeType: TreeCompressionStrategy;
|
|
@@ -1150,18 +1173,10 @@ export namespace TableSchema {
|
|
|
1150
1173
|
export function column<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitAnnotatedFieldSchema>(params: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {
|
|
1151
1174
|
readonly props: TProps;
|
|
1152
1175
|
}): System_TableSchema.ColumnSchemaBase<TScope, TCell, TProps>;
|
|
1153
|
-
export interface InsertColumnParameters<TColumn extends ImplicitAllowedTypes> {
|
|
1154
|
-
readonly column: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>;
|
|
1155
|
-
readonly index?: number | undefined;
|
|
1156
|
-
}
|
|
1157
1176
|
export interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
|
|
1158
1177
|
readonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
1159
1178
|
readonly index?: number | undefined;
|
|
1160
1179
|
}
|
|
1161
|
-
export interface InsertRowParameters<TRow extends ImplicitAllowedTypes> {
|
|
1162
|
-
readonly index?: number | undefined;
|
|
1163
|
-
readonly row: InsertableTreeNodeFromImplicitAllowedTypes<TRow>;
|
|
1164
|
-
}
|
|
1165
1180
|
export interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
|
|
1166
1181
|
readonly index?: number | undefined;
|
|
1167
1182
|
readonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
@@ -1196,17 +1211,13 @@ export namespace TableSchema {
|
|
|
1196
1211
|
getCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
1197
1212
|
getColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
|
|
1198
1213
|
getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
|
|
1199
|
-
insertColumn(params: InsertColumnParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>;
|
|
1200
1214
|
insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
1201
|
-
insertRow(params: InsertRowParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>;
|
|
1202
1215
|
insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
1203
|
-
removeAllColumns(): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
1204
|
-
removeAllRows(): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
1205
1216
|
removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
1206
|
-
|
|
1217
|
+
removeColumns(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
1207
1218
|
removeColumns(columns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
1208
1219
|
removeColumns(columns: readonly string[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
1209
|
-
|
|
1220
|
+
removeRows(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
1210
1221
|
removeRows(rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
1211
1222
|
removeRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
1212
1223
|
readonly rows: TreeArrayNode<TRow>;
|
|
@@ -1283,7 +1294,7 @@ export interface TreeAlpha {
|
|
|
1283
1294
|
idCompressor?: IIdCompressor;
|
|
1284
1295
|
} & ICodecOptions): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
1285
1296
|
importConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(schema: UnsafeUnknownSchema extends TSchema ? ImplicitFieldSchema : TSchema & ImplicitFieldSchema, data: ConciseTree | undefined): Unhydrated<TSchema extends ImplicitFieldSchema ? TreeFieldFromImplicitField<TSchema> : TreeNode | TreeLeafValue | undefined>;
|
|
1286
|
-
importVerbose<const TSchema extends ImplicitFieldSchema>(schema: TSchema, data: VerboseTree | undefined, options?:
|
|
1297
|
+
importVerbose<const TSchema extends ImplicitFieldSchema>(schema: TSchema, data: VerboseTree | undefined, options?: TreeParsingOptions): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
1287
1298
|
key2(node: TreeNode): string | number | undefined;
|
|
1288
1299
|
}
|
|
1289
1300
|
|
|
@@ -1334,6 +1345,8 @@ export interface TreeBranch extends IDisposable {
|
|
|
1334
1345
|
hasRootSchema<TSchema extends ImplicitFieldSchema>(schema: TSchema): this is TreeViewAlpha<TSchema>;
|
|
1335
1346
|
merge(branch: TreeBranch, disposeMerged?: boolean): void;
|
|
1336
1347
|
rebaseOnto(branch: TreeBranch): void;
|
|
1348
|
+
runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>, params?: RunTransactionParams): TransactionResultExt<TSuccessValue, TFailureValue>;
|
|
1349
|
+
runTransaction(transaction: () => VoidTransactionCallbackStatus | void, params?: RunTransactionParams): TransactionResult;
|
|
1337
1350
|
}
|
|
1338
1351
|
|
|
1339
1352
|
// @alpha @sealed
|
|
@@ -1364,9 +1377,9 @@ export enum TreeCompressionStrategy {
|
|
|
1364
1377
|
Uncompressed = 1
|
|
1365
1378
|
}
|
|
1366
1379
|
|
|
1367
|
-
// @alpha
|
|
1368
|
-
export interface TreeEncodingOptions {
|
|
1369
|
-
readonly
|
|
1380
|
+
// @alpha @input
|
|
1381
|
+
export interface TreeEncodingOptions<TKeyOptions = KeyEncodingOptions> {
|
|
1382
|
+
readonly keys?: TKeyOptions;
|
|
1370
1383
|
}
|
|
1371
1384
|
|
|
1372
1385
|
// @public
|
|
@@ -1460,6 +1473,9 @@ export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends No
|
|
|
1460
1473
|
// @public
|
|
1461
1474
|
export type TreeObjectNode<T extends RestrictiveStringRecord<ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object, T>;
|
|
1462
1475
|
|
|
1476
|
+
// @alpha @input
|
|
1477
|
+
export type TreeParsingOptions = TreeEncodingOptions<KeyEncodingOptions.usePropertyKeys | KeyEncodingOptions.knownStoredKeys>;
|
|
1478
|
+
|
|
1463
1479
|
// @alpha
|
|
1464
1480
|
export interface TreeRecordNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends TreeNode, Record<string, TreeNodeFromImplicitAllowedTypes<TAllowedTypes>> {
|
|
1465
1481
|
[Symbol.iterator](): IterableIterator<[
|
|
@@ -1483,8 +1499,8 @@ export interface TreeSchema extends SimpleTreeSchema {
|
|
|
1483
1499
|
readonly root: FieldSchemaAlpha;
|
|
1484
1500
|
}
|
|
1485
1501
|
|
|
1486
|
-
// @alpha
|
|
1487
|
-
export interface TreeSchemaEncodingOptions extends
|
|
1502
|
+
// @alpha @input
|
|
1503
|
+
export interface TreeSchemaEncodingOptions extends TreeParsingOptions {
|
|
1488
1504
|
readonly requireFieldsWithDefaults?: boolean;
|
|
1489
1505
|
}
|
|
1490
1506
|
|
|
@@ -1518,8 +1534,6 @@ export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | Unsa
|
|
|
1518
1534
|
// (undocumented)
|
|
1519
1535
|
get root(): ReadableField<TSchema>;
|
|
1520
1536
|
set root(newRoot: InsertableField<TSchema>);
|
|
1521
|
-
runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>, params?: RunTransactionParams): TransactionResultExt<TSuccessValue, TFailureValue>;
|
|
1522
|
-
runTransaction(transaction: () => VoidTransactionCallbackStatus | void, params?: RunTransactionParams): TransactionResult;
|
|
1523
1537
|
}
|
|
1524
1538
|
|
|
1525
1539
|
// @public @sealed
|
|
@@ -112,6 +112,15 @@ type FlexList<Item = unknown> = readonly LazyItem<Item>[];
|
|
|
112
112
|
// @public @system
|
|
113
113
|
type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
|
|
114
114
|
|
|
115
|
+
// @beta @input
|
|
116
|
+
export interface ForestOptions {
|
|
117
|
+
readonly forest?: ForestType;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// @beta @sealed
|
|
121
|
+
export interface ForestType extends ErasedType_2<"ForestType"> {
|
|
122
|
+
}
|
|
123
|
+
|
|
115
124
|
// @public
|
|
116
125
|
export type ImplicitAllowedTypes = AllowedTypes | TreeNodeSchema;
|
|
117
126
|
|
|
@@ -252,7 +261,7 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
|
252
261
|
readonly description?: string | undefined;
|
|
253
262
|
}
|
|
254
263
|
|
|
255
|
-
// @public @
|
|
264
|
+
// @public @input
|
|
256
265
|
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
257
266
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
258
267
|
}
|
|
@@ -375,6 +384,11 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
375
384
|
static readonly string: LeafSchema<"string", string>;
|
|
376
385
|
}
|
|
377
386
|
|
|
387
|
+
// @beta
|
|
388
|
+
export class SchemaFactoryBeta<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactory<TScope, TName> {
|
|
389
|
+
scopedFactory<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryBeta<ScopedSchemaName<TScope, T>, TNameInner>;
|
|
390
|
+
}
|
|
391
|
+
|
|
378
392
|
// @public @sealed @system
|
|
379
393
|
export interface SchemaStatics {
|
|
380
394
|
readonly boolean: LeafSchema<"boolean", boolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
##
|
|
1
|
+
## Beta API Report File for "@fluidframework/tree"
|
|
2
2
|
|
|
3
3
|
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
4
|
|
|
@@ -225,7 +225,7 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
|
225
225
|
readonly description?: string | undefined;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
// @public @
|
|
228
|
+
// @public @input
|
|
229
229
|
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
230
230
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
231
231
|
}
|
|
@@ -368,13 +368,13 @@ export interface SchemaStatics {
|
|
|
368
368
|
// @public @system
|
|
369
369
|
type ScopedSchemaName<TScope extends string | undefined, TName extends number | string> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;
|
|
370
370
|
|
|
371
|
-
// @
|
|
371
|
+
// @beta @legacy
|
|
372
372
|
export const SharedTree: ISharedObjectKind<ITree> & SharedObjectKind<ITree>;
|
|
373
373
|
|
|
374
|
-
// @
|
|
374
|
+
// @beta @legacy
|
|
375
375
|
export const SharedTreeAttributes: IChannelAttributes;
|
|
376
376
|
|
|
377
|
-
// @
|
|
377
|
+
// @beta @legacy
|
|
378
378
|
export const SharedTreeFactoryType = "https://graph.microsoft.com/types/tree";
|
|
379
379
|
|
|
380
380
|
// @public @sealed @system
|
|
@@ -225,7 +225,7 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
|
225
225
|
readonly description?: string | undefined;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
// @public @
|
|
228
|
+
// @public @input
|
|
229
229
|
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
230
230
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
231
231
|
}
|
|
@@ -225,7 +225,7 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
|
225
225
|
readonly description?: string | undefined;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
// @public @
|
|
228
|
+
// @public @input
|
|
229
229
|
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
230
230
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
231
231
|
}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -89,8 +89,11 @@ export {
|
|
|
89
89
|
typeSchemaSymbol,
|
|
90
90
|
|
|
91
91
|
// @beta APIs
|
|
92
|
+
ForestOptions,
|
|
93
|
+
ForestType,
|
|
92
94
|
NodeChangedData,
|
|
93
95
|
PopUnion,
|
|
96
|
+
SchemaFactoryBeta,
|
|
94
97
|
TreeBeta,
|
|
95
98
|
TreeChangeEventsBeta,
|
|
96
99
|
UnionToTuple,
|
|
@@ -117,11 +120,12 @@ export {
|
|
|
117
120
|
FieldSchemaAlphaUnsafe,
|
|
118
121
|
FixRecursiveArraySchema,
|
|
119
122
|
FluidClientVersion,
|
|
120
|
-
ForestOptions,
|
|
121
|
-
ForestType,
|
|
122
123
|
ForestTypeExpensiveDebug,
|
|
123
124
|
ForestTypeOptimized,
|
|
124
125
|
ForestTypeReference,
|
|
126
|
+
FormatValidator,
|
|
127
|
+
FormatValidatorBasic,
|
|
128
|
+
FormatValidatorNoOp,
|
|
125
129
|
HandleConverter,
|
|
126
130
|
ICodecOptions,
|
|
127
131
|
ITreeAlpha,
|
|
@@ -153,6 +157,7 @@ export {
|
|
|
153
157
|
JsonStringKeyPatternProperties,
|
|
154
158
|
JsonTreeSchema,
|
|
155
159
|
JsonValidator,
|
|
160
|
+
KeyEncodingOptions,
|
|
156
161
|
MapNodeCustomizableSchema,
|
|
157
162
|
MapNodeCustomizableSchemaUnsafe,
|
|
158
163
|
MapNodePojoEmulationSchema,
|
|
@@ -205,6 +210,7 @@ export {
|
|
|
205
210
|
TreeIndex,
|
|
206
211
|
TreeIndexKey,
|
|
207
212
|
TreeIndexNodes,
|
|
213
|
+
TreeParsingOptions,
|
|
208
214
|
TreeRecordNode,
|
|
209
215
|
TreeRecordNodeUnsafe,
|
|
210
216
|
TreeSchema,
|
package/dist/beta.d.ts
CHANGED
package/dist/codec/codec.d.ts
CHANGED
|
@@ -2,6 +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 { ErasedType } from "@fluidframework/core-interfaces/internal";
|
|
5
6
|
import { IsoBuffer } from "@fluid-internal/client-utils";
|
|
6
7
|
import type { Static, TAnySchema, TSchema } from "@sinclair/typebox";
|
|
7
8
|
import type { ChangeEncodingContext } from "../core/index.js";
|
|
@@ -37,6 +38,39 @@ export interface SchemaValidationFunction<Schema extends TSchema> {
|
|
|
37
38
|
*/
|
|
38
39
|
check(data: unknown): data is Static<Schema>;
|
|
39
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* A kind of validator for SharedTree's internal data formats.
|
|
43
|
+
* @remarks
|
|
44
|
+
* Assuming no data corruption or type confusion, such validation should never fail.
|
|
45
|
+
* Any client version compatibility issues should instead be detected by the data format versioning which Shared Tree does internally independent of data format validation.
|
|
46
|
+
* However, persisted data can sometimes be corrupted, bugs can produce invalid data, or users can mix up which data is compatible with which APIs.
|
|
47
|
+
* In such cases, a format validator can help catch issues.
|
|
48
|
+
*
|
|
49
|
+
* Current options are {@link FormatValidatorNoOp} and {@link FormatValidatorBasic}.
|
|
50
|
+
* @privateRemarks
|
|
51
|
+
* Implement using {@link toFormatValidator}.
|
|
52
|
+
* Consume using {@link extractJsonValidator}.
|
|
53
|
+
*
|
|
54
|
+
* Exposing this as the stable API entry point (instead of {@link JsonValidator}) means that we avoid leaking the reference to TypeBox to the API surface.
|
|
55
|
+
* Additionally, if we adopt non JSON formats, we can just update the validators as needed without breaking the API.
|
|
56
|
+
* This also allows us to avoid stabilizing or documenting how handles interact with JSON validation since that is not exposed through this type.
|
|
57
|
+
* @sealed @alpha
|
|
58
|
+
*/
|
|
59
|
+
export interface FormatValidator extends ErasedType<"FormatValidator"> {
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A {@link FormatValidator} which does no validation.
|
|
63
|
+
* @alpha
|
|
64
|
+
*/
|
|
65
|
+
export declare const FormatValidatorNoOp: FormatValidator;
|
|
66
|
+
/**
|
|
67
|
+
* Type erase a {@link JsonValidator} to a {@link FormatValidator}.
|
|
68
|
+
*/
|
|
69
|
+
export declare function toFormatValidator(factory: JsonValidator): FormatValidator;
|
|
70
|
+
/**
|
|
71
|
+
* Un-type-erase the {@link FormatValidator}.
|
|
72
|
+
*/
|
|
73
|
+
export declare function extractJsonValidator(input: FormatValidator | JsonValidator): JsonValidator;
|
|
40
74
|
/**
|
|
41
75
|
* JSON schema validator compliant with draft 6 schema. See https://json-schema.org.
|
|
42
76
|
* @alpha @input
|
|
@@ -61,19 +95,22 @@ export interface JsonValidator {
|
|
|
61
95
|
*/
|
|
62
96
|
export interface ICodecOptions {
|
|
63
97
|
/**
|
|
64
|
-
* {@link
|
|
98
|
+
* {@link FormatValidator} which SharedTree uses to validate persisted data it reads & writes
|
|
65
99
|
* matches the expected encoded format (i.e. the wire format for ops and summaries).
|
|
66
|
-
*
|
|
67
|
-
* See {@link
|
|
100
|
+
* @remarks
|
|
101
|
+
* See {@link FormatValidatorNoOp} and {@link FormatValidatorBasic} for out-of-the-box implementations.
|
|
68
102
|
*
|
|
69
103
|
* This option is not "on-by-default" because JSON schema validation comes with a small but noticeable
|
|
70
104
|
* runtime performance cost, and popular schema validation libraries have relatively large bundle size.
|
|
71
105
|
*
|
|
72
|
-
* SharedTree users are still encouraged to use a non-trivial validator (i.e. not `
|
|
106
|
+
* SharedTree users are still encouraged to use a non-trivial validator (i.e. not `FormatValidatorNoOp`)
|
|
73
107
|
* whenever reasonable: it gives better fail-fast behavior when unexpected encoded data is found,
|
|
74
108
|
* which reduces the risk of unrecoverable data corruption.
|
|
109
|
+
*
|
|
110
|
+
* Use of {@link JsonValidator} here is deprecated and will be removed:
|
|
111
|
+
* it is recommended to use {@link FormatValidator} instead.
|
|
75
112
|
*/
|
|
76
|
-
readonly jsonValidator: JsonValidator;
|
|
113
|
+
readonly jsonValidator: JsonValidator | FormatValidator;
|
|
77
114
|
}
|
|
78
115
|
/**
|
|
79
116
|
* Options relating to encoding of persisted data.
|
|
@@ -199,7 +236,7 @@ export declare const unitCodec: IMultiFormatCodec<0, JsonCompatibleReadOnly, Jso
|
|
|
199
236
|
* Wraps a codec with JSON schema validation for its encoded type.
|
|
200
237
|
* @returns An {@link IJsonCodec} which validates the data it encodes and decodes matches the provided schema.
|
|
201
238
|
*/
|
|
202
|
-
export declare function withSchemaValidation<TInMemoryFormat, EncodedSchema extends TSchema, TEncodedFormat = JsonCompatibleReadOnly, TValidate = TEncodedFormat, TContext = ChangeEncodingContext>(schema: EncodedSchema, codec: IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext>, validator?: JsonValidator): IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext>;
|
|
239
|
+
export declare function withSchemaValidation<TInMemoryFormat, EncodedSchema extends TSchema, TEncodedFormat = JsonCompatibleReadOnly, TValidate = TEncodedFormat, TContext = ChangeEncodingContext>(schema: EncodedSchema, codec: IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext>, validator?: JsonValidator | FormatValidator): IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext>;
|
|
203
240
|
/**
|
|
204
241
|
* Versions of Fluid Framework client packages.
|
|
205
242
|
* @remarks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/codec/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAkB,MAAM,8BAA8B,CAAC;AAEzE,OAAO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