@fluidframework/tree 2.82.0 → 2.83.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 +43 -0
- package/README.md +33 -5
- package/api-report/tree.alpha.api.md +25 -21
- package/api-report/tree.beta.api.md +14 -2
- package/api-report/tree.legacy.beta.api.md +14 -2
- package/api-report/tree.legacy.public.api.md +1 -1
- package/api-report/tree.public.api.md +1 -1
- package/dist/alpha.d.ts +3 -3
- package/dist/beta.d.ts +1 -0
- package/dist/codec/codec.d.ts +3 -39
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +5 -50
- 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 +1 -2
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +20 -7
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +56 -30
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +6 -4
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/extensibleUnionNode.d.ts +97 -0
- package/dist/extensibleUnionNode.d.ts.map +1 -0
- package/dist/{extensibleSchemaUnion.js → extensibleUnionNode.js} +28 -18
- package/dist/extensibleUnionNode.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +4 -4
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +7 -1
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts +3 -3
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatV1.d.ts +2 -3
- package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatV1.js +1 -2
- package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatV2.d.ts +2 -3
- package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatV2.js +1 -2
- package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +4 -4
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +6 -4
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +1 -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/sharedTreeChangeCodecs.js +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/tree.d.ts +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +1 -1
- 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 +2 -4
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +3 -3
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +2 -2
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +2 -2
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +2 -2
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +148 -29
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +180 -99
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts +1 -1
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +1 -0
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +29 -0
- package/dist/simple-tree/core/unhydratedFlexTree.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 +2 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +4 -13
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +33 -7
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +3 -3
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +48 -32
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/util/bTreeUtils.d.ts.map +1 -1
- package/dist/util/bTreeUtils.js +6 -6
- package/dist/util/bTreeUtils.js.map +1 -1
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +5 -6
- package/dist/util/rangeMap.js.map +1 -1
- package/lib/alpha.d.ts +3 -3
- package/lib/beta.d.ts +1 -0
- package/lib/codec/codec.d.ts +3 -39
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +4 -47
- 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/codec/versioned/codec.d.ts +20 -7
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +59 -33
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +6 -4
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/extensibleUnionNode.d.ts +97 -0
- package/lib/extensibleUnionNode.d.ts.map +1 -0
- package/lib/{extensibleSchemaUnion.js → extensibleUnionNode.js} +28 -18
- package/lib/extensibleUnionNode.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +5 -5
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +8 -2
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts +3 -3
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatV1.d.ts +2 -3
- package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatV1.js +1 -2
- package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatV2.d.ts +2 -3
- package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatV2.js +1 -2
- package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +4 -4
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +6 -4
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +1 -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/sharedTreeChangeCodecs.js +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/tree.d.ts +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +1 -1
- 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 +2 -4
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +3 -3
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +2 -2
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +2 -2
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js +2 -2
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +2 -2
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +148 -29
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +179 -98
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts +1 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +1 -0
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +29 -0
- package/lib/simple-tree/core/unhydratedFlexTree.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/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +5 -14
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +34 -8
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +3 -3
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +30 -14
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/util/bTreeUtils.d.ts.map +1 -1
- package/lib/util/bTreeUtils.js +6 -6
- package/lib/util/bTreeUtils.js.map +1 -1
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +5 -6
- package/lib/util/rangeMap.js.map +1 -1
- package/package.json +23 -23
- package/src/codec/codec.ts +10 -112
- package/src/codec/index.ts +0 -3
- package/src/codec/versioned/codec.ts +119 -83
- package/src/core/tree/detachedFieldIndexCodecs.ts +6 -4
- package/src/{extensibleSchemaUnion.ts → extensibleUnionNode.ts} +61 -19
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +5 -11
- package/src/feature-libraries/forest-summary/codec.ts +8 -7
- package/src/feature-libraries/forest-summary/formatCommon.ts +5 -3
- package/src/feature-libraries/forest-summary/formatV1.ts +1 -3
- package/src/feature-libraries/forest-summary/formatV2.ts +1 -3
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +5 -6
- package/src/feature-libraries/schema-index/codec.ts +6 -4
- package/src/index.ts +3 -3
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/sharedTreeChangeCodecs.ts +2 -2
- package/src/shared-tree/tree.ts +1 -1
- package/src/shared-tree/treeAlpha.ts +1 -1
- package/src/shared-tree/treeCheckout.ts +2 -4
- package/src/shared-tree-core/editManagerCodecsCommons.ts +7 -7
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -10
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -10
- package/src/shared-tree-core/messageCodecs.ts +2 -6
- package/src/simple-tree/api/index.ts +2 -2
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +344 -142
- package/src/simple-tree/api/tree.ts +1 -1
- package/src/simple-tree/api/treeBeta.ts +1 -1
- package/src/simple-tree/core/allowedTypes.ts +1 -1
- package/src/simple-tree/core/unhydratedFlexTree.ts +43 -1
- package/src/simple-tree/index.ts +2 -2
- package/src/simple-tree/node-kinds/array/arrayNode.ts +13 -19
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +51 -10
- package/src/text/textDomainFormatted.ts +37 -17
- package/src/util/bTreeUtils.ts +10 -6
- package/src/util/rangeMap.ts +9 -6
- package/api-extractor-lint.json +0 -4
- package/dist/extensibleSchemaUnion.d.ts +0 -72
- package/dist/extensibleSchemaUnion.d.ts.map +0 -1
- package/dist/extensibleSchemaUnion.js.map +0 -1
- package/lib/extensibleSchemaUnion.d.ts +0 -72
- package/lib/extensibleSchemaUnion.d.ts.map +0 -1
- package/lib/extensibleSchemaUnion.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatCommon.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatCommon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAc,KAAK,MAAM,EAAgC,MAAM,qBAAqB,CAAC;AAE5F;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;CAI9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE,eAAO,MAAM,aAAa,oIAAmD,CAAC;AAE9E,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"formatCommon.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatCommon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAc,KAAK,MAAM,EAAgC,MAAM,qBAAqB,CAAC;AAE5F;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;CAI9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE,eAAO,MAAM,aAAa,oIAAmD,CAAC;AAE9E,eAAO,MAAM,YAAY,wDACf,QAAQ;;;;EAWhB,CAAC;AACH,MAAM,MAAM,MAAM,CAAC,QAAQ,SAAS,mBAAmB,GAAG,mBAAmB,IAAI,MAAM,CACtF,UAAU,CAAC,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC,CACzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatCommon.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatCommon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAe,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAE5F;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC,qBAAqB,EAAE;IACpE,EAAE,EAAE,CAAC;IACL,gDAAgD;IAChD,EAAE,EAAE,CAAC;CACL,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAE9E,MAAM,CAAC,MAAM,YAAY,GAAG,CAC3B,
|
|
1
|
+
{"version":3,"file":"formatCommon.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatCommon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAe,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAE5F;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC,qBAAqB,EAAE;IACpE,EAAE,EAAE,CAAC;IACL,gDAAgD;IAChD,EAAE,EAAE,CAAC;CACL,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAE9E,MAAM,CAAC,MAAM,YAAY,GAAG,CAC3B,OAAiB,EAGhB,EAAE,CACH,IAAI,CAAC,MAAM,CACV;IACC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC9B,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC/C,MAAM,EAAE,4BAA4B,EAAE,yBAAyB;CAC/D,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { schemaFormatV1 } from \"../../core/index.js\";\nimport { strictEnum, type Values, JsonCompatibleReadOnlySchema } from \"../../util/index.js\";\n\n/**\n * The format version for the forest.\n */\nexport const ForestFormatVersion = strictEnum(\"ForestFormatVersion\", {\n\tv1: 1,\n\t/** This format supports incremental encoding */\n\tv2: 2,\n});\nexport type ForestFormatVersion = Values<typeof ForestFormatVersion>;\n\nexport const validVersions = new Set([...Object.values(ForestFormatVersion)]);\n\nexport const FormatCommon = <const TVersion extends ForestFormatVersion>(\n\tversion: TVersion,\n\t// Return type is intentionally derived.\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n) =>\n\tType.Object(\n\t\t{\n\t\t\tversion: Type.Literal(version),\n\t\t\tkeys: Type.Array(schemaFormatV1.FieldKeySchema),\n\t\t\tfields: JsonCompatibleReadOnlySchema, // Uses field batch codec\n\t\t},\n\t\t{ additionalProperties: false },\n\t);\nexport type Format<TVersion extends ForestFormatVersion = ForestFormatVersion> = Static<\n\tReturnType<typeof FormatCommon<TVersion>>\n>;\n"]}
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { Static } from "@sinclair/typebox";
|
|
6
|
-
import { ForestFormatVersion } from "./formatCommon.js";
|
|
7
6
|
export declare const FormatV1: import("@sinclair/typebox").TObject<{
|
|
8
|
-
version: import("@sinclair/typebox").TLiteral<ForestFormatVersion
|
|
7
|
+
version: import("@sinclair/typebox").TLiteral<import("../../util/brand.js").Brand<1, "ForestFormatVersion">>;
|
|
9
8
|
keys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKey>>;
|
|
10
|
-
fields: import("@sinclair/typebox").TUnsafe<import("../../
|
|
9
|
+
fields: import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnly>;
|
|
11
10
|
}>;
|
|
12
11
|
export type FormatV1 = Static<typeof FormatV1>;
|
|
13
12
|
//# sourceMappingURL=formatV1.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD,
|
|
1
|
+
{"version":3,"file":"formatV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD,eAAO,MAAM,QAAQ;;;;EAAuC,CAAC;AAC7D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { brand } from "../../util/index.js";
|
|
6
5
|
import { FormatCommon, ForestFormatVersion } from "./formatCommon.js";
|
|
7
|
-
export const FormatV1 = FormatCommon(
|
|
6
|
+
export const FormatV1 = FormatCommon(ForestFormatVersion.v1);
|
|
8
7
|
//# sourceMappingURL=formatV1.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"formatV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEtE,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Static } from \"@sinclair/typebox\";\n\nimport { FormatCommon, ForestFormatVersion } from \"./formatCommon.js\";\n\nexport const FormatV1 = FormatCommon(ForestFormatVersion.v1);\nexport type FormatV1 = Static<typeof FormatV1>;\n"]}
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { Static } from "@sinclair/typebox";
|
|
6
|
-
import { ForestFormatVersion } from "./formatCommon.js";
|
|
7
6
|
export declare const FormatV2: import("@sinclair/typebox").TObject<{
|
|
8
|
-
version: import("@sinclair/typebox").TLiteral<ForestFormatVersion
|
|
7
|
+
version: import("@sinclair/typebox").TLiteral<import("../../util/brand.js").Brand<2, "ForestFormatVersion">>;
|
|
9
8
|
keys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKey>>;
|
|
10
|
-
fields: import("@sinclair/typebox").TUnsafe<import("../../
|
|
9
|
+
fields: import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnly>;
|
|
11
10
|
}>;
|
|
12
11
|
export type FormatV2 = Static<typeof FormatV2>;
|
|
13
12
|
//# sourceMappingURL=formatV2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatV2.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD,
|
|
1
|
+
{"version":3,"file":"formatV2.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD,eAAO,MAAM,QAAQ;;;;EAAuC,CAAC;AAC7D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { brand } from "../../util/index.js";
|
|
6
5
|
import { FormatCommon, ForestFormatVersion } from "./formatCommon.js";
|
|
7
|
-
export const FormatV2 = FormatCommon(
|
|
6
|
+
export const FormatV2 = FormatCommon(ForestFormatVersion.v2);
|
|
8
7
|
//# sourceMappingURL=formatV2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"formatV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEtE,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Static } from \"@sinclair/typebox\";\n\nimport { FormatCommon, ForestFormatVersion } from \"./formatCommon.js\";\n\nexport const FormatV2 = FormatCommon(ForestFormatVersion.v2);\nexport type FormatV2 = Static<typeof FormatV2>;\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { TAnySchema } from "@sinclair/typebox";
|
|
6
|
-
import { type ICodecOptions, type IJsonCodec, type
|
|
6
|
+
import { type ICodecOptions, type IJsonCodec, type SchemaValidationFunction } from "../../codec/index.js";
|
|
7
7
|
import type { ChangeEncodingContext, EncodedRevisionTag, FieldKindIdentifier, RevisionInfo, RevisionTag } from "../../core/index.js";
|
|
8
8
|
import { type IdAllocator, type JsonCompatibleReadOnly, type Mutable } from "../../util/index.js";
|
|
9
9
|
import { type ChangeAtomIdBTree } from "../changeAtomIdBTree.js";
|
|
@@ -14,7 +14,7 @@ import type { FieldKindConfiguration } from "./fieldKindConfiguration.js";
|
|
|
14
14
|
import { type EncodedBuilds, type EncodedFieldChangeMap, EncodedModularChangesetV1, type EncodedNodeChangeset, type EncodedRevisionInfo } from "./modularChangeFormatV1.js";
|
|
15
15
|
import { type FieldChangeset, type FieldChangeMap, type ModularChangeset, type NodeChangeset, type NodeId } from "./modularChangeTypes.js";
|
|
16
16
|
type ModularChangeCodec = IJsonCodec<ModularChangeset, EncodedModularChangesetV1, EncodedModularChangesetV1, ChangeEncodingContext>;
|
|
17
|
-
type FieldCodec =
|
|
17
|
+
type FieldCodec = IJsonCodec<FieldChangeset, JsonCompatibleReadOnly, JsonCompatibleReadOnly, FieldChangeEncodingContext>;
|
|
18
18
|
type FieldChangesetCodecs = Map<FieldKindIdentifier, {
|
|
19
19
|
compiledSchema?: SchemaValidationFunction<TAnySchema>;
|
|
20
20
|
codec: FieldCodec;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modularChangeCodecV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeCodecV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,
|
|
1
|
+
{"version":3,"file":"modularChangeCodecV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeCodecV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,wBAAwB,EAG7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACX,qBAAqB,EAErB,kBAAkB,EAElB,mBAAmB,EAEnB,YAAY,EACZ,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,OAAO,EAGZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,SAAS,EAGd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,KAAK,EAAE,0BAA0B,EAAsB,MAAM,yBAAyB,CAAC;AAC9F,OAAO,KAAK,EACX,sBAAsB,EAEtB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACN,KAAK,aAAa,EAGlB,KAAK,qBAAqB,EAC1B,yBAAyB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,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B,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,WAAW,EAAE,eAAe,EAC5B,YAAY,EAAE,aAAa,EAC3B,wBAAwB,GAAE,uBAA4D,GACpF,kBAAkB,CAkCpB"}
|
|
@@ -32,7 +32,7 @@ export function encodeFieldChangesForJsonI(change, context, fieldChangesetCodecs
|
|
|
32
32
|
const encodedFields = [];
|
|
33
33
|
for (const [field, fieldChange] of change) {
|
|
34
34
|
const { codec, compiledSchema } = getFieldChangesetCodec(fieldChange.fieldKind, fieldChangesetCodecs);
|
|
35
|
-
const encodedChange = codec.
|
|
35
|
+
const encodedChange = codec.encode(fieldChange.change, context);
|
|
36
36
|
if (compiledSchema !== undefined && !compiledSchema.check(encodedChange)) {
|
|
37
37
|
fail(0xb1f /* Encoded change didn't pass schema validation. */);
|
|
38
38
|
}
|
|
@@ -83,7 +83,7 @@ export function decodeFieldChangesFromJson(encodedChange, parentId, decoded, con
|
|
|
83
83
|
return nodeId;
|
|
84
84
|
},
|
|
85
85
|
};
|
|
86
|
-
const fieldChangeset = codec.
|
|
86
|
+
const fieldChangeset = codec.decode(field.change, fieldContext);
|
|
87
87
|
const crossFieldKeys = getChangeHandler(fieldKinds, field.fieldKind).getCrossFieldKeys(fieldChangeset);
|
|
88
88
|
for (const { key, count } of crossFieldKeys) {
|
|
89
89
|
decoded.crossFieldKeys.set(key, count, fieldId);
|
|
@@ -258,8 +258,8 @@ export function getFieldChangesetCodecs(fieldKinds, revisionTagCodec, codecOptio
|
|
|
258
258
|
const codec = kind.changeHandler.codecsFactory(revisionTagCodec).resolve(formatVersion);
|
|
259
259
|
return {
|
|
260
260
|
codec,
|
|
261
|
-
compiledSchema: codec.
|
|
262
|
-
? extractJsonValidator(codecOptions.jsonValidator).compile(codec.
|
|
261
|
+
compiledSchema: codec.encodedSchema
|
|
262
|
+
? extractJsonValidator(codecOptions.jsonValidator).compile(codec.encodedSchema)
|
|
263
263
|
: undefined,
|
|
264
264
|
};
|
|
265
265
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modularChangeCodecV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeCodecV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAGxE,OAAO,EAKN,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAW9B,OAAO,EAIN,KAAK,EACL,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAA0B,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAGN,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAOrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAKN,yBAAyB,GAGzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEN,qBAAqB,GAMrB,MAAM,yBAAyB,CAAC;AAwBjC,MAAM,UAAU,sBAAsB,CACrC,SAA8B,EAC9B,oBAA0C;IAK1C,MAAM,KAAK,GAAG,oBAAoB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/E,OAAO,KAAK,CAAC;AACd,CAAC;AAED,MAAM,UAAU,yBAAyB,CACxC,MAAsB,EACtB,OAA8B,EAC9B,WAA6C,EAC7C,oBAA0C;IAE1C,MAAM,YAAY,GAA+B;QAChD,WAAW,EAAE,OAAO;QAEpB,UAAU,EAAE,CAAC,MAAc,EAAwB,EAAE;YACpD,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,O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ChB,WAAW,EACX,wBAAwB,CACxB;KACF,CAAC;IAEF,OAAO,oBAAoB,CAC1B,yBAAyB,EACzB,kBAAkB,EAClB,YAAY,CAAC,aAAa,CAC1B,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CACxB,UAAkC,EAClC,SAA8B;IAE9B,IAAI,SAAS,KAAK,gBAAgB,CAAC,UAAU,EAAE,CAAC;QAC/C,OAAO,gBAAgB,CAAC,aAAa,CAAC;IACvC,CAAC;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC;IAC9D,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC9D,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,SAAS,iBAAiB,CACzB,aAKC,EACD,QAAiC,EACjC,OAA8B;IAE9B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,OAAO,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob, fail } from \"@fluidframework/core-utils/internal\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport {\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\ttype IMultiFormatCodec,\n\ttype SchemaValidationFunction,\n\textractJsonValidator,\n\twithSchemaValidation,\n} from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tFieldKey,\n\tFieldKindIdentifier,\n\tITreeCursorSynchronous,\n\tRevisionInfo,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport {\n\ttype IdAllocator,\n\ttype JsonCompatibleReadOnly,\n\ttype Mutable,\n\tbrand,\n\tidAllocatorFromMaxId,\n} from \"../../util/index.js\";\nimport { newChangeAtomIdBTree, type ChangeAtomIdBTree } from \"../changeAtomIdBTree.js\";\nimport {\n\ttype FieldBatchCodec,\n\ttype TreeChunk,\n\tchunkFieldSingle,\n\tdefaultChunkPolicy,\n} from \"../chunked-forest/index.js\";\nimport { TreeCompressionStrategy } from \"../treeCompressionUtils.js\";\n\nimport type { FieldChangeEncodingContext, FieldChangeHandler } from \"./fieldChangeHandler.js\";\nimport type {\n\tFieldKindConfiguration,\n\tFieldKindConfigurationEntry,\n} from \"./fieldKindConfiguration.js\";\nimport { genericFieldKind } from \"./genericFieldKind.js\";\nimport {\n\ttype EncodedBuilds,\n\ttype EncodedBuildsArray,\n\ttype EncodedFieldChange,\n\ttype EncodedFieldChangeMap,\n\tEncodedModularChangesetV1,\n\ttype EncodedNodeChangeset,\n\ttype EncodedRevisionInfo,\n} from \"./modularChangeFormatV1.js\";\nimport {\n\ttype FieldChangeset,\n\tnewCrossFieldKeyTable,\n\ttype FieldChangeMap,\n\ttype FieldId,\n\ttype ModularChangeset,\n\ttype NodeChangeset,\n\ttype NodeId,\n} from \"./modularChangeTypes.js\";\n\ntype ModularChangeCodec = IJsonCodec<\n\tModularChangeset,\n\tEncodedModularChangesetV1,\n\tEncodedModularChangesetV1,\n\tChangeEncodingContext\n>;\n\ntype FieldCodec = IMultiFormatCodec<\n\tFieldChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n>;\n\ntype FieldChangesetCodecs = Map<\n\tFieldKindIdentifier,\n\t{\n\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\tcodec: FieldCodec;\n\t}\n>;\n\nexport function getFieldChangesetCodec(\n\tfieldKind: FieldKindIdentifier,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): {\n\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\tcodec: FieldCodec;\n} {\n\tconst entry = fieldChangesetCodecs.get(fieldKind);\n\tassert(entry !== undefined, 0x5ea /* Tried to encode unsupported fieldKind */);\n\treturn entry;\n}\n\nexport function encodeFieldChangesForJson(\n\tchange: FieldChangeMap,\n\tcontext: ChangeEncodingContext,\n\tnodeChanges: ChangeAtomIdBTree<NodeChangeset>,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): EncodedFieldChangeMap {\n\tconst fieldContext: FieldChangeEncodingContext = {\n\t\tbaseContext: context,\n\n\t\tencodeNode: (nodeId: NodeId): EncodedNodeChangeset => {\n\t\t\tconst node = nodeChanges.get([nodeId.revision, nodeId.localId]);\n\t\t\tassert(node !== undefined, 0x92e /* Unknown node ID */);\n\t\t\treturn encodeNodeChangesForJson(node, fieldContext, fieldChangesetCodecs);\n\t\t},\n\n\t\tdecodeNode: () => fail(0xb1e /* Should not decode nodes during field encoding */),\n\t};\n\n\treturn encodeFieldChangesForJsonI(change, fieldContext, fieldChangesetCodecs);\n}\n\nexport function encodeFieldChangesForJsonI(\n\tchange: FieldChangeMap,\n\tcontext: FieldChangeEncodingContext,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): EncodedFieldChangeMap {\n\tconst encodedFields: EncodedFieldChangeMap = [];\n\n\tfor (const [field, fieldChange] of change) {\n\t\tconst { codec, compiledSchema } = getFieldChangesetCodec(\n\t\t\tfieldChange.fieldKind,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t\tconst encodedChange = codec.json.encode(fieldChange.change, context);\n\t\tif (compiledSchema !== undefined && !compiledSchema.check(encodedChange)) {\n\t\t\tfail(0xb1f /* Encoded change didn't pass schema validation. */);\n\t\t}\n\n\t\tconst fieldKey: FieldKey = field;\n\t\tconst encodedField: EncodedFieldChange = {\n\t\t\tfieldKey,\n\t\t\tfieldKind: fieldChange.fieldKind,\n\t\t\tchange: encodedChange,\n\t\t};\n\n\t\tencodedFields.push(encodedField);\n\t}\n\n\treturn encodedFields;\n}\n\nexport function encodeNodeChangesForJson(\n\tchange: NodeChangeset,\n\tcontext: FieldChangeEncodingContext,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): EncodedNodeChangeset {\n\tconst encodedChange: EncodedNodeChangeset = {};\n\t// Note: revert constraints are ignored for now because they would only be needed if we supported reverting changes made by peers.\n\tconst { fieldChanges, nodeExistsConstraint } = change;\n\n\tif (fieldChanges !== undefined) {\n\t\tencodedChange.fieldChanges = encodeFieldChangesForJsonI(\n\t\t\tfieldChanges,\n\t\t\tcontext,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t}\n\n\tif (nodeExistsConstraint !== undefined) {\n\t\tencodedChange.nodeExistsConstraint = nodeExistsConstraint;\n\t}\n\n\treturn encodedChange;\n}\n\nexport function decodeFieldChangesFromJson(\n\tencodedChange: EncodedFieldChangeMap,\n\tparentId: NodeId | undefined,\n\tdecoded: ModularChangeset,\n\tcontext: ChangeEncodingContext,\n\tidAllocator: IdAllocator,\n\tfieldKinds: FieldKindConfiguration,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): FieldChangeMap {\n\tconst decodedFields: FieldChangeMap = new Map();\n\tfor (const field of encodedChange) {\n\t\tconst { codec, compiledSchema } = getFieldChangesetCodec(\n\t\t\tfield.fieldKind,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t\tif (compiledSchema !== undefined && !compiledSchema.check(field.change)) {\n\t\t\tfail(0xb20 /* Encoded change didn't pass schema validation. */);\n\t\t}\n\n\t\tconst fieldId: FieldId = {\n\t\t\tnodeId: parentId,\n\t\t\tfield: field.fieldKey,\n\t\t};\n\n\t\tconst fieldContext: FieldChangeEncodingContext = {\n\t\t\tbaseContext: context,\n\n\t\t\tencodeNode: () => fail(0xb21 /* Should not encode nodes during field decoding */),\n\n\t\t\tdecodeNode: (encodedNode: EncodedNodeChangeset): NodeId => {\n\t\t\t\tconst nodeId: NodeId = {\n\t\t\t\t\trevision: context.revision,\n\t\t\t\t\tlocalId: brand(idAllocator.allocate()),\n\t\t\t\t};\n\n\t\t\t\tconst node = decodeNodeChangesetFromJson(\n\t\t\t\t\tencodedNode,\n\t\t\t\t\tnodeId,\n\t\t\t\t\tdecoded,\n\t\t\t\t\tcontext,\n\t\t\t\t\tidAllocator,\n\t\t\t\t\tfieldKinds,\n\t\t\t\t\tfieldChangesetCodecs,\n\t\t\t\t);\n\n\t\t\t\tdecoded.nodeChanges.set([nodeId.revision, nodeId.localId], node);\n\t\t\t\tdecoded.nodeToParent.set([nodeId.revision, nodeId.localId], fieldId);\n\t\t\t\treturn nodeId;\n\t\t\t},\n\t\t};\n\n\t\tconst fieldChangeset = codec.json.decode(field.change, fieldContext);\n\n\t\tconst crossFieldKeys = getChangeHandler(fieldKinds, field.fieldKind).getCrossFieldKeys(\n\t\t\tfieldChangeset,\n\t\t);\n\n\t\tfor (const { key, count } of crossFieldKeys) {\n\t\t\tdecoded.crossFieldKeys.set(key, count, fieldId);\n\t\t}\n\n\t\tconst fieldKey: FieldKey = brand<FieldKey>(field.fieldKey);\n\n\t\tdecodedFields.set(fieldKey, {\n\t\t\tfieldKind: field.fieldKind,\n\t\t\tchange: brand(fieldChangeset),\n\t\t});\n\t}\n\n\treturn decodedFields;\n}\n\nexport function decodeNodeChangesetFromJson(\n\tencodedChange: EncodedNodeChangeset,\n\tid: NodeId,\n\tdecoded: ModularChangeset,\n\tcontext: ChangeEncodingContext,\n\tidAllocator: IdAllocator,\n\tfieldKinds: FieldKindConfiguration,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): NodeChangeset {\n\tconst decodedChange: NodeChangeset = {};\n\tconst { fieldChanges, nodeExistsConstraint } = encodedChange;\n\n\tif (fieldChanges !== undefined) {\n\t\tdecodedChange.fieldChanges = decodeFieldChangesFromJson(\n\t\t\tfieldChanges,\n\t\t\tid,\n\t\t\tdecoded,\n\t\t\tcontext,\n\t\t\tidAllocator,\n\t\t\tfieldKinds,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t}\n\n\tif (nodeExistsConstraint !== undefined) {\n\t\tdecodedChange.nodeExistsConstraint = nodeExistsConstraint;\n\t}\n\n\treturn decodedChange;\n}\n\nexport function encodeDetachedNodes(\n\tdetachedNodes: ChangeAtomIdBTree<TreeChunk> | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): EncodedBuilds | undefined {\n\tif (detachedNodes === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst treesToEncode: ITreeCursorSynchronous[] = [];\n\tconst buildsArray: EncodedBuildsArray = [];\n\n\tlet buildsForRevision:\n\t\t| [[ChangesetLocalId, number][], EncodedRevisionTag]\n\t\t| [[ChangesetLocalId, number][]]\n\t\t| undefined;\n\n\tfor (const [[revision, id], chunk] of detachedNodes.entries()) {\n\t\tconst encodedRevision = encodeRevisionOpt(revisionTagCodec, revision, context);\n\n\t\tif (buildsForRevision === undefined || buildsForRevision[1] !== encodedRevision) {\n\t\t\tif (buildsForRevision !== undefined) {\n\t\t\t\tbuildsArray.push(buildsForRevision);\n\t\t\t}\n\n\t\t\tbuildsForRevision = encodedRevision === undefined ? [[]] : [[], encodedRevision];\n\t\t}\n\n\t\ttreesToEncode.push(chunk.cursor());\n\t\tconst treeIndexInBatch = treesToEncode.length - 1;\n\t\tbuildsForRevision?.[0].push([id, treeIndexInBatch]);\n\t}\n\n\tif (buildsForRevision !== undefined) {\n\t\tbuildsArray.push(buildsForRevision);\n\t}\n\n\treturn buildsArray.length === 0\n\t\t? undefined\n\t\t: {\n\t\t\t\tbuilds: buildsArray,\n\t\t\t\ttrees: fieldsCodec.encode(treesToEncode, {\n\t\t\t\t\tencodeType: chunkCompressionStrategy,\n\t\t\t\t\tschema: context.schema,\n\t\t\t\t\toriginatorId: context.originatorId,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t}),\n\t\t\t};\n}\n\nexport function decodeDetachedNodes(\n\tencoded: EncodedBuilds | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): ChangeAtomIdBTree<TreeChunk> | undefined {\n\tif (encoded === undefined || encoded.builds.length === 0) {\n\t\treturn undefined;\n\t}\n\n\tconst chunks = fieldsCodec.decode(encoded.trees, {\n\t\tencodeType: chunkCompressionStrategy,\n\t\toriginatorId: context.originatorId,\n\t\tidCompressor: context.idCompressor,\n\t});\n\tconst getChunk = (index: number): TreeChunk => {\n\t\tassert(index < chunks.length, 0x898 /* out of bounds index for build chunk */);\n\t\treturn chunkFieldSingle(chunks[index] ?? oob(), {\n\t\t\tpolicy: defaultChunkPolicy,\n\t\t\tidCompressor: context.idCompressor,\n\t\t});\n\t};\n\n\tconst map: ModularChangeset[\"builds\"] = newChangeAtomIdBTree();\n\t// eslint-disable-next-line unicorn/no-array-for-each -- Codec internals: minimizing changes to serialization logic\n\tencoded.builds.forEach((build) => {\n\t\t// EncodedRevisionTag cannot be an array so this ensures that we can isolate the tuple\n\t\tconst revision =\n\t\t\tbuild[1] === undefined ? context.revision : revisionTagCodec.decode(build[1], context);\n\n\t\tconst decodedChunks: [ChangesetLocalId, TreeChunk][] = build[0].map(([i, n]) => [\n\t\t\ti,\n\t\t\tgetChunk(n),\n\t\t]);\n\n\t\tfor (const [id, chunk] of decodedChunks) {\n\t\t\tmap.set([revision, id], chunk);\n\t\t}\n\t});\n\n\treturn map;\n}\n\nexport function encodeRevisionInfos(\n\trevisions: readonly RevisionInfo[],\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): EncodedRevisionInfo[] | undefined {\n\tif (context.revision !== undefined) {\n\t\tassert(\n\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- Using optional chaining here would change behavior: `revisions[0]?.rollbackOf === undefined` is true when revisions[0] is undefined, but this check requires revisions[0] to be defined. As currently written, such a change would be safe because context.revision is included in the check and from a couple lines above is confirmed not undefined. But this more verbose form is clearer.\n\t\t\trevisions.length === 1 &&\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n\t\t\t\trevisions[0] !== undefined &&\n\t\t\t\trevisions[0].revision === context.revision &&\n\t\t\t\trevisions[0].rollbackOf === undefined,\n\t\t\t0x964 /* A tagged change should only contain the tagged revision */,\n\t\t);\n\n\t\treturn undefined;\n\t}\n\n\tconst encodedRevisions = [];\n\tfor (const revision of revisions) {\n\t\tconst encodedRevision: Mutable<EncodedRevisionInfo> = {\n\t\t\trevision: revisionTagCodec.encode(revision.revision, context),\n\t\t};\n\n\t\tif (revision.rollbackOf !== undefined) {\n\t\t\tencodedRevision.rollbackOf = revisionTagCodec.encode(revision.rollbackOf, context);\n\t\t}\n\n\t\tencodedRevisions.push(encodedRevision);\n\t}\n\n\treturn encodedRevisions;\n}\n\nexport function decodeRevisionInfos(\n\trevisions: readonly EncodedRevisionInfo[] | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): RevisionInfo[] | undefined {\n\tif (revisions === undefined) {\n\t\treturn context.revision === undefined ? undefined : [{ revision: context.revision }];\n\t}\n\n\tconst decodedRevisions = [];\n\tfor (const revision of revisions) {\n\t\tconst decodedRevision: Mutable<RevisionInfo> = {\n\t\t\trevision: revisionTagCodec.decode(revision.revision, context),\n\t\t};\n\n\t\tif (revision.rollbackOf !== undefined) {\n\t\t\tdecodedRevision.rollbackOf = revisionTagCodec.decode(revision.rollbackOf, context);\n\t\t}\n\n\t\tdecodedRevisions.push(decodedRevision);\n\t}\n\n\treturn decodedRevisions;\n}\n\nexport function encodeChange(\n\tchange: ModularChangeset,\n\tcontext: ChangeEncodingContext,\n\tfieldChangesetCodecs: Map<\n\t\tFieldKindIdentifier,\n\t\t{\n\t\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\t\tcodec: FieldCodec;\n\t\t}\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): EncodedModularChangesetV1 {\n\t// Destroys only exist in rollback changesets, which are never sent.\n\tassert(change.destroys === undefined, 0x899 /* Unexpected changeset with destroys */);\n\treturn {\n\t\tmaxId: change.maxId,\n\t\trevisions:\n\t\t\tchange.revisions === undefined\n\t\t\t\t? undefined\n\t\t\t\t: encodeRevisionInfos(change.revisions, context, revisionTagCodec),\n\t\tchanges: encodeFieldChangesForJson(\n\t\t\tchange.fieldChanges,\n\t\t\tcontext,\n\t\t\tchange.nodeChanges,\n\t\t\tfieldChangesetCodecs,\n\t\t),\n\t\tbuilds: encodeDetachedNodes(\n\t\t\tchange.builds,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t),\n\t\trefreshers: encodeDetachedNodes(\n\t\t\tchange.refreshers,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t),\n\t\tviolations: change.constraintViolationCount,\n\t};\n}\n\nexport function decodeChange(\n\tencodedChange: EncodedModularChangesetV1,\n\tcontext: ChangeEncodingContext,\n\tfieldKinds: FieldKindConfiguration,\n\tfieldChangesetCodecs: Map<\n\t\tFieldKindIdentifier,\n\t\t{\n\t\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\t\tcodec: FieldCodec;\n\t\t}\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): Mutable<ModularChangeset> {\n\tconst decoded: Mutable<ModularChangeset> = {\n\t\tfieldChanges: new Map(),\n\t\tnodeChanges: newChangeAtomIdBTree(),\n\t\tnodeToParent: newChangeAtomIdBTree(),\n\t\tnodeAliases: newChangeAtomIdBTree(),\n\t\tcrossFieldKeys: newCrossFieldKeyTable(),\n\t};\n\n\tdecoded.fieldChanges = decodeFieldChangesFromJson(\n\t\tencodedChange.changes,\n\t\tundefined,\n\t\tdecoded,\n\t\tcontext,\n\t\tidAllocatorFromMaxId(encodedChange.maxId),\n\t\tfieldKinds,\n\t\tfieldChangesetCodecs,\n\t);\n\n\tif (encodedChange.builds !== undefined) {\n\t\tdecoded.builds = decodeDetachedNodes(\n\t\t\tencodedChange.builds,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t);\n\t}\n\tif (encodedChange.refreshers !== undefined) {\n\t\tdecoded.refreshers = decodeDetachedNodes(\n\t\t\tencodedChange.refreshers,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t);\n\t}\n\n\tif (encodedChange.violations !== undefined) {\n\t\tdecoded.constraintViolationCount = encodedChange.violations;\n\t}\n\n\tconst decodedRevInfos = decodeRevisionInfos(\n\t\tencodedChange.revisions,\n\t\tcontext,\n\t\trevisionTagCodec,\n\t);\n\tif (decodedRevInfos !== undefined) {\n\t\tdecoded.revisions = decodedRevInfos;\n\t}\n\tif (encodedChange.maxId !== undefined) {\n\t\tdecoded.maxId = encodedChange.maxId;\n\t}\n\treturn decoded;\n}\n\nexport function getFieldChangesetCodecs(\n\tfieldKinds: FieldKindConfiguration,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tcodecOptions: ICodecOptions,\n): Map<\n\tFieldKindIdentifier,\n\t{ compiledSchema?: SchemaValidationFunction<TAnySchema>; codec: FieldCodec }\n> {\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tconst getMapEntry = ({ kind, formatVersion }: FieldKindConfigurationEntry) => {\n\t\tconst codec = kind.changeHandler.codecsFactory(revisionTagCodec).resolve(formatVersion);\n\t\treturn {\n\t\t\tcodec,\n\t\t\tcompiledSchema: codec.json.encodedSchema\n\t\t\t\t? extractJsonValidator(codecOptions.jsonValidator).compile(codec.json.encodedSchema)\n\t\t\t\t: undefined,\n\t\t};\n\t};\n\n\t/**\n\t * The codec version for the generic field kind.\n\t */\n\tconst genericFieldKindFormatVersion = 1;\n\tconst fieldChangesetCodecs: Map<\n\t\tFieldKindIdentifier,\n\t\t{\n\t\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\t\tcodec: FieldCodec;\n\t\t}\n\t> = new Map([\n\t\t[\n\t\t\tgenericFieldKind.identifier,\n\t\t\tgetMapEntry({ kind: genericFieldKind, formatVersion: genericFieldKindFormatVersion }),\n\t\t],\n\t]);\n\n\t// eslint-disable-next-line unicorn/no-array-for-each -- Map.forEach with (value, key) signature; codec initialization\n\tfieldKinds.forEach((entry, identifier) => {\n\t\tfieldChangesetCodecs.set(identifier, getMapEntry(entry));\n\t});\n\n\treturn fieldChangesetCodecs;\n}\n\nexport function makeModularChangeCodecV1(\n\tfieldKinds: FieldKindConfiguration,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tcodecOptions: ICodecOptions,\n\tchunkCompressionStrategy: TreeCompressionStrategy = TreeCompressionStrategy.Compressed,\n): ModularChangeCodec {\n\tconst fieldChangesetCodecs = getFieldChangesetCodecs(\n\t\tfieldKinds,\n\t\trevisionTagCodec,\n\t\tcodecOptions,\n\t);\n\n\tconst modularChangeCodec: ModularChangeCodec = {\n\t\tencode: (change, context) =>\n\t\t\tencodeChange(\n\t\t\t\tchange,\n\t\t\t\tcontext,\n\t\t\t\tfieldChangesetCodecs,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tfieldsCodec,\n\t\t\t\tchunkCompressionStrategy,\n\t\t\t),\n\t\tdecode: (encodedChange, context) =>\n\t\t\tdecodeChange(\n\t\t\t\tencodedChange,\n\t\t\t\tcontext,\n\t\t\t\tfieldKinds,\n\t\t\t\tfieldChangesetCodecs,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tfieldsCodec,\n\t\t\t\tchunkCompressionStrategy,\n\t\t\t),\n\t};\n\n\treturn withSchemaValidation(\n\t\tEncodedModularChangesetV1,\n\t\tmodularChangeCodec,\n\t\tcodecOptions.jsonValidator,\n\t);\n}\n\nfunction getChangeHandler(\n\tfieldKinds: FieldKindConfiguration,\n\tfieldKind: FieldKindIdentifier,\n): FieldChangeHandler<unknown> {\n\tif (fieldKind === genericFieldKind.identifier) {\n\t\treturn genericFieldKind.changeHandler;\n\t}\n\n\tconst handler = fieldKinds.get(fieldKind)?.kind.changeHandler;\n\tassert(handler !== undefined, 0x9c1 /* Unknown field kind */);\n\treturn handler;\n}\n\nfunction encodeRevisionOpt(\n\trevisionCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\trevision: RevisionTag | undefined,\n\tcontext: ChangeEncodingContext,\n): EncodedRevisionTag | undefined {\n\tif (revision === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn revision === context.revision ? undefined : revisionCodec.encode(revision, context);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"modularChangeCodecV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeCodecV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAGxE,OAAO,EAIN,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAW9B,OAAO,EAIN,KAAK,EACL,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAA0B,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAGN,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAOrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAKN,yBAAyB,GAGzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEN,qBAAqB,GAMrB,MAAM,yBAAyB,CAAC;AAwBjC,MAAM,UAAU,sBAAsB,CACrC,SAA8B,EAC9B,oBAA0C;IAK1C,MAAM,KAAK,GAAG,oBAAoB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/E,OAAO,KAAK,CAAC;AACd,CAAC;AAED,MAAM,UAAU,yBAAyB,CACxC,MAAsB,EACtB,OAA8B,EAC9B,WAA6C,EAC7C,oBAA0C;IAE1C,MAAM,YAAY,GAA+B;QAChD,WAAW,EAAE,OAAO;QAEpB,UAAU,EAAE,CAAC,MAAc,EAAwB,EAAE;YACpD,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,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B;KACF,CAAC;IAEF,OAAO,oBAAoB,CAC1B,yBAAyB,EACzB,kBAAkB,EAClB,YAAY,CAAC,aAAa,CAC1B,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CACxB,UAAkC,EAClC,SAA8B;IAE9B,IAAI,SAAS,KAAK,gBAAgB,CAAC,UAAU,EAAE,CAAC;QAC/C,OAAO,gBAAgB,CAAC,aAAa,CAAC;IACvC,CAAC;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC;IAC9D,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC9D,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,SAAS,iBAAiB,CACzB,aAKC,EACD,QAAiC,EACjC,OAA8B;IAE9B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,OAAO,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob, fail } from \"@fluidframework/core-utils/internal\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport {\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\ttype SchemaValidationFunction,\n\textractJsonValidator,\n\twithSchemaValidation,\n} from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tFieldKey,\n\tFieldKindIdentifier,\n\tITreeCursorSynchronous,\n\tRevisionInfo,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport {\n\ttype IdAllocator,\n\ttype JsonCompatibleReadOnly,\n\ttype Mutable,\n\tbrand,\n\tidAllocatorFromMaxId,\n} from \"../../util/index.js\";\nimport { newChangeAtomIdBTree, type ChangeAtomIdBTree } from \"../changeAtomIdBTree.js\";\nimport {\n\ttype FieldBatchCodec,\n\ttype TreeChunk,\n\tchunkFieldSingle,\n\tdefaultChunkPolicy,\n} from \"../chunked-forest/index.js\";\nimport { TreeCompressionStrategy } from \"../treeCompressionUtils.js\";\n\nimport type { FieldChangeEncodingContext, FieldChangeHandler } from \"./fieldChangeHandler.js\";\nimport type {\n\tFieldKindConfiguration,\n\tFieldKindConfigurationEntry,\n} from \"./fieldKindConfiguration.js\";\nimport { genericFieldKind } from \"./genericFieldKind.js\";\nimport {\n\ttype EncodedBuilds,\n\ttype EncodedBuildsArray,\n\ttype EncodedFieldChange,\n\ttype EncodedFieldChangeMap,\n\tEncodedModularChangesetV1,\n\ttype EncodedNodeChangeset,\n\ttype EncodedRevisionInfo,\n} from \"./modularChangeFormatV1.js\";\nimport {\n\ttype FieldChangeset,\n\tnewCrossFieldKeyTable,\n\ttype FieldChangeMap,\n\ttype FieldId,\n\ttype ModularChangeset,\n\ttype NodeChangeset,\n\ttype NodeId,\n} from \"./modularChangeTypes.js\";\n\ntype ModularChangeCodec = IJsonCodec<\n\tModularChangeset,\n\tEncodedModularChangesetV1,\n\tEncodedModularChangesetV1,\n\tChangeEncodingContext\n>;\n\ntype FieldCodec = IJsonCodec<\n\tFieldChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n>;\n\ntype FieldChangesetCodecs = Map<\n\tFieldKindIdentifier,\n\t{\n\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\tcodec: FieldCodec;\n\t}\n>;\n\nexport function getFieldChangesetCodec(\n\tfieldKind: FieldKindIdentifier,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): {\n\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\tcodec: FieldCodec;\n} {\n\tconst entry = fieldChangesetCodecs.get(fieldKind);\n\tassert(entry !== undefined, 0x5ea /* Tried to encode unsupported fieldKind */);\n\treturn entry;\n}\n\nexport function encodeFieldChangesForJson(\n\tchange: FieldChangeMap,\n\tcontext: ChangeEncodingContext,\n\tnodeChanges: ChangeAtomIdBTree<NodeChangeset>,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): EncodedFieldChangeMap {\n\tconst fieldContext: FieldChangeEncodingContext = {\n\t\tbaseContext: context,\n\n\t\tencodeNode: (nodeId: NodeId): EncodedNodeChangeset => {\n\t\t\tconst node = nodeChanges.get([nodeId.revision, nodeId.localId]);\n\t\t\tassert(node !== undefined, 0x92e /* Unknown node ID */);\n\t\t\treturn encodeNodeChangesForJson(node, fieldContext, fieldChangesetCodecs);\n\t\t},\n\n\t\tdecodeNode: () => fail(0xb1e /* Should not decode nodes during field encoding */),\n\t};\n\n\treturn encodeFieldChangesForJsonI(change, fieldContext, fieldChangesetCodecs);\n}\n\nexport function encodeFieldChangesForJsonI(\n\tchange: FieldChangeMap,\n\tcontext: FieldChangeEncodingContext,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): EncodedFieldChangeMap {\n\tconst encodedFields: EncodedFieldChangeMap = [];\n\n\tfor (const [field, fieldChange] of change) {\n\t\tconst { codec, compiledSchema } = getFieldChangesetCodec(\n\t\t\tfieldChange.fieldKind,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t\tconst encodedChange = codec.encode(fieldChange.change, context);\n\t\tif (compiledSchema !== undefined && !compiledSchema.check(encodedChange)) {\n\t\t\tfail(0xb1f /* Encoded change didn't pass schema validation. */);\n\t\t}\n\n\t\tconst fieldKey: FieldKey = field;\n\t\tconst encodedField: EncodedFieldChange = {\n\t\t\tfieldKey,\n\t\t\tfieldKind: fieldChange.fieldKind,\n\t\t\tchange: encodedChange,\n\t\t};\n\n\t\tencodedFields.push(encodedField);\n\t}\n\n\treturn encodedFields;\n}\n\nexport function encodeNodeChangesForJson(\n\tchange: NodeChangeset,\n\tcontext: FieldChangeEncodingContext,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): EncodedNodeChangeset {\n\tconst encodedChange: EncodedNodeChangeset = {};\n\t// Note: revert constraints are ignored for now because they would only be needed if we supported reverting changes made by peers.\n\tconst { fieldChanges, nodeExistsConstraint } = change;\n\n\tif (fieldChanges !== undefined) {\n\t\tencodedChange.fieldChanges = encodeFieldChangesForJsonI(\n\t\t\tfieldChanges,\n\t\t\tcontext,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t}\n\n\tif (nodeExistsConstraint !== undefined) {\n\t\tencodedChange.nodeExistsConstraint = nodeExistsConstraint;\n\t}\n\n\treturn encodedChange;\n}\n\nexport function decodeFieldChangesFromJson(\n\tencodedChange: EncodedFieldChangeMap,\n\tparentId: NodeId | undefined,\n\tdecoded: ModularChangeset,\n\tcontext: ChangeEncodingContext,\n\tidAllocator: IdAllocator,\n\tfieldKinds: FieldKindConfiguration,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): FieldChangeMap {\n\tconst decodedFields: FieldChangeMap = new Map();\n\tfor (const field of encodedChange) {\n\t\tconst { codec, compiledSchema } = getFieldChangesetCodec(\n\t\t\tfield.fieldKind,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t\tif (compiledSchema !== undefined && !compiledSchema.check(field.change)) {\n\t\t\tfail(0xb20 /* Encoded change didn't pass schema validation. */);\n\t\t}\n\n\t\tconst fieldId: FieldId = {\n\t\t\tnodeId: parentId,\n\t\t\tfield: field.fieldKey,\n\t\t};\n\n\t\tconst fieldContext: FieldChangeEncodingContext = {\n\t\t\tbaseContext: context,\n\n\t\t\tencodeNode: () => fail(0xb21 /* Should not encode nodes during field decoding */),\n\n\t\t\tdecodeNode: (encodedNode: EncodedNodeChangeset): NodeId => {\n\t\t\t\tconst nodeId: NodeId = {\n\t\t\t\t\trevision: context.revision,\n\t\t\t\t\tlocalId: brand(idAllocator.allocate()),\n\t\t\t\t};\n\n\t\t\t\tconst node = decodeNodeChangesetFromJson(\n\t\t\t\t\tencodedNode,\n\t\t\t\t\tnodeId,\n\t\t\t\t\tdecoded,\n\t\t\t\t\tcontext,\n\t\t\t\t\tidAllocator,\n\t\t\t\t\tfieldKinds,\n\t\t\t\t\tfieldChangesetCodecs,\n\t\t\t\t);\n\n\t\t\t\tdecoded.nodeChanges.set([nodeId.revision, nodeId.localId], node);\n\t\t\t\tdecoded.nodeToParent.set([nodeId.revision, nodeId.localId], fieldId);\n\t\t\t\treturn nodeId;\n\t\t\t},\n\t\t};\n\n\t\tconst fieldChangeset = codec.decode(field.change, fieldContext);\n\n\t\tconst crossFieldKeys = getChangeHandler(fieldKinds, field.fieldKind).getCrossFieldKeys(\n\t\t\tfieldChangeset,\n\t\t);\n\n\t\tfor (const { key, count } of crossFieldKeys) {\n\t\t\tdecoded.crossFieldKeys.set(key, count, fieldId);\n\t\t}\n\n\t\tconst fieldKey: FieldKey = brand<FieldKey>(field.fieldKey);\n\n\t\tdecodedFields.set(fieldKey, {\n\t\t\tfieldKind: field.fieldKind,\n\t\t\tchange: brand(fieldChangeset),\n\t\t});\n\t}\n\n\treturn decodedFields;\n}\n\nexport function decodeNodeChangesetFromJson(\n\tencodedChange: EncodedNodeChangeset,\n\tid: NodeId,\n\tdecoded: ModularChangeset,\n\tcontext: ChangeEncodingContext,\n\tidAllocator: IdAllocator,\n\tfieldKinds: FieldKindConfiguration,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): NodeChangeset {\n\tconst decodedChange: NodeChangeset = {};\n\tconst { fieldChanges, nodeExistsConstraint } = encodedChange;\n\n\tif (fieldChanges !== undefined) {\n\t\tdecodedChange.fieldChanges = decodeFieldChangesFromJson(\n\t\t\tfieldChanges,\n\t\t\tid,\n\t\t\tdecoded,\n\t\t\tcontext,\n\t\t\tidAllocator,\n\t\t\tfieldKinds,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t}\n\n\tif (nodeExistsConstraint !== undefined) {\n\t\tdecodedChange.nodeExistsConstraint = nodeExistsConstraint;\n\t}\n\n\treturn decodedChange;\n}\n\nexport function encodeDetachedNodes(\n\tdetachedNodes: ChangeAtomIdBTree<TreeChunk> | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): EncodedBuilds | undefined {\n\tif (detachedNodes === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst treesToEncode: ITreeCursorSynchronous[] = [];\n\tconst buildsArray: EncodedBuildsArray = [];\n\n\tlet buildsForRevision:\n\t\t| [[ChangesetLocalId, number][], EncodedRevisionTag]\n\t\t| [[ChangesetLocalId, number][]]\n\t\t| undefined;\n\n\tfor (const [[revision, id], chunk] of detachedNodes.entries()) {\n\t\tconst encodedRevision = encodeRevisionOpt(revisionTagCodec, revision, context);\n\n\t\tif (buildsForRevision === undefined || buildsForRevision[1] !== encodedRevision) {\n\t\t\tif (buildsForRevision !== undefined) {\n\t\t\t\tbuildsArray.push(buildsForRevision);\n\t\t\t}\n\n\t\t\tbuildsForRevision = encodedRevision === undefined ? [[]] : [[], encodedRevision];\n\t\t}\n\n\t\ttreesToEncode.push(chunk.cursor());\n\t\tconst treeIndexInBatch = treesToEncode.length - 1;\n\t\tbuildsForRevision?.[0].push([id, treeIndexInBatch]);\n\t}\n\n\tif (buildsForRevision !== undefined) {\n\t\tbuildsArray.push(buildsForRevision);\n\t}\n\n\treturn buildsArray.length === 0\n\t\t? undefined\n\t\t: {\n\t\t\t\tbuilds: buildsArray,\n\t\t\t\ttrees: fieldsCodec.encode(treesToEncode, {\n\t\t\t\t\tencodeType: chunkCompressionStrategy,\n\t\t\t\t\tschema: context.schema,\n\t\t\t\t\toriginatorId: context.originatorId,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t}),\n\t\t\t};\n}\n\nexport function decodeDetachedNodes(\n\tencoded: EncodedBuilds | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): ChangeAtomIdBTree<TreeChunk> | undefined {\n\tif (encoded === undefined || encoded.builds.length === 0) {\n\t\treturn undefined;\n\t}\n\n\tconst chunks = fieldsCodec.decode(encoded.trees, {\n\t\tencodeType: chunkCompressionStrategy,\n\t\toriginatorId: context.originatorId,\n\t\tidCompressor: context.idCompressor,\n\t});\n\tconst getChunk = (index: number): TreeChunk => {\n\t\tassert(index < chunks.length, 0x898 /* out of bounds index for build chunk */);\n\t\treturn chunkFieldSingle(chunks[index] ?? oob(), {\n\t\t\tpolicy: defaultChunkPolicy,\n\t\t\tidCompressor: context.idCompressor,\n\t\t});\n\t};\n\n\tconst map: ModularChangeset[\"builds\"] = newChangeAtomIdBTree();\n\t// eslint-disable-next-line unicorn/no-array-for-each -- Codec internals: minimizing changes to serialization logic\n\tencoded.builds.forEach((build) => {\n\t\t// EncodedRevisionTag cannot be an array so this ensures that we can isolate the tuple\n\t\tconst revision =\n\t\t\tbuild[1] === undefined ? context.revision : revisionTagCodec.decode(build[1], context);\n\n\t\tconst decodedChunks: [ChangesetLocalId, TreeChunk][] = build[0].map(([i, n]) => [\n\t\t\ti,\n\t\t\tgetChunk(n),\n\t\t]);\n\n\t\tfor (const [id, chunk] of decodedChunks) {\n\t\t\tmap.set([revision, id], chunk);\n\t\t}\n\t});\n\n\treturn map;\n}\n\nexport function encodeRevisionInfos(\n\trevisions: readonly RevisionInfo[],\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): EncodedRevisionInfo[] | undefined {\n\tif (context.revision !== undefined) {\n\t\tassert(\n\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- Using optional chaining here would change behavior: `revisions[0]?.rollbackOf === undefined` is true when revisions[0] is undefined, but this check requires revisions[0] to be defined. As currently written, such a change would be safe because context.revision is included in the check and from a couple lines above is confirmed not undefined. But this more verbose form is clearer.\n\t\t\trevisions.length === 1 &&\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n\t\t\t\trevisions[0] !== undefined &&\n\t\t\t\trevisions[0].revision === context.revision &&\n\t\t\t\trevisions[0].rollbackOf === undefined,\n\t\t\t0x964 /* A tagged change should only contain the tagged revision */,\n\t\t);\n\n\t\treturn undefined;\n\t}\n\n\tconst encodedRevisions = [];\n\tfor (const revision of revisions) {\n\t\tconst encodedRevision: Mutable<EncodedRevisionInfo> = {\n\t\t\trevision: revisionTagCodec.encode(revision.revision, context),\n\t\t};\n\n\t\tif (revision.rollbackOf !== undefined) {\n\t\t\tencodedRevision.rollbackOf = revisionTagCodec.encode(revision.rollbackOf, context);\n\t\t}\n\n\t\tencodedRevisions.push(encodedRevision);\n\t}\n\n\treturn encodedRevisions;\n}\n\nexport function decodeRevisionInfos(\n\trevisions: readonly EncodedRevisionInfo[] | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): RevisionInfo[] | undefined {\n\tif (revisions === undefined) {\n\t\treturn context.revision === undefined ? undefined : [{ revision: context.revision }];\n\t}\n\n\tconst decodedRevisions = [];\n\tfor (const revision of revisions) {\n\t\tconst decodedRevision: Mutable<RevisionInfo> = {\n\t\t\trevision: revisionTagCodec.decode(revision.revision, context),\n\t\t};\n\n\t\tif (revision.rollbackOf !== undefined) {\n\t\t\tdecodedRevision.rollbackOf = revisionTagCodec.decode(revision.rollbackOf, context);\n\t\t}\n\n\t\tdecodedRevisions.push(decodedRevision);\n\t}\n\n\treturn decodedRevisions;\n}\n\nexport function encodeChange(\n\tchange: ModularChangeset,\n\tcontext: ChangeEncodingContext,\n\tfieldChangesetCodecs: Map<\n\t\tFieldKindIdentifier,\n\t\t{\n\t\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\t\tcodec: FieldCodec;\n\t\t}\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): EncodedModularChangesetV1 {\n\t// Destroys only exist in rollback changesets, which are never sent.\n\tassert(change.destroys === undefined, 0x899 /* Unexpected changeset with destroys */);\n\treturn {\n\t\tmaxId: change.maxId,\n\t\trevisions:\n\t\t\tchange.revisions === undefined\n\t\t\t\t? undefined\n\t\t\t\t: encodeRevisionInfos(change.revisions, context, revisionTagCodec),\n\t\tchanges: encodeFieldChangesForJson(\n\t\t\tchange.fieldChanges,\n\t\t\tcontext,\n\t\t\tchange.nodeChanges,\n\t\t\tfieldChangesetCodecs,\n\t\t),\n\t\tbuilds: encodeDetachedNodes(\n\t\t\tchange.builds,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t),\n\t\trefreshers: encodeDetachedNodes(\n\t\t\tchange.refreshers,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t),\n\t\tviolations: change.constraintViolationCount,\n\t};\n}\n\nexport function decodeChange(\n\tencodedChange: EncodedModularChangesetV1,\n\tcontext: ChangeEncodingContext,\n\tfieldKinds: FieldKindConfiguration,\n\tfieldChangesetCodecs: Map<\n\t\tFieldKindIdentifier,\n\t\t{\n\t\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\t\tcodec: FieldCodec;\n\t\t}\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): Mutable<ModularChangeset> {\n\tconst decoded: Mutable<ModularChangeset> = {\n\t\tfieldChanges: new Map(),\n\t\tnodeChanges: newChangeAtomIdBTree(),\n\t\tnodeToParent: newChangeAtomIdBTree(),\n\t\tnodeAliases: newChangeAtomIdBTree(),\n\t\tcrossFieldKeys: newCrossFieldKeyTable(),\n\t};\n\n\tdecoded.fieldChanges = decodeFieldChangesFromJson(\n\t\tencodedChange.changes,\n\t\tundefined,\n\t\tdecoded,\n\t\tcontext,\n\t\tidAllocatorFromMaxId(encodedChange.maxId),\n\t\tfieldKinds,\n\t\tfieldChangesetCodecs,\n\t);\n\n\tif (encodedChange.builds !== undefined) {\n\t\tdecoded.builds = decodeDetachedNodes(\n\t\t\tencodedChange.builds,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t);\n\t}\n\tif (encodedChange.refreshers !== undefined) {\n\t\tdecoded.refreshers = decodeDetachedNodes(\n\t\t\tencodedChange.refreshers,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t);\n\t}\n\n\tif (encodedChange.violations !== undefined) {\n\t\tdecoded.constraintViolationCount = encodedChange.violations;\n\t}\n\n\tconst decodedRevInfos = decodeRevisionInfos(\n\t\tencodedChange.revisions,\n\t\tcontext,\n\t\trevisionTagCodec,\n\t);\n\tif (decodedRevInfos !== undefined) {\n\t\tdecoded.revisions = decodedRevInfos;\n\t}\n\tif (encodedChange.maxId !== undefined) {\n\t\tdecoded.maxId = encodedChange.maxId;\n\t}\n\treturn decoded;\n}\n\nexport function getFieldChangesetCodecs(\n\tfieldKinds: FieldKindConfiguration,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tcodecOptions: ICodecOptions,\n): Map<\n\tFieldKindIdentifier,\n\t{ compiledSchema?: SchemaValidationFunction<TAnySchema>; codec: FieldCodec }\n> {\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tconst getMapEntry = ({ kind, formatVersion }: FieldKindConfigurationEntry) => {\n\t\tconst codec = kind.changeHandler.codecsFactory(revisionTagCodec).resolve(formatVersion);\n\t\treturn {\n\t\t\tcodec,\n\t\t\tcompiledSchema: codec.encodedSchema\n\t\t\t\t? extractJsonValidator(codecOptions.jsonValidator).compile(codec.encodedSchema)\n\t\t\t\t: undefined,\n\t\t};\n\t};\n\n\t/**\n\t * The codec version for the generic field kind.\n\t */\n\tconst genericFieldKindFormatVersion = 1;\n\tconst fieldChangesetCodecs: Map<\n\t\tFieldKindIdentifier,\n\t\t{\n\t\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\t\tcodec: FieldCodec;\n\t\t}\n\t> = new Map([\n\t\t[\n\t\t\tgenericFieldKind.identifier,\n\t\t\tgetMapEntry({ kind: genericFieldKind, formatVersion: genericFieldKindFormatVersion }),\n\t\t],\n\t]);\n\n\t// eslint-disable-next-line unicorn/no-array-for-each -- Map.forEach with (value, key) signature; codec initialization\n\tfieldKinds.forEach((entry, identifier) => {\n\t\tfieldChangesetCodecs.set(identifier, getMapEntry(entry));\n\t});\n\n\treturn fieldChangesetCodecs;\n}\n\nexport function makeModularChangeCodecV1(\n\tfieldKinds: FieldKindConfiguration,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tcodecOptions: ICodecOptions,\n\tchunkCompressionStrategy: TreeCompressionStrategy = TreeCompressionStrategy.Compressed,\n): ModularChangeCodec {\n\tconst fieldChangesetCodecs = getFieldChangesetCodecs(\n\t\tfieldKinds,\n\t\trevisionTagCodec,\n\t\tcodecOptions,\n\t);\n\n\tconst modularChangeCodec: ModularChangeCodec = {\n\t\tencode: (change, context) =>\n\t\t\tencodeChange(\n\t\t\t\tchange,\n\t\t\t\tcontext,\n\t\t\t\tfieldChangesetCodecs,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tfieldsCodec,\n\t\t\t\tchunkCompressionStrategy,\n\t\t\t),\n\t\tdecode: (encodedChange, context) =>\n\t\t\tdecodeChange(\n\t\t\t\tencodedChange,\n\t\t\t\tcontext,\n\t\t\t\tfieldKinds,\n\t\t\t\tfieldChangesetCodecs,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tfieldsCodec,\n\t\t\t\tchunkCompressionStrategy,\n\t\t\t),\n\t};\n\n\treturn withSchemaValidation(\n\t\tEncodedModularChangesetV1,\n\t\tmodularChangeCodec,\n\t\tcodecOptions.jsonValidator,\n\t);\n}\n\nfunction getChangeHandler(\n\tfieldKinds: FieldKindConfiguration,\n\tfieldKind: FieldKindIdentifier,\n): FieldChangeHandler<unknown> {\n\tif (fieldKind === genericFieldKind.identifier) {\n\t\treturn genericFieldKind.changeHandler;\n\t}\n\n\tconst handler = fieldKinds.get(fieldKind)?.kind.changeHandler;\n\tassert(handler !== undefined, 0x9c1 /* Unknown field kind */);\n\treturn handler;\n}\n\nfunction encodeRevisionOpt(\n\trevisionCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\trevision: RevisionTag | undefined,\n\tcontext: ChangeEncodingContext,\n): EncodedRevisionTag | undefined {\n\tif (revision === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn revision === context.revision ? undefined : revisionCodec.encode(revision, context);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,oCAAoC,EACpC,KAAK,iBAAiB,EAEtB,KAAK,UAAU,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,mBAAmB,EAGnB,KAAK,gBAAgB,EAKrB,MAAM,qBAAqB,CAAC;AAM7B;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,oBAAoB,CAAC,EAAE,mBAAmB,GACxC,UAAU,CAAC,gBAAgB,CAAC,CAM9B;AA0ED;;GAEG;AACH,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,oCAAoC,EACpC,KAAK,iBAAiB,EAEtB,KAAK,UAAU,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,mBAAmB,EAGnB,KAAK,gBAAgB,EAKrB,MAAM,qBAAqB,CAAC;AAM7B;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,oBAAoB,CAAC,EAAE,mBAAmB,GACxC,UAAU,CAAC,gBAAgB,CAAC,CAM9B;AA0ED;;GAEG;AACH,eAAO,MAAM,kBAAkB,0NAmB7B,CAAC"}
|
|
@@ -92,8 +92,9 @@ function decodeV2(f) {
|
|
|
92
92
|
/**
|
|
93
93
|
* Creates a codec which performs synchronous monolithic encoding of schema content.
|
|
94
94
|
*/
|
|
95
|
-
export const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Schema",
|
|
96
|
-
|
|
95
|
+
export const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Schema", [
|
|
96
|
+
{
|
|
97
|
+
minVersionForCollab: lowestMinVersionForCollab,
|
|
97
98
|
formatVersion: SchemaFormatVersion.v1,
|
|
98
99
|
codec: {
|
|
99
100
|
encode: (data) => encodeRepoV1(data),
|
|
@@ -101,7 +102,8 @@ export const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Sc
|
|
|
101
102
|
schema: FormatV1,
|
|
102
103
|
},
|
|
103
104
|
},
|
|
104
|
-
|
|
105
|
+
{
|
|
106
|
+
minVersionForCollab: FluidClientVersion.v2_43,
|
|
105
107
|
formatVersion: SchemaFormatVersion.v2,
|
|
106
108
|
codec: {
|
|
107
109
|
encode: (data) => encodeRepoV2(data),
|
|
@@ -109,5 +111,5 @@ export const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Sc
|
|
|
109
111
|
schema: FormatV2,
|
|
110
112
|
},
|
|
111
113
|
},
|
|
112
|
-
|
|
114
|
+
]);
|
|
113
115
|
//# sourceMappingURL=codec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAEnF,OAAO,EACN,oCAAoC,EAEpC,kBAAkB,GAElB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,mBAAmB,EAInB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eA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AAyB;QAC9C,aAAa,EAAE,mBAAmB,CAAC,EAAE;QACrC,KAAK,EAAE;YACN,MAAM,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC;YACtD,MAAM,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC1C,MAAM,EAAE,QAAQ;SAChB;KACD;IACD;QACC,mBAAmB,EAAE,kBAAkB,CAAC,KAAK;QAC7C,aAAa,EAAE,mBAAmB,CAAC,EAAE;QACrC,KAAK,EAAE;YACN,MAAM,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC;YACtD,MAAM,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC1C,MAAM,EAAE,QAAQ;SAChB;KACD;CACD,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport { lowestMinVersionForCollab } from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\tClientVersionDispatchingCodecBuilder,\n\ttype CodecWriteOptions,\n\tFluidClientVersion,\n\ttype IJsonCodec,\n} from \"../../codec/index.js\";\nimport {\n\tSchemaFormatVersion,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchemaV1,\n\tencodeFieldSchemaV2,\n\tstoredSchemaDecodeDispatcher,\n} from \"../../core/index.js\";\nimport { brand } from \"../../util/index.js\";\n\nimport { Format as FormatV1 } from \"./formatV1.js\";\nimport { Format as FormatV2 } from \"./formatV2.js\";\n\n/**\n * Create a schema codec.\n * @param options - Specifies common codec options, including `minVersionForCollab` and which `validator` to use.\n * @param writeVersionOverride - The schema version to write. If not provided, the version will be derived from `minVersionForCollab`.\n * TODO: Currently this parameter is provided when it probably should not be. Users of it should probably allow the automatic selection to occur and this parameter can be removed.\n * Any case where an override is actually required can use `options` to do so.\n * @returns The composed codec.\n *\n * @privateRemarks We should consider using the Shared Tree format version instead as it may be more valuable for application authors than the schema version.\n *\n * TODO: replace use of this with schemaCodecBuilder.build(...).\n */\nexport function makeSchemaCodec(\n\toptions: CodecWriteOptions,\n\twriteVersionOverride?: SchemaFormatVersion,\n): IJsonCodec<TreeStoredSchema> {\n\tconst overrides = new Map(options.writeVersionOverrides ?? []);\n\tif (writeVersionOverride !== undefined) {\n\t\toverrides.set(schemaCodecBuilder.name, writeVersionOverride);\n\t}\n\treturn schemaCodecBuilder.build({ ...options, writeVersionOverrides: overrides });\n}\n\nfunction encodeRepoV1(repo: TreeStoredSchema): FormatV1 {\n\tconst nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV1());\n\tconst rootFieldSchema = encodeFieldSchemaV1(repo.rootFieldSchema);\n\treturn {\n\t\tversion: SchemaFormatVersion.v1,\n\t\tnodes: nodeSchema,\n\t\troot: rootFieldSchema,\n\t};\n}\n\nfunction encodeRepoV2(repo: TreeStoredSchema): FormatV2 {\n\tconst nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV2());\n\tconst rootFieldSchema = encodeFieldSchemaV2(repo.rootFieldSchema);\n\treturn {\n\t\tversion: SchemaFormatVersion.v2,\n\t\tnodes: nodeSchema,\n\t\troot: rootFieldSchema,\n\t};\n}\n\n/**\n * Shared logic for encoding node schemas.\n * @param repo - The stored schema to encode.\n * @param encodeValue - A function which encodes a single node schema.\n * @returns The encoded node schema.\n */\nfunction encodeNodeSchema<TFormat>(\n\trepo: TreeStoredSchema,\n\tencodeValue: (schema: TreeNodeStoredSchema) => TFormat,\n): Record<string, TFormat> {\n\tconst nodeSchema: Record<string, TFormat> = Object.create(null) as Record<string, TFormat>;\n\tfor (const name of [...repo.nodeSchema.keys()].sort()) {\n\t\tconst schema = repo.nodeSchema.get(name) ?? fail(0xb28 /* missing schema */);\n\t\tObject.defineProperty(nodeSchema, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tvalue: encodeValue(schema),\n\t\t});\n\t}\n\n\treturn nodeSchema;\n}\n\nfunction decodeV1(f: FormatV1): TreeStoredSchema {\n\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();\n\tfor (const [key, schema] of Object.entries(f.nodes)) {\n\t\tconst storedSchemaDecoder = storedSchemaDecodeDispatcher.dispatch(schema);\n\n\t\t// No metadata in v1, so pass undefined\n\t\tnodeSchema.set(brand(key), storedSchemaDecoder(undefined));\n\t}\n\treturn {\n\t\trootFieldSchema: decodeFieldSchema(f.root),\n\t\tnodeSchema,\n\t};\n}\n\nfunction decodeV2(f: FormatV2): TreeStoredSchema {\n\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();\n\tfor (const [key, schema] of Object.entries(f.nodes)) {\n\t\tconst storedSchemaDecoder = storedSchemaDecodeDispatcher.dispatch(schema.kind);\n\n\t\t// Pass in the node metadata\n\t\tnodeSchema.set(brand(key), storedSchemaDecoder(schema.metadata));\n\t}\n\treturn {\n\t\trootFieldSchema: decodeFieldSchema(f.root),\n\t\tnodeSchema,\n\t};\n}\n\n/**\n * Creates a codec which performs synchronous monolithic encoding of schema content.\n */\nexport const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build(\"Schema\", [\n\t{\n\t\tminVersionForCollab: lowestMinVersionForCollab,\n\t\tformatVersion: SchemaFormatVersion.v1,\n\t\tcodec: {\n\t\t\tencode: (data: TreeStoredSchema) => encodeRepoV1(data),\n\t\t\tdecode: (data: FormatV1) => decodeV1(data),\n\t\t\tschema: FormatV1,\n\t\t},\n\t},\n\t{\n\t\tminVersionForCollab: FluidClientVersion.v2_43,\n\t\tformatVersion: SchemaFormatVersion.v2,\n\t\tcodec: {\n\t\t\tencode: (data: TreeStoredSchema) => encodeRepoV2(data),\n\t\t\tdecode: (data: FormatV2) => decodeV2(data),\n\t\t\tschema: FormatV2,\n\t\t},\n\t},\n]);\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export type Listenable<T extends object> = EventListenable<T>;
|
|
|
30
30
|
export type Off = EventOff;
|
|
31
31
|
export { TreeStatus, TreeCompressionStrategy, type TreeIndex, type TreeIndexKey, type TreeIndexNodes, type IncrementalEncodingPolicy, } from "./feature-libraries/index.js";
|
|
32
32
|
export { type ITreeInternal, type SharedTreeOptions, type SharedTreeOptionsBeta, type ForestType, type SharedTreeFormatOptions, Tree, type RunTransaction, type ForestOptions, getBranch, type BranchableTree, type TreeBranchFork, independentInitializedView, type ViewContent, TreeAlpha, type ObservationResults, type TreeIdentifierUtils, independentView, type IndependentViewOptions, createIndependentTreeBeta, createIndependentTreeAlpha, type CreateIndependentTreeAlphaOptions, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, } from "./shared-tree/index.js";
|
|
33
|
-
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ViewableTree, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, SchemaFactoryBeta, type SchemaStaticsBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type FieldSchemaAlpha, type FieldSchemaMetadata, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, ObjectNodeSchema, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, type InternalTreeNode, type WithType, type NodeChangedData, type SchemaUpgrade, contentSchemaSymbol, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type System_Unsafe, type FieldSchemaAlphaUnsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type UnannotateAllowedTypeUnsafe, type AnnotatedAllowedTypeUnsafe, type AnnotatedAllowedTypesUnsafe, type AllowedTypesFullUnsafe, type AllowedTypesFullFromMixedUnsafe, type UnannotateAllowedTypesListUnsafe, type AnnotateAllowedTypesListUnsafe, type typeSchemaSymbol, type TreeNodeSchemaNonClass, type ValidateRecursiveSchema, type FixRecursiveArraySchema, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, adaptEnum, enumFromStrings, singletonSchema, type UnsafeUnknownSchema, type TreeViewAlpha, type TreeViewBeta, type InsertableField, type Insertable, type InsertableContent, type FactoryContent, type FactoryContentObject, type ReadableField, type ReadSchema, type AnnotatedAllowedType, type AnnotatedAllowedTypes, type AllowedTypesFullEvaluated, type AllowedTypeMetadata, type AllowedTypesMetadata, type UnannotateAllowedTypesList, type AnnotateAllowedTypesList, type AllowedTypesFull, type AllowedTypesFullFromMixed, type SchemaType, TreeBeta, type TreeChangeEventsBeta, type VerboseTreeNode, type TreeEncodingOptions, type TreeSchemaEncodingOptions, type TreeSchema, TreeViewConfigurationAlpha, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, getJsonSchema, type LazyItem, type Unenforced, type SimpleNodeSchemaBase, type SimpleNodeSchemaBaseAlpha, type SimpleTreeSchema, type SimpleNodeSchema, type SimpleFieldSchema, type SimpleLeafNodeSchema, type SimpleMapNodeSchema, type SimpleArrayNodeSchema, type SimpleObjectNodeSchema, type SimpleObjectFieldSchema, type SimpleRecordNodeSchema, normalizeAllowedTypes, walkFieldSchema, walkNodeSchema, walkAllowedTypes, type SchemaVisitor, getSimpleSchema, type ReadonlyArrayNode, type InsertableTreeNodeFromAllowedTypes, type Input, type TreeBranch, type TreeBranchAlpha, type TreeBranchEvents, asTreeViewAlpha, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, type NodeSchemaMetadata, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type TransactionConstraintAlpha, type NodeInDocumentConstraint, type NoChangeConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type LeafSchema, type ArrayNodeCustomizableSchema, type ArrayNodePojoEmulationSchema, ArrayNodeSchema, type MapNodeCustomizableSchema, type MapNodePojoEmulationSchema, MapNodeSchema, type ObjectFromSchemaRecord, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, RecordNodeSchema, type RecordNodeCustomizableSchema, type RecordNodeInsertableData, type RecordNodePojoEmulationSchema, type TreeRecordNode, KeyEncodingOptions, type TreeParsingOptions, type SchemaFactory_base, type NumberKeys, type SimpleAllowedTypeAttributes, encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility,
|
|
33
|
+
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ViewableTree, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, SchemaFactoryBeta, type SchemaStaticsBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type FieldSchemaAlpha, type FieldSchemaMetadata, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, ObjectNodeSchema, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, type InternalTreeNode, type WithType, type NodeChangedData, type SchemaUpgrade, contentSchemaSymbol, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type System_Unsafe, type FieldSchemaAlphaUnsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type UnannotateAllowedTypeUnsafe, type AnnotatedAllowedTypeUnsafe, type AnnotatedAllowedTypesUnsafe, type AllowedTypesFullUnsafe, type AllowedTypesFullFromMixedUnsafe, type UnannotateAllowedTypesListUnsafe, type AnnotateAllowedTypesListUnsafe, type typeSchemaSymbol, type TreeNodeSchemaNonClass, type ValidateRecursiveSchema, type FixRecursiveArraySchema, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, adaptEnum, enumFromStrings, singletonSchema, type UnsafeUnknownSchema, type TreeViewAlpha, type TreeViewBeta, type InsertableField, type Insertable, type InsertableContent, type FactoryContent, type FactoryContentObject, type ReadableField, type ReadSchema, type AnnotatedAllowedType, type AnnotatedAllowedTypes, type AllowedTypesFullEvaluated, type AllowedTypeMetadata, type AllowedTypesMetadata, type UnannotateAllowedTypesList, type AnnotateAllowedTypesList, type AllowedTypesFull, type AllowedTypesFullFromMixed, type SchemaType, TreeBeta, type TreeChangeEventsBeta, type VerboseTreeNode, type TreeEncodingOptions, type TreeSchemaEncodingOptions, type TreeSchema, TreeViewConfigurationAlpha, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, getJsonSchema, type LazyItem, type Unenforced, type SimpleNodeSchemaBase, type SimpleNodeSchemaBaseAlpha, type SimpleTreeSchema, type SimpleNodeSchema, type SimpleFieldSchema, type SimpleLeafNodeSchema, type SimpleMapNodeSchema, type SimpleArrayNodeSchema, type SimpleObjectNodeSchema, type SimpleObjectFieldSchema, type SimpleRecordNodeSchema, normalizeAllowedTypes, walkFieldSchema, walkNodeSchema, walkAllowedTypes, type SchemaVisitor, getSimpleSchema, type ReadonlyArrayNode, type InsertableTreeNodeFromAllowedTypes, type Input, type TreeBranch, type TreeBranchAlpha, type TreeBranchEvents, asTreeViewAlpha, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, type NodeSchemaMetadata, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type TransactionConstraintAlpha, type NodeInDocumentConstraint, type NoChangeConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type LeafSchema, type ArrayNodeCustomizableSchema, type ArrayNodePojoEmulationSchema, ArrayNodeSchema, type MapNodeCustomizableSchema, type MapNodePojoEmulationSchema, MapNodeSchema, type ObjectFromSchemaRecord, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, RecordNodeSchema, type RecordNodeCustomizableSchema, type RecordNodeInsertableData, type RecordNodePojoEmulationSchema, type TreeRecordNode, KeyEncodingOptions, type TreeParsingOptions, type SchemaFactory_base, type NumberKeys, type SimpleAllowedTypeAttributes, encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, snapshotSchemaCompatibility, type SnapshotFileSystem, incrementalSummaryHint, incrementalEncodingPolicyForAllowedTypes, eraseSchemaDetails, eraseSchemaDetailsSubclassable, type SnapshotSchemaCompatibilityOptions, type ArrayPlaceAnchor, createArrayInsertionAnchor, } from "./simple-tree/index.js";
|
|
34
34
|
export { SharedTree, configuredSharedTree, configuredSharedTreeAlpha, configuredSharedTreeBeta, configuredSharedTreeBetaLegacy, } from "./treeFactory.js";
|
|
35
35
|
export { SharedTreeAttributes, SharedTreeFactoryType } from "./sharedTreeAttributes.js";
|
|
36
36
|
export { persistedToSimpleSchema } from "./shared-tree/index.js";
|
|
@@ -50,5 +50,5 @@ export { FluidSerializableAsTree } from "./serializableDomainSchema.js";
|
|
|
50
50
|
export { TableSchema, type System_TableSchema } from "./tableSchema.js";
|
|
51
51
|
export { asAlpha, asBeta } from "./api.js";
|
|
52
52
|
export { TextAsTree, FormattedTextAsTree } from "./text/index.js";
|
|
53
|
-
export {
|
|
53
|
+
export { ExtensibleUnionNode } from "./extensibleUnionNode.js";
|
|
54
54
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EACX,KAAK,UAAU,EACf,UAAU,EACV,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3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AClB,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,kCAAkC,EACvC,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,QAAQ,EACR,8BAA8B,EAC9B,kBAAkB,EAClB,yBAAyB,EACzB,cAAc,EACd,yBAAyB,EACzB,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,UAAU,EACf,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,eAAe,EACf,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,aAAa,EACb,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,gBAAgB,EAChB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,cAAc,EACnB,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,2BAA2B,EAChC,iCAAiC,EACjC,iCAAiC,EACjC,iCAAiC,EACjC,iCAAiC,EACjC,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EACX,KAAK,UAAU,EACf,UAAU,EACV,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,oBA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AE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -9,7 +9,7 @@ export { TreeArrayNode, IterableTreeArrayContent, TreeNode, TreeViewConfiguratio
|
|
|
9
9
|
// experimental @alpha APIs:
|
|
10
10
|
adaptEnum, enumFromStrings, singletonSchema,
|
|
11
11
|
// Beta APIs
|
|
12
|
-
TreeBeta, TreeViewConfigurationAlpha, extractPersistedSchema, comparePersistedSchema, getJsonSchema, normalizeAllowedTypes, walkFieldSchema, walkNodeSchema, walkAllowedTypes, getSimpleSchema, asTreeViewAlpha, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, allowUnused, ArrayNodeSchema, MapNodeSchema, RecordNodeSchema, KeyEncodingOptions, encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility,
|
|
12
|
+
TreeBeta, TreeViewConfigurationAlpha, extractPersistedSchema, comparePersistedSchema, getJsonSchema, normalizeAllowedTypes, walkFieldSchema, walkNodeSchema, walkAllowedTypes, getSimpleSchema, asTreeViewAlpha, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, allowUnused, ArrayNodeSchema, MapNodeSchema, RecordNodeSchema, KeyEncodingOptions, encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, snapshotSchemaCompatibility, incrementalSummaryHint, incrementalEncodingPolicyForAllowedTypes, eraseSchemaDetails, eraseSchemaDetailsSubclassable, createArrayInsertionAnchor, } from "./simple-tree/index.js";
|
|
13
13
|
export { SharedTree, configuredSharedTree, configuredSharedTreeAlpha, configuredSharedTreeBeta, configuredSharedTreeBetaLegacy, } from "./treeFactory.js";
|
|
14
14
|
export { SharedTreeAttributes, SharedTreeFactoryType } from "./sharedTreeAttributes.js";
|
|
15
15
|
export { persistedToSimpleSchema } from "./shared-tree/index.js";
|
|
@@ -28,5 +28,5 @@ export { FluidSerializableAsTree } from "./serializableDomainSchema.js";
|
|
|
28
28
|
export { TableSchema } from "./tableSchema.js";
|
|
29
29
|
export { asAlpha, asBeta } from "./api.js";
|
|
30
30
|
export { TextAsTree, FormattedTextAsTree } from "./text/index.js";
|
|
31
|
-
export {
|
|
31
|
+
export { ExtensibleUnionNode } from "./extensibleUnionNode.js";
|
|
32
32
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EAEX,UAAU,EACV,gBAAgB,GAQhB,MAAM,iBAAiB,CAAC;AAkCzB,OAAO,EACN,UAAU,EACV,uBAAuB,GAKvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAMN,IAAI,EAGJ,SAAS,EAGT,0BAA0B,EAE1B,SAAS,EAGT,eAAe,EAEf,yBAAyB,EACzB,0BAA0B,EAE1B,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,aAAa,EAEb,wBAAwB,EACxB,QAAQ,EAIR,qBAAqB,EAKrB,aAAa,EACb,iBAAiB,EAEjB,kBAAkB,EAUlB,SAAS,EACT,WAAW,EAMX,QAAQ,EAER,gBAAgB,EAMhB,oBAAoB,EAKpB,mBAAmB,EA+BnB,qBAAqB,EACrB,qBAAqB,EAErB,eAAe;AAEf,4BAA4B;AAC5B,SAAS,EACT,eAAe,EACf,eAAe;AAqBf,YAAY;AACZ,QAAQ,EAOR,0BAA0B,EAE1B,sBAAsB,EACtB,sBAAsB,EAkBtB,aAAa,EAcb,qBA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,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tValueSchema,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./core/index.js\";\n\nimport type {\n\tListeners as EventListeners,\n\tIsListener as EventIsListener,\n\tListenable as EventListenable,\n\tOff as EventOff,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listeners}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listeners<T extends object> = EventListeners<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#IsListener}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type IsListener<T> = EventIsListener<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listenable}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listenable<T extends object> = EventListenable<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Off}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Off = EventOff;\n\nexport {\n\tTreeStatus,\n\tTreeCompressionStrategy,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n\ttype IncrementalEncodingPolicy,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ITreeInternal,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsBeta,\n\ttype ForestType,\n\ttype SharedTreeFormatOptions,\n\tTree,\n\ttype RunTransaction,\n\ttype ForestOptions,\n\tgetBranch,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n\tindependentInitializedView,\n\ttype ViewContent,\n\tTreeAlpha,\n\ttype ObservationResults,\n\ttype TreeIdentifierUtils,\n\tindependentView,\n\ttype IndependentViewOptions,\n\tcreateIndependentTreeBeta,\n\tcreateIndependentTreeAlpha,\n\ttype CreateIndependentTreeAlphaOptions,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype ViewableTree,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\tSchemaFactoryBeta,\n\ttype SchemaStaticsBeta,\n\tSchemaFactoryAlpha,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype FieldSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tNodeKind,\n\ttype TreeObjectNode,\n\tObjectNodeSchema,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype SchemaCompatibilityStatus,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\ttype InternalTreeNode,\n\ttype WithType,\n\ttype NodeChangedData,\n\ttype SchemaUpgrade,\n\tcontentSchemaSymbol,\n\t// Types not really intended for public use, but used in links.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// Error: src/simple-tree/objectNode.ts:72:1 - (ae-unresolved-link) The @link reference could not be resolved: The package \"@fluidframework/tree\" does not have an export \"TreeNodeApi\"\n\ttype TreeNodeApi,\n\ttype TreeNodeSchemaCore,\n\t// Types not really intended for public use, but used in inferred types exposed in the public API.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// error TS2742: The inferred type of 'Inventory' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\n\ttype AllowedTypes,\n\ttype System_Unsafe,\n\ttype FieldSchemaAlphaUnsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\ttype UnannotateAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypesUnsafe,\n\ttype AllowedTypesFullUnsafe,\n\ttype AllowedTypesFullFromMixedUnsafe,\n\ttype UnannotateAllowedTypesListUnsafe,\n\ttype AnnotateAllowedTypesListUnsafe,\n\t// System types (not in Internal types for various reasons, like doc links or cannot be named errors).\n\ttype typeSchemaSymbol,\n\ttype TreeNodeSchemaNonClass,\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\t// Index APIs\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n\t// experimental @alpha APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeViewAlpha,\n\ttype TreeViewBeta,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype AnnotatedAllowedType,\n\ttype AnnotatedAllowedTypes,\n\ttype AllowedTypesFullEvaluated,\n\ttype AllowedTypeMetadata,\n\ttype AllowedTypesMetadata,\n\ttype UnannotateAllowedTypesList,\n\ttype AnnotateAllowedTypesList,\n\ttype AllowedTypesFull,\n\ttype AllowedTypesFullFromMixed,\n\ttype SchemaType,\n\t// Beta APIs\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\t// Other\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype TreeSchemaEncodingOptions,\n\ttype TreeSchema,\n\tTreeViewConfigurationAlpha,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\t// Back to normal types\n\ttype JsonTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonLeafNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonObjectNodeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonSchemaType,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\tgetJsonSchema,\n\ttype LazyItem,\n\ttype Unenforced,\n\ttype SimpleNodeSchemaBase,\n\ttype SimpleNodeSchemaBaseAlpha,\n\ttype SimpleTreeSchema,\n\ttype SimpleNodeSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleLeafNodeSchema,\n\ttype SimpleMapNodeSchema,\n\ttype SimpleArrayNodeSchema,\n\ttype SimpleObjectNodeSchema,\n\ttype SimpleObjectFieldSchema,\n\ttype SimpleRecordNodeSchema,\n\tnormalizeAllowedTypes,\n\twalkFieldSchema,\n\twalkNodeSchema,\n\twalkAllowedTypes,\n\ttype SchemaVisitor,\n\tgetSimpleSchema,\n\ttype ReadonlyArrayNode,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype TreeBranch,\n\ttype TreeBranchAlpha,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype NodeSchemaMetadata,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype TransactionConstraintAlpha,\n\ttype NodeInDocumentConstraint,\n\ttype NoChangeConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\tevaluateLazySchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype LeafSchema,\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\ttype ObjectFromSchemaRecord,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\ttype TreeRecordNode,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n\ttype SchemaFactory_base,\n\ttype NumberKeys,\n\ttype SimpleAllowedTypeAttributes,\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n\tcheckSchemaCompatibilitySnapshots,\n\ttype SnapshotFileSystem,\n\tincrementalSummaryHint,\n\tincrementalEncodingPolicyForAllowedTypes,\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n\ttype SchemaCompatibilitySnapshotsOptions,\n\ttype ArrayPlaceAnchor,\n\tcreateArrayInsertionAnchor,\n} from \"./simple-tree/index.js\";\nexport {\n\tSharedTree,\n\tconfiguredSharedTree,\n\tconfiguredSharedTreeAlpha,\n\tconfiguredSharedTreeBeta,\n\tconfiguredSharedTreeBetaLegacy,\n} from \"./treeFactory.js\";\nexport { SharedTreeAttributes, SharedTreeFactoryType } from \"./sharedTreeAttributes.js\";\nexport { persistedToSimpleSchema } from \"./shared-tree/index.js\";\n\nexport {\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\ttype CodecWriteOptionsBeta,\n\tFluidClientVersion,\n\ttype FormatValidator,\n\tFormatValidatorNoOp,\n\ttype CodecName,\n\ttype FormatVersion,\n} from \"./codec/index.js\";\nexport { FormatValidatorBasic } from \"./external-utilities/index.js\";\n\nexport type {\n\t// Type Testing\n\trequireTrue,\n\trequireFalse,\n\trequireAssignableTo,\n\tareSafelyAssignable,\n\tisAssignableTo,\n\tisAny,\n\teitherIsAny,\n\t// Other\n\tRestrictiveReadonlyRecord,\n\tRestrictiveStringRecord,\n\tMakeNominal,\n\tIsUnion,\n\tUnionToIntersection,\n\tUnionToTuple,\n\tPopUnion,\n\tJsonCompatible,\n\tJsonCompatibleObject,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"./util/index.js\";\nexport { cloneWithReplacements } from \"./util/index.js\";\n\nimport * as InternalTypes from \"./internalTypes.js\";\n/**\n * Contains types used by the API, but which serve mechanical purposes and do not represent semantic concepts.\n * They are used internally to implement API aspects, but are not intended for use by external consumers.\n */\n// eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor)\nexport { InternalTypes };\n\n// Internal/System types:\n// These would be put in `internalTypes` except doing so tents to cause errors like:\n// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\nexport type { MapNodeInsertableData } from \"./simple-tree/index.js\";\n\nexport { JsonAsTree } from \"./jsonDomainSchema.js\";\nexport { FluidSerializableAsTree } from \"./serializableDomainSchema.js\";\nexport { TableSchema, type System_TableSchema } from \"./tableSchema.js\";\nexport { asAlpha, asBeta } from \"./api.js\";\n\nexport { TextAsTree, FormattedTextAsTree } from \"./text/index.js\";\nexport { ExtensibleSchemaUnion } from \"./extensibleSchemaUnion.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EAEX,UAAU,EACV,gBAAgB,GAQhB,MAAM,iBAAiB,CAAC;AAkCzB,OAAO,EACN,UAAU,EACV,uBAAuB,GAKvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAMN,IAAI,EAGJ,SAAS,EAGT,0BAA0B,EAE1B,SAAS,EAGT,eAAe,EAEf,yBAAyB,EACzB,0BAA0B,EAE1B,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,aAAa,EAEb,wBAAwB,EACxB,QAAQ,EAIR,qBAAqB,EAKrB,aAAa,EACb,iBAAiB,EAEjB,kBAAkB,EAUlB,SAAS,EACT,WAAW,EAMX,QAAQ,EAER,gBAAgB,EAMhB,oBAAoB,EAKpB,mBAAmB,EA+BnB,qBAAqB,EACrB,qBAAqB,EAErB,eAAe;AAEf,4BAA4B;AAC5B,SAAS,EACT,eAAe,EACf,eAAe;AAqBf,YAAY;AACZ,QAAQ,EAOR,0BAA0B,EAE1B,sBAAsB,EACtB,sBAAsB,EAkBtB,aAAa,EAcb,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,gBAAgB,EAEhB,eAAe,EAOf,eAAe,EAiBf,QAAQ,EACR,8BAA8B,EAC9B,kBAAkB,EAClB,yBAAyB,EACzB,cAAc,EACd,yBAAyB,EAEzB,WAAW,EAIX,eAAe,EAGf,aAAa,EAIb,gBAAgB,EAKhB,kBAAkB,EAKlB,iCAAiC,EACjC,iCAAiC,EACjC,iCAAiC,EACjC,iCAAiC,EACjC,kBAAkB,EAClB,2BAA2B,EAE3B,sBAAsB,EACtB,wCAAwC,EACxC,kBAAkB,EAClB,8BAA8B,EAG9B,0BAA0B,GAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,UAAU,EACV,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,8BAA8B,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAIN,kBAAkB,EAElB,mBAAmB,GAGnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAwBrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD;;;GAGG;AACH,8GAA8G;AAC9G,OAAO,EAAE,aAAa,EAAE,CAAC;AAOzB,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tValueSchema,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./core/index.js\";\n\nimport type {\n\tListeners as EventListeners,\n\tIsListener as EventIsListener,\n\tListenable as EventListenable,\n\tOff as EventOff,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listeners}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listeners<T extends object> = EventListeners<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#IsListener}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type IsListener<T> = EventIsListener<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listenable}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listenable<T extends object> = EventListenable<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Off}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Off = EventOff;\n\nexport {\n\tTreeStatus,\n\tTreeCompressionStrategy,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n\ttype IncrementalEncodingPolicy,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ITreeInternal,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsBeta,\n\ttype ForestType,\n\ttype SharedTreeFormatOptions,\n\tTree,\n\ttype RunTransaction,\n\ttype ForestOptions,\n\tgetBranch,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n\tindependentInitializedView,\n\ttype ViewContent,\n\tTreeAlpha,\n\ttype ObservationResults,\n\ttype TreeIdentifierUtils,\n\tindependentView,\n\ttype IndependentViewOptions,\n\tcreateIndependentTreeBeta,\n\tcreateIndependentTreeAlpha,\n\ttype CreateIndependentTreeAlphaOptions,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype ViewableTree,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\tSchemaFactoryBeta,\n\ttype SchemaStaticsBeta,\n\tSchemaFactoryAlpha,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype FieldSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tNodeKind,\n\ttype TreeObjectNode,\n\tObjectNodeSchema,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype SchemaCompatibilityStatus,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\ttype InternalTreeNode,\n\ttype WithType,\n\ttype NodeChangedData,\n\ttype SchemaUpgrade,\n\tcontentSchemaSymbol,\n\t// Types not really intended for public use, but used in links.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// Error: src/simple-tree/objectNode.ts:72:1 - (ae-unresolved-link) The @link reference could not be resolved: The package \"@fluidframework/tree\" does not have an export \"TreeNodeApi\"\n\ttype TreeNodeApi,\n\ttype TreeNodeSchemaCore,\n\t// Types not really intended for public use, but used in inferred types exposed in the public API.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// error TS2742: The inferred type of 'Inventory' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\n\ttype AllowedTypes,\n\ttype System_Unsafe,\n\ttype FieldSchemaAlphaUnsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\ttype UnannotateAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypesUnsafe,\n\ttype AllowedTypesFullUnsafe,\n\ttype AllowedTypesFullFromMixedUnsafe,\n\ttype UnannotateAllowedTypesListUnsafe,\n\ttype AnnotateAllowedTypesListUnsafe,\n\t// System types (not in Internal types for various reasons, like doc links or cannot be named errors).\n\ttype typeSchemaSymbol,\n\ttype TreeNodeSchemaNonClass,\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\t// Index APIs\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n\t// experimental @alpha APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeViewAlpha,\n\ttype TreeViewBeta,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype AnnotatedAllowedType,\n\ttype AnnotatedAllowedTypes,\n\ttype AllowedTypesFullEvaluated,\n\ttype AllowedTypeMetadata,\n\ttype AllowedTypesMetadata,\n\ttype UnannotateAllowedTypesList,\n\ttype AnnotateAllowedTypesList,\n\ttype AllowedTypesFull,\n\ttype AllowedTypesFullFromMixed,\n\ttype SchemaType,\n\t// Beta APIs\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\t// Other\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype TreeSchemaEncodingOptions,\n\ttype TreeSchema,\n\tTreeViewConfigurationAlpha,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\t// Back to normal types\n\ttype JsonTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonLeafNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonObjectNodeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonSchemaType,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\tgetJsonSchema,\n\ttype LazyItem,\n\ttype Unenforced,\n\ttype SimpleNodeSchemaBase,\n\ttype SimpleNodeSchemaBaseAlpha,\n\ttype SimpleTreeSchema,\n\ttype SimpleNodeSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleLeafNodeSchema,\n\ttype SimpleMapNodeSchema,\n\ttype SimpleArrayNodeSchema,\n\ttype SimpleObjectNodeSchema,\n\ttype SimpleObjectFieldSchema,\n\ttype SimpleRecordNodeSchema,\n\tnormalizeAllowedTypes,\n\twalkFieldSchema,\n\twalkNodeSchema,\n\twalkAllowedTypes,\n\ttype SchemaVisitor,\n\tgetSimpleSchema,\n\ttype ReadonlyArrayNode,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype TreeBranch,\n\ttype TreeBranchAlpha,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype NodeSchemaMetadata,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype TransactionConstraintAlpha,\n\ttype NodeInDocumentConstraint,\n\ttype NoChangeConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\tevaluateLazySchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype LeafSchema,\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\ttype ObjectFromSchemaRecord,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\ttype TreeRecordNode,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n\ttype SchemaFactory_base,\n\ttype NumberKeys,\n\ttype SimpleAllowedTypeAttributes,\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n\tsnapshotSchemaCompatibility,\n\ttype SnapshotFileSystem,\n\tincrementalSummaryHint,\n\tincrementalEncodingPolicyForAllowedTypes,\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n\ttype SnapshotSchemaCompatibilityOptions,\n\ttype ArrayPlaceAnchor,\n\tcreateArrayInsertionAnchor,\n} from \"./simple-tree/index.js\";\nexport {\n\tSharedTree,\n\tconfiguredSharedTree,\n\tconfiguredSharedTreeAlpha,\n\tconfiguredSharedTreeBeta,\n\tconfiguredSharedTreeBetaLegacy,\n} from \"./treeFactory.js\";\nexport { SharedTreeAttributes, SharedTreeFactoryType } from \"./sharedTreeAttributes.js\";\nexport { persistedToSimpleSchema } from \"./shared-tree/index.js\";\n\nexport {\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\ttype CodecWriteOptionsBeta,\n\tFluidClientVersion,\n\ttype FormatValidator,\n\tFormatValidatorNoOp,\n\ttype CodecName,\n\ttype FormatVersion,\n} from \"./codec/index.js\";\nexport { FormatValidatorBasic } from \"./external-utilities/index.js\";\n\nexport type {\n\t// Type Testing\n\trequireTrue,\n\trequireFalse,\n\trequireAssignableTo,\n\tareSafelyAssignable,\n\tisAssignableTo,\n\tisAny,\n\teitherIsAny,\n\t// Other\n\tRestrictiveReadonlyRecord,\n\tRestrictiveStringRecord,\n\tMakeNominal,\n\tIsUnion,\n\tUnionToIntersection,\n\tUnionToTuple,\n\tPopUnion,\n\tJsonCompatible,\n\tJsonCompatibleObject,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"./util/index.js\";\nexport { cloneWithReplacements } from \"./util/index.js\";\n\nimport * as InternalTypes from \"./internalTypes.js\";\n/**\n * Contains types used by the API, but which serve mechanical purposes and do not represent semantic concepts.\n * They are used internally to implement API aspects, but are not intended for use by external consumers.\n */\n// eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor)\nexport { InternalTypes };\n\n// Internal/System types:\n// These would be put in `internalTypes` except doing so tents to cause errors like:\n// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\nexport type { MapNodeInsertableData } from \"./simple-tree/index.js\";\n\nexport { JsonAsTree } from \"./jsonDomainSchema.js\";\nexport { FluidSerializableAsTree } from \"./serializableDomainSchema.js\";\nexport { TableSchema, type System_TableSchema } from \"./tableSchema.js\";\nexport { asAlpha, asBeta } from \"./api.js\";\n\nexport { TextAsTree, FormattedTextAsTree } from \"./text/index.js\";\nexport { ExtensibleUnionNode } from \"./extensibleUnionNode.js\";\n"]}
|
package/lib/legacy.d.ts
CHANGED
package/lib/packageVersion.d.ts
CHANGED