@fluidframework/tree 2.71.0 → 2.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -40
- package/api-report/tree.alpha.api.md +27 -18
- package/api-report/tree.beta.api.md +42 -0
- package/api-report/tree.legacy.beta.api.md +42 -0
- package/dist/alpha.d.ts +9 -7
- package/dist/api.js +1 -1
- package/dist/api.js.map +1 -1
- package/dist/beta.d.ts +7 -0
- package/dist/codec/codec.d.ts +16 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +16 -3
- package/dist/codec/codec.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -2
- 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 +2 -2
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +6 -6
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +6 -7
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +29 -8
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +8 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
- package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.js +3 -3
- package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -1
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/external-utilities/typeboxValidator.js +1 -1
- package/dist/external-utilities/typeboxValidator.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +12 -8
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +8 -3
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +9 -4
- 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 +1 -2
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.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 +1 -2
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -9
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +3 -21
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +4 -5
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +15 -4
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts +8 -1
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +8 -3
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
- 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 +3 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +2 -2
- package/dist/feature-libraries/index.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.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +5 -4
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +10 -10
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +22 -18
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
- package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -2
- package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +7 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +22 -15
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +12 -16
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +87 -127
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +7 -6
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +12 -11
- package/dist/shared-tree/sharedTreeChangeCodecs.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/treeAlpha.d.ts +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +4 -2
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +1 -3
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +19 -6
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +35 -17
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +37 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +43 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -4
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.js +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +5 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +11 -3
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts +2 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV5.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +19 -6
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +38 -21
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +50 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -0
- package/dist/shared-tree-core/messageFormat.js +51 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -8
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +3 -3
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +2 -2
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +3 -2
- 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/schemaFactoryAlpha.d.ts +2 -98
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -52
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js +61 -7
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +6 -3
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
- package/dist/simple-tree/api/simpleSchemaCodec.js +292 -0
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -0
- package/dist/simple-tree/api/storedSchema.d.ts +2 -2
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +8 -6
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +2 -2
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +6 -6
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +78 -35
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +3 -3
- package/dist/simple-tree/core/allowedTypes.js +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/treeNode.js +1 -1
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +4 -0
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +2 -2
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +2 -2
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +11 -3
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
- package/dist/simple-tree/simpleSchemaFormatV1.js +115 -0
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -0
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +1 -1
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts +3 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +26 -2
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/brand.d.ts +31 -2
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +28 -2
- package/dist/util/brand.js.map +1 -1
- package/dist/util/brandedMap.d.ts +3 -1
- package/dist/util/brandedMap.d.ts.map +1 -1
- package/dist/util/brandedMap.js.map +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +3 -2
- package/dist/util/index.js.map +1 -1
- package/lib/alpha.d.ts +9 -7
- package/lib/api.js +2 -2
- package/lib/api.js.map +1 -1
- package/lib/beta.d.ts +7 -0
- package/lib/codec/codec.d.ts +16 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +16 -3
- package/lib/codec/codec.js.map +1 -1
- package/lib/core/index.d.ts +1 -1
- 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 +1 -1
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +6 -6
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +6 -7
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -2
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +29 -8
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js +7 -0
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV1.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -1
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/external-utilities/typeboxValidator.js +1 -1
- package/lib/external-utilities/typeboxValidator.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +13 -8
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +8 -3
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +8 -3
- 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 +2 -2
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.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 +1 -9
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +2 -20
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +4 -5
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +16 -5
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +8 -1
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +7 -2
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
- 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 +3 -3
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +2 -2
- package/lib/feature-libraries/index.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.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -5
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +10 -10
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +24 -20
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
- package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.js +2 -2
- package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -2
- package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.js +2 -2
- package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +7 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +11 -4
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +12 -16
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +90 -130
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +7 -6
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +7 -6
- package/lib/shared-tree/sharedTreeChangeCodecs.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/treeAlpha.d.ts +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +5 -3
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +1 -3
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +19 -6
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +32 -16
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +37 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +42 -0
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +5 -5
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV5.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV5.js +2 -2
- package/lib/shared-tree-core/editManagerFormatV5.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +5 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +4 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts +2 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV5.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +19 -6
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +35 -20
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +50 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -0
- package/lib/shared-tree-core/messageFormat.js +48 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -8
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +3 -3
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +2 -2
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -52
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js +58 -4
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +6 -3
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
- package/lib/simple-tree/api/simpleSchemaCodec.js +264 -0
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -0
- package/lib/simple-tree/api/storedSchema.d.ts +2 -2
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +5 -3
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +2 -2
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +6 -6
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +75 -34
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +3 -3
- package/lib/simple-tree/core/allowedTypes.js +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/treeNode.js +1 -1
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -0
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +2 -2
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +3 -3
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +11 -3
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
- package/lib/simple-tree/simpleSchemaFormatV1.js +112 -0
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -0
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +1 -1
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts +3 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +23 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/brand.d.ts +31 -2
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +26 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/brandedMap.d.ts +3 -1
- package/lib/util/brandedMap.d.ts.map +1 -1
- package/lib/util/brandedMap.js.map +1 -1
- package/lib/util/index.d.ts +1 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/index.js.map +1 -1
- package/package.json +24 -24
- package/src/api.ts +2 -2
- package/src/codec/codec.ts +17 -3
- package/src/core/index.ts +1 -2
- package/src/core/schema-stored/index.ts +1 -2
- package/src/core/schema-stored/schema.ts +10 -7
- package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
- package/src/core/tree/detachedFieldIndexCodecV1.ts +4 -2
- package/src/core/tree/detachedFieldIndexCodecV2.ts +4 -6
- package/src/core/tree/detachedFieldIndexCodecs.ts +33 -11
- package/src/core/tree/detachedFieldIndexFormatCommon.ts +17 -2
- package/src/core/tree/detachedFieldIndexFormatV1.ts +6 -4
- package/src/core/tree/detachedFieldIndexFormatV2.ts +6 -4
- package/src/core/tree/index.ts +2 -4
- package/src/external-utilities/typeboxValidator.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +18 -13
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/format.ts +15 -4
- package/src/feature-libraries/chunked-forest/codec/index.ts +4 -2
- package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +2 -2
- package/src/feature-libraries/chunked-forest/index.ts +0 -1
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +2 -29
- package/src/feature-libraries/forest-summary/codec.ts +24 -9
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
- package/src/feature-libraries/forest-summary/format.ts +12 -2
- package/src/feature-libraries/forest-summary/index.ts +2 -1
- package/src/feature-libraries/index.ts +1 -2
- package/src/feature-libraries/schema-edits/index.ts +0 -1
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +16 -16
- package/src/feature-libraries/schema-index/codec.ts +34 -22
- package/src/feature-libraries/schema-index/formatV1.ts +2 -2
- package/src/feature-libraries/schema-index/formatV2.ts +2 -2
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +2 -1
- package/src/index.ts +3 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +16 -5
- package/src/shared-tree/sharedTree.ts +112 -172
- package/src/shared-tree/sharedTreeChangeCodecs.ts +15 -9
- package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
- package/src/shared-tree/treeAlpha.ts +6 -5
- package/src/shared-tree/treeCheckout.ts +1 -3
- package/src/shared-tree-core/editManagerCodecs.ts +56 -19
- package/src/shared-tree-core/editManagerFormatCommons.ts +47 -0
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +10 -5
- package/src/shared-tree-core/editManagerFormatV5.ts +3 -3
- package/src/shared-tree-core/index.ts +11 -5
- package/src/shared-tree-core/messageCodecV1ToV4.ts +6 -1
- package/src/shared-tree-core/messageCodecV5.ts +2 -1
- package/src/shared-tree-core/messageCodecs.ts +60 -26
- package/src/shared-tree-core/messageFormat.ts +56 -0
- package/src/shared-tree-core/sharedTreeCore.ts +11 -13
- package/src/simple-tree/api/discrepancies.ts +2 -2
- package/src/simple-tree/api/incrementalAllowedTypes.ts +1 -1
- package/src/simple-tree/api/index.ts +6 -2
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -168
- package/src/simple-tree/api/schemaFactoryBeta.ts +180 -14
- package/src/simple-tree/api/schemaFromSimple.ts +6 -3
- package/src/simple-tree/api/simpleSchemaCodec.ts +360 -0
- package/src/simple-tree/api/storedSchema.ts +8 -5
- package/src/simple-tree/api/tree.ts +2 -2
- package/src/simple-tree/api/typesUnsafe.ts +6 -6
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +80 -47
- package/src/simple-tree/core/allowedTypes.ts +3 -3
- package/src/simple-tree/core/treeNode.ts +2 -2
- package/src/simple-tree/index.ts +5 -1
- package/src/simple-tree/node-kinds/array/arrayNode.ts +2 -2
- package/src/simple-tree/node-kinds/map/mapNode.ts +2 -2
- package/src/simple-tree/node-kinds/object/objectNode.ts +3 -3
- package/src/simple-tree/node-kinds/record/recordNode.ts +3 -3
- package/src/simple-tree/simpleSchema.ts +12 -3
- package/src/simple-tree/simpleSchemaFormatV1.ts +179 -0
- package/src/tableSchema.ts +5 -2
- package/src/treeFactory.ts +33 -1
- package/src/util/brand.ts +40 -2
- package/src/util/brandedMap.ts +3 -1
- package/src/util/index.ts +1 -0
|
@@ -8,7 +8,7 @@ import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
|
8
8
|
|
|
9
9
|
import { tryGetTreeNodeSchema } from "./treeNodeKernel.js";
|
|
10
10
|
import { NodeKind, type TreeNodeSchemaClass } from "./treeNodeSchema.js";
|
|
11
|
-
// eslint-disable-next-line import/no-deprecated
|
|
11
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
12
12
|
import { type WithType, typeNameSymbol, type typeSchemaSymbol } from "./withType.js";
|
|
13
13
|
import { markEager } from "./flexList.js";
|
|
14
14
|
|
|
@@ -80,7 +80,7 @@ export abstract class TreeNode implements WithType {
|
|
|
80
80
|
* Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.
|
|
81
81
|
* @deprecated Use {@link typeSchemaSymbol} instead.
|
|
82
82
|
*/
|
|
83
|
-
// eslint-disable-next-line import/no-deprecated
|
|
83
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
84
84
|
public abstract get [typeNameSymbol](): string;
|
|
85
85
|
|
|
86
86
|
/**
|
package/src/simple-tree/index.ts
CHANGED
|
@@ -74,6 +74,7 @@ export {
|
|
|
74
74
|
type ITreeConfigurationOptions,
|
|
75
75
|
SchemaFactory,
|
|
76
76
|
SchemaFactoryBeta,
|
|
77
|
+
type SchemaStaticsBeta,
|
|
77
78
|
SchemaFactoryAlpha,
|
|
78
79
|
type ObjectSchemaOptionsAlpha,
|
|
79
80
|
type ObjectSchemaOptions,
|
|
@@ -180,7 +181,6 @@ export {
|
|
|
180
181
|
type TreeChangeEvents,
|
|
181
182
|
type NodeSchemaOptions,
|
|
182
183
|
type NodeSchemaOptionsAlpha,
|
|
183
|
-
type SchemaStaticsAlpha,
|
|
184
184
|
KeyEncodingOptions,
|
|
185
185
|
type TreeParsingOptions,
|
|
186
186
|
incrementalSummaryHint,
|
|
@@ -280,3 +280,7 @@ export {
|
|
|
280
280
|
nullSchema,
|
|
281
281
|
} from "./leafNodeSchema.js";
|
|
282
282
|
export type { LeafSchema } from "./leafNodeSchema.js";
|
|
283
|
+
export {
|
|
284
|
+
encodeSimpleSchema,
|
|
285
|
+
decodeSimpleSchema,
|
|
286
|
+
} from "./api/index.js";
|
|
@@ -16,7 +16,7 @@ import { FieldKinds, isTreeValue } from "../../../feature-libraries/index.js";
|
|
|
16
16
|
import {
|
|
17
17
|
CompatibilityLevel,
|
|
18
18
|
type WithType,
|
|
19
|
-
// eslint-disable-next-line import/no-deprecated
|
|
19
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
20
20
|
typeNameSymbol,
|
|
21
21
|
NodeKind,
|
|
22
22
|
type TreeNode,
|
|
@@ -1266,7 +1266,7 @@ export function arraySchema<
|
|
|
1266
1266
|
public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
|
|
1267
1267
|
persistedMetadata;
|
|
1268
1268
|
|
|
1269
|
-
// eslint-disable-next-line import/no-deprecated
|
|
1269
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
1270
1270
|
public get [typeNameSymbol](): TName {
|
|
1271
1271
|
return identifier;
|
|
1272
1272
|
}
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
type InnerNode,
|
|
23
23
|
NodeKind,
|
|
24
24
|
type TreeNodeSchema,
|
|
25
|
-
// eslint-disable-next-line import/no-deprecated
|
|
25
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
26
26
|
typeNameSymbol,
|
|
27
27
|
type TreeNode,
|
|
28
28
|
typeSchemaSymbol,
|
|
@@ -334,7 +334,7 @@ export function mapSchema<
|
|
|
334
334
|
public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
|
|
335
335
|
persistedMetadata;
|
|
336
336
|
|
|
337
|
-
// eslint-disable-next-line import/no-deprecated
|
|
337
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
338
338
|
public get [typeNameSymbol](): TName {
|
|
339
339
|
return identifier;
|
|
340
340
|
}
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
type TreeNodeSchema,
|
|
33
33
|
NodeKind,
|
|
34
34
|
type WithType,
|
|
35
|
-
// eslint-disable-next-line import/no-deprecated
|
|
35
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
36
36
|
typeNameSymbol,
|
|
37
37
|
typeSchemaSymbol,
|
|
38
38
|
type InternalTreeNode,
|
|
@@ -275,7 +275,7 @@ function createProxyHandler(
|
|
|
275
275
|
if (propertyKey === typeSchemaSymbol) {
|
|
276
276
|
return schema;
|
|
277
277
|
}
|
|
278
|
-
// eslint-disable-next-line import/no-deprecated
|
|
278
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
279
279
|
if (propertyKey === typeNameSymbol) {
|
|
280
280
|
return schema.identifier;
|
|
281
281
|
}
|
|
@@ -573,7 +573,7 @@ export function objectSchema<
|
|
|
573
573
|
public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
|
|
574
574
|
nodeOptions.persistedMetadata;
|
|
575
575
|
|
|
576
|
-
// eslint-disable-next-line import/no-deprecated
|
|
576
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
577
577
|
public get [typeNameSymbol](): TName {
|
|
578
578
|
return identifier;
|
|
579
579
|
}
|
|
@@ -11,7 +11,7 @@ import { type JsonCompatibleReadOnlyObject, brand } from "../../../util/index.js
|
|
|
11
11
|
import {
|
|
12
12
|
type TreeNodeSchema,
|
|
13
13
|
NodeKind,
|
|
14
|
-
// eslint-disable-next-line import/no-deprecated
|
|
14
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
15
15
|
typeNameSymbol,
|
|
16
16
|
typeSchemaSymbol,
|
|
17
17
|
type UnhydratedFlexTreeNode,
|
|
@@ -80,7 +80,7 @@ function createRecordNodeProxy(
|
|
|
80
80
|
case typeSchemaSymbol: {
|
|
81
81
|
return schema;
|
|
82
82
|
}
|
|
83
|
-
// eslint-disable-next-line import/no-deprecated
|
|
83
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
84
84
|
case typeNameSymbol: {
|
|
85
85
|
return schema.identifier;
|
|
86
86
|
}
|
|
@@ -370,7 +370,7 @@ export function recordSchema<
|
|
|
370
370
|
public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
|
|
371
371
|
persistedMetadata;
|
|
372
372
|
|
|
373
|
-
// eslint-disable-next-line import/no-deprecated
|
|
373
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
374
374
|
public get [typeNameSymbol](): TName {
|
|
375
375
|
return identifier;
|
|
376
376
|
}
|
|
@@ -58,6 +58,15 @@ export interface SimpleObjectNodeSchema<out TCustomMetadata = unknown>
|
|
|
58
58
|
* especially if/when TreeNodeSchema for objects provide more maps.
|
|
59
59
|
*/
|
|
60
60
|
readonly fields: ReadonlyMap<string, SimpleObjectFieldSchema>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Whether the object node allows unknown optional fields.
|
|
64
|
+
*
|
|
65
|
+
* @see {@link ObjectSchemaOptions.allowUnknownOptionalFields} for the API where this field is set as part of authoring a schema.
|
|
66
|
+
*
|
|
67
|
+
* @remarks Only populated for view schemas, undefined otherwise. Relevant for compatibility checking scenarios.
|
|
68
|
+
*/
|
|
69
|
+
readonly allowUnknownOptionalFields: boolean | undefined;
|
|
61
70
|
}
|
|
62
71
|
|
|
63
72
|
/**
|
|
@@ -163,14 +172,14 @@ export type SimpleNodeSchema =
|
|
|
163
172
|
| SimpleRecordNodeSchema;
|
|
164
173
|
|
|
165
174
|
/**
|
|
166
|
-
* Information about allowed types.
|
|
175
|
+
* Information about allowed types under a field.
|
|
167
176
|
*
|
|
168
177
|
* @alpha
|
|
169
178
|
* @sealed
|
|
170
179
|
*/
|
|
171
180
|
export interface SimpleAllowedTypeAttributes {
|
|
172
181
|
/**
|
|
173
|
-
* True if this schema is included as a {@link
|
|
182
|
+
* True if this schema is included as a {@link SchemaStaticsBeta.staged | staged} schema upgrade,
|
|
174
183
|
* allowing the view schema be compatible with stored schema with (post upgrade) or without it (pre-upgrade).
|
|
175
184
|
* New documents and schema upgrades will omit any staged schema.
|
|
176
185
|
*
|
|
@@ -238,7 +247,7 @@ export interface SimpleTreeSchema {
|
|
|
238
247
|
* @remarks
|
|
239
248
|
* The keys are the schemas' {@link TreeNodeSchemaCore.identifier | identifiers}.
|
|
240
249
|
*
|
|
241
|
-
* Information about if a schema is {@link
|
|
250
|
+
* Information about if a schema is {@link SchemaStaticsBeta.staged | staged} or not is not available as the "Simple Schema" layer of abstraction: they are included unconditionally.
|
|
242
251
|
* Options for filtering out staged schemas from view schema are available in {@link extractPersistedSchema}.
|
|
243
252
|
*/
|
|
244
253
|
readonly definitions: ReadonlyMap<string, SimpleNodeSchema>;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { Type, type ObjectOptions, type Static } from "@sinclair/typebox";
|
|
7
|
+
|
|
8
|
+
const noAdditionalProps: ObjectOptions = { additionalProperties: false };
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The format version for the schema.
|
|
12
|
+
*/
|
|
13
|
+
export const SimpleSchemaFormatVersion = {
|
|
14
|
+
v1: 1,
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The allowed types and their attributes in the simple schema format.
|
|
19
|
+
* @see {@link SimpleAllowedTypes}.
|
|
20
|
+
*/
|
|
21
|
+
export const SimpleAllowedTypeAttributesFormat = Type.Object(
|
|
22
|
+
{
|
|
23
|
+
isStaged: Type.Optional(Type.Boolean()),
|
|
24
|
+
},
|
|
25
|
+
noAdditionalProps,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export type SimpleAllowedTypeAttributesFormat = Static<
|
|
29
|
+
typeof SimpleAllowedTypeAttributesFormat
|
|
30
|
+
>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A set of allowed types in the simple schema format.
|
|
34
|
+
* The keys are the type identifiers, and the values are their attributes.
|
|
35
|
+
*/
|
|
36
|
+
export const SimpleAllowedTypesFormat = Type.Record(
|
|
37
|
+
Type.String(),
|
|
38
|
+
SimpleAllowedTypeAttributesFormat,
|
|
39
|
+
);
|
|
40
|
+
export type SimpleAllowedTypesFormat = Static<typeof SimpleAllowedTypesFormat>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Persisted format for a field schema in the simple schema format.
|
|
44
|
+
* @see {@link SimpleFieldSchema}.
|
|
45
|
+
*/
|
|
46
|
+
export const SimpleFieldSchemaFormat = Type.Object(
|
|
47
|
+
{
|
|
48
|
+
kind: Type.Integer(),
|
|
49
|
+
simpleAllowedTypes: SimpleAllowedTypesFormat,
|
|
50
|
+
},
|
|
51
|
+
noAdditionalProps,
|
|
52
|
+
);
|
|
53
|
+
export type SimpleFieldSchemaFormat = Static<typeof SimpleFieldSchemaFormat>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Persisted format for an object field schema in the simple schema format.
|
|
57
|
+
* @see {@link SimpleObjectFieldSchema}.
|
|
58
|
+
*/
|
|
59
|
+
export const SimpleObjectFieldSchemaFormat = Type.Object(
|
|
60
|
+
{
|
|
61
|
+
kind: Type.Integer(),
|
|
62
|
+
simpleAllowedTypes: SimpleAllowedTypesFormat,
|
|
63
|
+
storedKey: Type.String(),
|
|
64
|
+
},
|
|
65
|
+
noAdditionalProps,
|
|
66
|
+
);
|
|
67
|
+
export type SimpleObjectFieldSchemaFormat = Static<typeof SimpleObjectFieldSchemaFormat>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Persisted format for an array node schema in the simple schema format.
|
|
71
|
+
* @see {@link SimpleArrayNodeSchema}.
|
|
72
|
+
*/
|
|
73
|
+
export const SimpleArrayNodeSchemaFormat = Type.Object(
|
|
74
|
+
{
|
|
75
|
+
kind: Type.Integer(),
|
|
76
|
+
simpleAllowedTypes: SimpleAllowedTypesFormat,
|
|
77
|
+
},
|
|
78
|
+
noAdditionalProps,
|
|
79
|
+
);
|
|
80
|
+
export type SimpleArrayNodeSchemaFormat = Static<typeof SimpleArrayNodeSchemaFormat>;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Persisted format for a map node schema in the simple schema format.
|
|
84
|
+
* @see {@link SimpleMapNodeSchema}.
|
|
85
|
+
*/
|
|
86
|
+
export const SimpleMapNodeSchemaFormat = Type.Object(
|
|
87
|
+
{
|
|
88
|
+
kind: Type.Integer(),
|
|
89
|
+
simpleAllowedTypes: SimpleAllowedTypesFormat,
|
|
90
|
+
},
|
|
91
|
+
noAdditionalProps,
|
|
92
|
+
);
|
|
93
|
+
export type SimpleMapNodeSchemaFormat = Static<typeof SimpleMapNodeSchemaFormat>;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Persisted format for a record node schema in the simple schema format.
|
|
97
|
+
* @see {@link SimpleRecordNodeSchema}.
|
|
98
|
+
*/
|
|
99
|
+
export const SimpleRecordNodeSchemaFormat = Type.Object(
|
|
100
|
+
{
|
|
101
|
+
kind: Type.Integer(),
|
|
102
|
+
simpleAllowedTypes: SimpleAllowedTypesFormat,
|
|
103
|
+
},
|
|
104
|
+
noAdditionalProps,
|
|
105
|
+
);
|
|
106
|
+
export type SimpleRecordNodeSchemaFormat = Static<typeof SimpleRecordNodeSchemaFormat>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Persisted format for a leaf node schema in the simple schema format.
|
|
110
|
+
* @see {@link SimpleLeafNodeSchema}.
|
|
111
|
+
*/
|
|
112
|
+
export const SimpleLeafNodeSchemaFormat = Type.Object(
|
|
113
|
+
{
|
|
114
|
+
kind: Type.Integer(),
|
|
115
|
+
leafKind: Type.Integer(),
|
|
116
|
+
},
|
|
117
|
+
noAdditionalProps,
|
|
118
|
+
);
|
|
119
|
+
export type SimpleLeafNodeSchemaFormat = Static<typeof SimpleLeafNodeSchemaFormat>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Persisted format for the field schemas of an object node in the simple schema format.
|
|
123
|
+
*/
|
|
124
|
+
export const SimpleObjectFieldSchemasFormat = Type.Record(
|
|
125
|
+
Type.String(),
|
|
126
|
+
SimpleObjectFieldSchemaFormat,
|
|
127
|
+
);
|
|
128
|
+
export type SimpleObjectFieldSchemasFormat = Static<typeof SimpleObjectFieldSchemasFormat>;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Persisted format for an object node schema in the simple schema format.
|
|
132
|
+
* @see {@link SimpleObjectNodeSchema}.
|
|
133
|
+
*/
|
|
134
|
+
export const SimpleObjectNodeSchemaFormat = Type.Object(
|
|
135
|
+
{
|
|
136
|
+
kind: Type.Integer(),
|
|
137
|
+
fields: SimpleObjectFieldSchemasFormat,
|
|
138
|
+
allowUnknownOptionalFields: Type.Optional(Type.Boolean()),
|
|
139
|
+
},
|
|
140
|
+
noAdditionalProps,
|
|
141
|
+
);
|
|
142
|
+
export type SimpleObjectNodeSchemaFormat = Static<typeof SimpleObjectNodeSchemaFormat>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Discriminated union of all possible node schemas.
|
|
146
|
+
*
|
|
147
|
+
* See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
|
|
148
|
+
*/
|
|
149
|
+
export const SimpleNodeSchemaUnionFormat = Type.Object({
|
|
150
|
+
array: Type.Optional(SimpleArrayNodeSchemaFormat),
|
|
151
|
+
map: Type.Optional(SimpleMapNodeSchemaFormat),
|
|
152
|
+
record: Type.Optional(SimpleRecordNodeSchemaFormat),
|
|
153
|
+
leaf: Type.Optional(SimpleLeafNodeSchemaFormat),
|
|
154
|
+
object: Type.Optional(SimpleObjectNodeSchemaFormat),
|
|
155
|
+
});
|
|
156
|
+
export type SimpleNodeSchemaUnionFormat = Static<typeof SimpleNodeSchemaUnionFormat>;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Helper type for the schema definitions map in the persisted format.
|
|
160
|
+
*/
|
|
161
|
+
export const SimpleSchemaDefinitionsFormat = Type.Record(
|
|
162
|
+
Type.String(),
|
|
163
|
+
SimpleNodeSchemaUnionFormat,
|
|
164
|
+
);
|
|
165
|
+
export type SimpleSchemaDefinitionsFormat = Static<typeof SimpleSchemaDefinitionsFormat>;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Persisted format for the entire tree schema in the simple schema format.
|
|
169
|
+
* @see {@link SimpleTreeSchema}.
|
|
170
|
+
*/
|
|
171
|
+
export const SimpleTreeSchemaFormat = Type.Object(
|
|
172
|
+
{
|
|
173
|
+
version: Type.Literal(SimpleSchemaFormatVersion.v1),
|
|
174
|
+
root: SimpleFieldSchemaFormat,
|
|
175
|
+
definitions: SimpleSchemaDefinitionsFormat,
|
|
176
|
+
},
|
|
177
|
+
noAdditionalProps,
|
|
178
|
+
);
|
|
179
|
+
export type SimpleTreeSchemaFormat = Static<typeof SimpleTreeSchemaFormat>;
|
package/src/tableSchema.ts
CHANGED
|
@@ -216,7 +216,10 @@ export namespace System_TableSchema {
|
|
|
216
216
|
throw new UsageError(`Column with ID "${this.id}" is not contained in a table.`);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
const result
|
|
219
|
+
const result: {
|
|
220
|
+
rowId: string;
|
|
221
|
+
cell: CellValueType;
|
|
222
|
+
}[] = [];
|
|
220
223
|
for (const row of tableNode.rows) {
|
|
221
224
|
const cell = row.getCell(this.id);
|
|
222
225
|
if (cell !== undefined) {
|
|
@@ -226,7 +229,7 @@ export namespace System_TableSchema {
|
|
|
226
229
|
);
|
|
227
230
|
}
|
|
228
231
|
|
|
229
|
-
result.push({ rowId: row.id, cell
|
|
232
|
+
result.push({ rowId: row.id, cell });
|
|
230
233
|
}
|
|
231
234
|
}
|
|
232
235
|
return result;
|
package/src/treeFactory.ts
CHANGED
|
@@ -26,8 +26,12 @@ import {
|
|
|
26
26
|
} from "./shared-tree/index.js";
|
|
27
27
|
import { SharedTreeFactoryType, SharedTreeAttributes } from "./sharedTreeAttributes.js";
|
|
28
28
|
import type { ITree } from "./simple-tree/index.js";
|
|
29
|
-
import { Breakable } from "./util/index.js";
|
|
29
|
+
import { Breakable, copyProperty } from "./util/index.js";
|
|
30
30
|
import { FluidClientVersion } from "./codec/index.js";
|
|
31
|
+
import {
|
|
32
|
+
editManagerFormatVersionSelectorForSharedBranches,
|
|
33
|
+
messageFormatVersionSelectorForSharedBranches,
|
|
34
|
+
} from "./shared-tree-core/index.js";
|
|
31
35
|
|
|
32
36
|
/**
|
|
33
37
|
* {@link ITreePrivate} extended with ISharedObject.
|
|
@@ -169,6 +173,13 @@ export function configuredSharedTreeBetaLegacy(
|
|
|
169
173
|
*/
|
|
170
174
|
export function configuredSharedTree(
|
|
171
175
|
options: SharedTreeOptions,
|
|
176
|
+
): ISharedObjectKind<ITree> & SharedObjectKind<ITree> {
|
|
177
|
+
const internalOptions = resolveOptions(options);
|
|
178
|
+
return configuredSharedTreeInternal(internalOptions);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function configuredSharedTreeInternal(
|
|
182
|
+
options: SharedTreeOptionsInternal,
|
|
172
183
|
): ISharedObjectKind<ITree> & SharedObjectKind<ITree> {
|
|
173
184
|
const sharedObjectOptions: SharedObjectOptions<ITree> = {
|
|
174
185
|
type: SharedTreeFactoryType,
|
|
@@ -179,3 +190,24 @@ export function configuredSharedTree(
|
|
|
179
190
|
|
|
180
191
|
return makeSharedObjectKind<ITree>(sharedObjectOptions);
|
|
181
192
|
}
|
|
193
|
+
|
|
194
|
+
export function resolveOptions(options: SharedTreeOptions): SharedTreeOptionsInternal {
|
|
195
|
+
const internal: SharedTreeOptionsInternal = {
|
|
196
|
+
...resolveSharedBranchesOptions(options.enableSharedBranches),
|
|
197
|
+
};
|
|
198
|
+
copyProperty(options, "forest", internal);
|
|
199
|
+
copyProperty(options, "jsonValidator", internal);
|
|
200
|
+
copyProperty(options, "minVersionForCollab", internal);
|
|
201
|
+
copyProperty(options, "treeEncodeType", internal);
|
|
202
|
+
return internal;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function resolveSharedBranchesOptions(
|
|
206
|
+
enableSharedBranches: boolean | undefined,
|
|
207
|
+
): SharedTreeOptionsInternal {
|
|
208
|
+
return enableSharedBranches === true ? sharedBranchesOptions : {};
|
|
209
|
+
}
|
|
210
|
+
const sharedBranchesOptions: SharedTreeOptionsInternal = {
|
|
211
|
+
messageFormatSelector: messageFormatVersionSelectorForSharedBranches,
|
|
212
|
+
editManagerFormatSelector: editManagerFormatVersionSelectorForSharedBranches,
|
|
213
|
+
};
|
package/src/util/brand.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { Covariant } from "./typeCheck.js";
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Constructs a "Branded" type, adding a type-checking only field to `ValueType`.
|
|
12
|
-
*
|
|
12
|
+
* @remarks
|
|
13
13
|
* Two usages of `Brand` should never use the same `Name`.
|
|
14
14
|
* If they do, the resulting types will be assignable which defeats the point of this type.
|
|
15
15
|
*
|
|
@@ -18,11 +18,17 @@ import type { Covariant } from "./typeCheck.js";
|
|
|
18
18
|
* `Type 'Name1' is not assignable to type 'Name2'.`
|
|
19
19
|
*
|
|
20
20
|
* These branded types are not opaque: A `Brand<A, B>` can still be used as a `A`.
|
|
21
|
+
*
|
|
22
|
+
* @example Simple usage:
|
|
23
|
+
* ```typescript
|
|
24
|
+
* export type StrongId = Brand<string, "tree.StrongId">;
|
|
25
|
+
* const x: StrongId = brand("myId");
|
|
26
|
+
* ```
|
|
21
27
|
*/
|
|
22
28
|
export type Brand<ValueType, Name> = ValueType & BrandedType<ValueType, Name>;
|
|
23
29
|
|
|
24
30
|
/**
|
|
25
|
-
*
|
|
31
|
+
* Implementation detail for {@link Brand}.
|
|
26
32
|
*
|
|
27
33
|
* See `MakeNominal` for some more details.
|
|
28
34
|
*
|
|
@@ -98,6 +104,11 @@ export type NameFromBranded<T extends BrandedType<unknown, unknown>> = T extends
|
|
|
98
104
|
* Adds a type {@link Brand} to a value.
|
|
99
105
|
*
|
|
100
106
|
* Only do this when specifically allowed by the requirements of the type being converted to.
|
|
107
|
+
* @remarks
|
|
108
|
+
* This infers the branded type from context so it can very easily be used to a semantically invalid conversion.
|
|
109
|
+
* Treat this like "as" casts: they are an indicator that the user/reader must ensure the conversion is valid.
|
|
110
|
+
*
|
|
111
|
+
* If branding a constant, and wanting to preserve the exact typing of the constant, use {@link brandConst} instead.
|
|
101
112
|
* @privateRemarks
|
|
102
113
|
* Leaving `T` unconstrained here allows for better type inference when branding unions.
|
|
103
114
|
* For example when assigning `brand(number)` a number to an optional branded number field,
|
|
@@ -111,3 +122,30 @@ export function brand<T>(
|
|
|
111
122
|
): T {
|
|
112
123
|
return value as T;
|
|
113
124
|
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Adds a type {@link Brand} to a value, while preserving the exact type of the value being branded.
|
|
128
|
+
* @remarks
|
|
129
|
+
* This takes in the type to brand to as a required type parameter, unlike {@link brand} which infers it from context.
|
|
130
|
+
* This also preserves the exact type of the value being branded.
|
|
131
|
+
* TypeScript has no way to take an explicit type parameter and infer another in a single generic context.
|
|
132
|
+
* To work around this, two generic contexts are used, first a function to infer the parameter type,
|
|
133
|
+
* and a second function (returned) to take the explicit type parameter.
|
|
134
|
+
*
|
|
135
|
+
* This is intended for use when branding constants.
|
|
136
|
+
* @example
|
|
137
|
+
* ```typescript
|
|
138
|
+
* const requiredIdentifier = brandConst("Value")<FieldKindIdentifier>();
|
|
139
|
+
* ```
|
|
140
|
+
* @privateRemarks
|
|
141
|
+
* The dummy parameter is used to produce a compile error in the event where the value being branded is incompatible with the branded type.
|
|
142
|
+
*/
|
|
143
|
+
export function brandConst<const T>(
|
|
144
|
+
value: T,
|
|
145
|
+
): <T2 extends BrandedType<unknown, unknown>>(
|
|
146
|
+
...dummy: T extends (T2 extends BrandedType<infer ValueType, unknown> ? ValueType : never)
|
|
147
|
+
? []
|
|
148
|
+
: [never]
|
|
149
|
+
) => T2 & T {
|
|
150
|
+
return <T2>() => value as T2 & T;
|
|
151
|
+
}
|
package/src/util/brandedMap.ts
CHANGED
|
@@ -11,10 +11,12 @@ import { getOrCreate } from "./utils.js";
|
|
|
11
11
|
/**
|
|
12
12
|
* Key in a {@link BrandedMapSubset}.
|
|
13
13
|
* @remarks
|
|
14
|
+
* `TContent` is used as part of the brand to strongly associate the key type with the type of the values it looks up.
|
|
15
|
+
*
|
|
14
16
|
* Due to the `TContent` type parameter being invariant (which it has to be since keys are used to both read and write data),
|
|
15
17
|
* generic collections end up needing to constrain their key's `TContent` to `any`.
|
|
16
18
|
*/
|
|
17
|
-
export type BrandedKey<TKey, TContent> = TKey
|
|
19
|
+
export type BrandedKey<TKey, TContent> = Brand<TKey, ["BrandedKey", Invariant<TContent>]>;
|
|
18
20
|
|
|
19
21
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
22
|
export type BrandedKeyContent<TKey extends BrandedKey<unknown, any>> = TKey extends BrandedKey<
|