ResourceStore
Defined in: src/core/ir/resources.ts:48
A content-addressed store for the IR’s binary payloads (images, fonts). IR trees stay pure JSON and reference bytes by ResourceId; ids derive from the bytes (a synchronous 64-bit FNV-1a), so identical payloads deduplicate for free and equal documents get equal ids — which keeps IR-level diffs and the byte-identical gates meaningful.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ResourceStore():
ResourceStore
Returns
Section titled “Returns”ResourceStore
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get size():
number
Defined in: src/core/ir/resources.ts:85
The number of distinct resources stored.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”get(
id):Uint8Array<ArrayBufferLike> |undefined
Defined in: src/core/ir/resources.ts:70
Look up the bytes for an id, or undefined when absent.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Uint8Array<ArrayBufferLike> | undefined
has(
id):boolean
Defined in: src/core/ir/resources.ts:75
Whether an id is present in the store.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
ids(): readonly
ResourceId[]
Defined in: src/core/ir/resources.ts:80
All stored ids, in insertion order.
Returns
Section titled “Returns”readonly ResourceId[]
put(
bytes):ResourceId
Defined in: src/core/ir/resources.ts:56
Store bytes and return their content-addressed id. Re-putting identical
bytes returns the existing id (deduplication); a hash collision with
different bytes probes deterministic ~n suffixes.
Parameters
Section titled “Parameters”Uint8Array