# deserializePriorityQueue

> **deserializePriorityQueue**<`K`, `V`>(`value`, `keyOrder`, `options`): [`PriorityQueue`](/reference/knotkit/heap/type-aliases/priorityqueue/)<`K`, `V`>

Defined in: [packages/heap/src/serialization/binary.ts:302](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/heap/src/serialization/binary.ts#L302)

Restore a priority queue from canonical binary bytes after staging both runs, rejecting duplicate decoded values, and validating key order.

## Type Parameters

### K

`K`

### V

`V`

## Parameters

### value

`unknown`

### keyOrder

[`Order`](/reference/knotkit/heap/type-aliases/order/)<`K`>

### options

[`DeserializePriorityQueueOptions`](/reference/knotkit/heap/wire/interfaces/deserializepriorityqueueoptions/)<`K`, `V`>

## Returns

[`PriorityQueue`](/reference/knotkit/heap/type-aliases/priorityqueue/)<`K`, `V`>

## Throws

With `MISSING_ELEMENT_CODEC` when `options.keyCodec` or `options.valueCodec` is absent, which is a caller contract rather than a property of the bytes.

## Throws

For malformed bytes, unsupported versions, invalid codec results, duplicate values, invalid arity, heap-invariant violations, or decode-budget violations.
