Skip to content

deserializePriorityQueueJson(payload, keyOrder): DenseIntegerPriorityQueue

Defined in: packages/heap/src/serialization/families/priority-queue.ts:193

Rebuild a priority queue from a SerializedPriorityQueue. O(n) time: one validation pass plus one entry copy — the layout is adopted exactly, never reheapified, and the value-to-index overlay is rebuilt in a single sweep.

Serialization is comparator-blind: pass the base key order used at construction — the direction comes from the payload’s kind. Round-trip fidelity holds when the re-supplied order is semantically equivalent to the original; a different order that happens to satisfy the payload’s layout is accepted, and the restored queue then follows the order actually supplied. Comparator identity is the caller’s responsibility — a documented limitation, not a validated fact.

Validation covers shape, kind, arity, per-entry [key, value] pair shape, duplicate values (the overlay requires unique values), the full heap invariant over keys under the direction-adjusted supplied order, and — with options — every key and value; guards run before the order is ever invoked.

SerializedDenseIntegerPriorityQueue

A statically typed serialized priority queue, or decoded unknown paired with runtime key and value validation.

Order<number>

The base key order the queue was constructed under.

DenseIntegerPriorityQueue

When the payload is malformed or fails validation: not an object (INVALID_SHAPE), a missing or unsupported schema version (UNSUPPORTED_SCHEMA_VERSION), an unknown or cross-family kind (UNKNOWN_KIND), a missing or mistyped entries array (MISSING_ENTRIES), an unsafe or missing k-ary arity (INVALID_ARITY), an entry that is not a [key, value] pair (INVALID_SHAPE, naming the index), a key or value failing its guard (INVALID_KEY/INVALID_VALUE), a duplicate value (DUPLICATE_VALUE), or a parent-child key pair violating the heap invariant (HEAP_INVARIANT_VIOLATION, naming the offending entry index).

deserializePriorityQueueJson<K, V>(payload, keyOrder): PriorityQueue<K, V>

Defined in: packages/heap/src/serialization/families/priority-queue.ts:197

Rebuild a priority queue from a SerializedPriorityQueue. O(n) time: one validation pass plus one entry copy — the layout is adopted exactly, never reheapified, and the value-to-index overlay is rebuilt in a single sweep.

Serialization is comparator-blind: pass the base key order used at construction — the direction comes from the payload’s kind. Round-trip fidelity holds when the re-supplied order is semantically equivalent to the original; a different order that happens to satisfy the payload’s layout is accepted, and the restored queue then follows the order actually supplied. Comparator identity is the caller’s responsibility — a documented limitation, not a validated fact.

Validation covers shape, kind, arity, per-entry [key, value] pair shape, duplicate values (the overlay requires unique values), the full heap invariant over keys under the direction-adjusted supplied order, and — with options — every key and value; guards run before the order is ever invoked.

K

V

SerializedPriorityQueue<K, V>

A statically typed serialized priority queue, or decoded unknown paired with runtime key and value validation.

Order<K>

The base key order the queue was constructed under.

PriorityQueue<K, V>

When the payload is malformed or fails validation: not an object (INVALID_SHAPE), a missing or unsupported schema version (UNSUPPORTED_SCHEMA_VERSION), an unknown or cross-family kind (UNKNOWN_KIND), a missing or mistyped entries array (MISSING_ENTRIES), an unsafe or missing k-ary arity (INVALID_ARITY), an entry that is not a [key, value] pair (INVALID_SHAPE, naming the index), a key or value failing its guard (INVALID_KEY/INVALID_VALUE), a duplicate value (DUPLICATE_VALUE), or a parent-child key pair violating the heap invariant (HEAP_INVARIANT_VIOLATION, naming the offending entry index).

deserializePriorityQueueJson<K, V>(payload, keyOrder, options): PriorityQueue<K, V>

Defined in: packages/heap/src/serialization/families/priority-queue.ts:201

Rebuild a priority queue from a SerializedPriorityQueue. O(n) time: one validation pass plus one entry copy — the layout is adopted exactly, never reheapified, and the value-to-index overlay is rebuilt in a single sweep.

Serialization is comparator-blind: pass the base key order used at construction — the direction comes from the payload’s kind. Round-trip fidelity holds when the re-supplied order is semantically equivalent to the original; a different order that happens to satisfy the payload’s layout is accepted, and the restored queue then follows the order actually supplied. Comparator identity is the caller’s responsibility — a documented limitation, not a validated fact.

Validation covers shape, kind, arity, per-entry [key, value] pair shape, duplicate values (the overlay requires unique values), the full heap invariant over keys under the direction-adjusted supplied order, and — with options — every key and value; guards run before the order is ever invoked.

K

V

unknown

A statically typed serialized priority queue, or decoded unknown paired with runtime key and value validation.

Order<K>

The base key order the queue was constructed under.

DeserializePriorityQueueJsonOptions<K, V>

Runtime decoding options for payloads whose key and value types are not yet known.

PriorityQueue<K, V>

When the payload is malformed or fails validation: not an object (INVALID_SHAPE), a missing or unsupported schema version (UNSUPPORTED_SCHEMA_VERSION), an unknown or cross-family kind (UNKNOWN_KIND), a missing or mistyped entries array (MISSING_ENTRIES), an unsafe or missing k-ary arity (INVALID_ARITY), an entry that is not a [key, value] pair (INVALID_SHAPE, naming the index), a key or value failing its guard (INVALID_KEY/INVALID_VALUE), a duplicate value (DUPLICATE_VALUE), or a parent-child key pair violating the heap invariant (HEAP_INVARIANT_VIOLATION, naming the offending entry index).

deserializePriorityQueueJson(payload, keyOrder): DenseIntegerPriorityQueue | PriorityQueue<unknown, unknown>

Defined in: packages/heap/src/serialization/families/priority-queue.ts:206

Rebuild a priority queue from a SerializedPriorityQueue. O(n) time: one validation pass plus one entry copy — the layout is adopted exactly, never reheapified, and the value-to-index overlay is rebuilt in a single sweep.

Serialization is comparator-blind: pass the base key order used at construction — the direction comes from the payload’s kind. Round-trip fidelity holds when the re-supplied order is semantically equivalent to the original; a different order that happens to satisfy the payload’s layout is accepted, and the restored queue then follows the order actually supplied. Comparator identity is the caller’s responsibility — a documented limitation, not a validated fact.

Validation covers shape, kind, arity, per-entry [key, value] pair shape, duplicate values (the overlay requires unique values), the full heap invariant over keys under the direction-adjusted supplied order, and — with options — every key and value; guards run before the order is ever invoked.

unknown

A statically typed serialized priority queue, or decoded unknown paired with runtime key and value validation.

Order<unknown>

The base key order the queue was constructed under.

DenseIntegerPriorityQueue | PriorityQueue<unknown, unknown>

When the payload is malformed or fails validation: not an object (INVALID_SHAPE), a missing or unsupported schema version (UNSUPPORTED_SCHEMA_VERSION), an unknown or cross-family kind (UNKNOWN_KIND), a missing or mistyped entries array (MISSING_ENTRIES), an unsafe or missing k-ary arity (INVALID_ARITY), an entry that is not a [key, value] pair (INVALID_SHAPE, naming the index), a key or value failing its guard (INVALID_KEY/INVALID_VALUE), a duplicate value (DUPLICATE_VALUE), or a parent-child key pair violating the heap invariant (HEAP_INVARIANT_VIOLATION, naming the offending entry index).