Defined in: packages/disjoint-set/src/serialization/json.ts:28
A plain, inert description of a partition. It holds no behavior and no
reference to the structure it came from, so it can be stored, compared,
structurally cloned, or sent through postMessage. It survives
JSON.stringify when the elements themselves do.
kind identifies the storage layout to restore. The two arrays are parallel
and always have the same length. labels[i] is the group of elements[i].
Labels are opaque. Two elements share a set when their labels are equal, and
nothing else about the value is meaningful. serializeDisjointSetJson emits dense labels
counting from 0, and deserializeDisjointSetJson accepts any numbers and groups them by
equality.
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”schemaVersion
Section titled “schemaVersion”
readonlyschemaVersion:1
Defined in: packages/disjoint-set/src/serialization/json.ts:30
Wire-schema version.
readonlykind:"object"|"struct-of-arrays"
Defined in: packages/disjoint-set/src/serialization/json.ts:32
The storage layout to restore when no factory override is supplied.
elements
Section titled “elements”
readonlyelements: readonlyT[]
Defined in: packages/disjoint-set/src/serialization/json.ts:34
Every element, in the order it was added.
labels
Section titled “labels”
readonlylabels: readonlynumber[]
Defined in: packages/disjoint-set/src/serialization/json.ts:36
The group label of the element at the same position.