Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”payload
Section titled “payload”SerializedDenseIntegerPriorityQueue
A statically typed serialized priority queue, or decoded
unknown paired with runtime key and value validation.
keyOrder
Section titled “keyOrder”Order<number>
The base key order the queue was constructed under.
Returns
Section titled “Returns”Throws
Section titled “Throws”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).
Call Signature
Section titled “Call Signature”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.
Type Parameters
Section titled “Type Parameters”K
V
Parameters
Section titled “Parameters”payload
Section titled “payload”SerializedPriorityQueue<K, V>
A statically typed serialized priority queue, or decoded
unknown paired with runtime key and value validation.
keyOrder
Section titled “keyOrder”Order<K>
The base key order the queue was constructed under.
Returns
Section titled “Returns”PriorityQueue<K, V>
Throws
Section titled “Throws”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).
Call Signature
Section titled “Call Signature”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.
Type Parameters
Section titled “Type Parameters”K
V
Parameters
Section titled “Parameters”payload
Section titled “payload”unknown
A statically typed serialized priority queue, or decoded
unknown paired with runtime key and value validation.
keyOrder
Section titled “keyOrder”Order<K>
The base key order the queue was constructed under.
options
Section titled “options”DeserializePriorityQueueJsonOptions<K, V>
Runtime decoding options for payloads whose key and value types are not yet known.
Returns
Section titled “Returns”PriorityQueue<K, V>
Throws
Section titled “Throws”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).
Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”payload
Section titled “payload”unknown
A statically typed serialized priority queue, or decoded
unknown paired with runtime key and value validation.
keyOrder
Section titled “keyOrder”Order<unknown>
The base key order the queue was constructed under.
Returns
Section titled “Returns”DenseIntegerPriorityQueue | PriorityQueue<unknown, unknown>
Throws
Section titled “Throws”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).