# deserializeDisjointSet

## Call Signature

> **deserializeDisjointSet**<`T`>(`value`, `options`): [`GrowableDisjointSet`](/reference/knotkit/disjoint-set/interfaces/growabledisjointset/)<`T`>

Defined in: [packages/disjoint-set/src/serialization/binary.ts:154](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/disjoint-set/src/serialization/binary.ts#L154)

Restore a canonical binary partition after validating all geometry, counts, codec results, and duplicate elements into staging arrays.

An indexed artifact restored through a growable factory receives the dense numeric elements `0..size - 1`.

### Type Parameters

#### T

`T`

### Parameters

#### value

`unknown`

#### options

[`DeserializeDisjointSetOptions`](/reference/knotkit/disjoint-set/wire/interfaces/deserializedisjointsetoptions/)<`T`> & `object`

### Returns

[`GrowableDisjointSet`](/reference/knotkit/disjoint-set/interfaces/growabledisjointset/)<`T`>

### Throws

For malformed bytes, unsupported versions, invalid codec results, duplicate elements, or decode-budget violations. Distinguish causes with `error.code`.

### Throws

With `MISSING_ELEMENT_CODEC` when a growable artifact is decoded without the codec that produced it.

## Call Signature

> **deserializeDisjointSet**<`T`>(`value`, `options`): [`IndexedDisjointSet`](/reference/knotkit/disjoint-set/interfaces/indexeddisjointset/) | [`GrowableDisjointSet`](/reference/knotkit/disjoint-set/interfaces/growabledisjointset/)<`T`>

Defined in: [packages/disjoint-set/src/serialization/binary.ts:161](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/disjoint-set/src/serialization/binary.ts#L161)

Restore a canonical binary partition after validating all geometry, counts, codec results, and duplicate elements into staging arrays.

An indexed artifact restored through a growable factory receives the dense numeric elements `0..size - 1`.

### Type Parameters

#### T

`T`

### Parameters

#### value

`unknown`

#### options

[`DeserializeDisjointSetOptions`](/reference/knotkit/disjoint-set/wire/interfaces/deserializedisjointsetoptions/)<`T`> & `object`

### Returns

[`IndexedDisjointSet`](/reference/knotkit/disjoint-set/interfaces/indexeddisjointset/) | [`GrowableDisjointSet`](/reference/knotkit/disjoint-set/interfaces/growabledisjointset/)<`T`>

### Throws

For malformed bytes, unsupported versions, invalid codec results, duplicate elements, or decode-budget violations. Distinguish causes with `error.code`.

### Throws

With `MISSING_ELEMENT_CODEC` when a growable artifact is decoded without the codec that produced it.

## Call Signature

> **deserializeDisjointSet**(`value`, `options?`): [`IndexedDisjointSet`](/reference/knotkit/disjoint-set/interfaces/indexeddisjointset/) | [`GrowableDisjointSet`](/reference/knotkit/disjoint-set/interfaces/growabledisjointset/)<`number`>

Defined in: [packages/disjoint-set/src/serialization/binary.ts:165](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/disjoint-set/src/serialization/binary.ts#L165)

Restore a canonical binary partition after validating all geometry, counts, codec results, and duplicate elements into staging arrays.

An indexed artifact restored through a growable factory receives the dense numeric elements `0..size - 1`.

### Parameters

#### value

`unknown`

#### options?

[`DeserializeDisjointSetOptions`](/reference/knotkit/disjoint-set/wire/interfaces/deserializedisjointsetoptions/)<`number`>

### Returns

[`IndexedDisjointSet`](/reference/knotkit/disjoint-set/interfaces/indexeddisjointset/) | [`GrowableDisjointSet`](/reference/knotkit/disjoint-set/interfaces/growabledisjointset/)<`number`>

### Throws

For malformed bytes, unsupported versions, invalid codec results, duplicate elements, or decode-budget violations. Distinguish causes with `error.code`.

### Throws

With `MISSING_ELEMENT_CODEC` when a growable artifact is decoded without the codec that produced it.
