# `ImageRef`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

Interface · `import type { ImageRef } from '@holostep-configurators/runtime-client/contract';` · stable · since 2.0.0 · section 8. Materials and textures

How reads return a texture you wrote as an `image`: JSON, so [`state()`](Writer.state.md), the feed, [`applyPatch`](Writer.applyPatch.md)
and `sceneHash` stay JSON. Writing it back reuses that upload while it is live in this session:
while committed or staged state, a pending write, a rule, a stage layer, or an undo or redo step
names it. The runtime keeps its CPU copy that long (the GPU texture may be freed and drawn again
from it) and drops it when the last of these lets go: a step trimmed, rebased or cleared from
history, its owner disposed, the session destroyed. A feed patch or a dry run's patch keeps
nothing live. A write naming a ref that is not live (another session's, or one dropped) rejects
HoloInputError 'unknown-id' at its path and applies nothing; write the canvas again.

## Members

| Member | Kind | Summary |
| --- | --- | --- |
| <a id="id"></a>[`id`](ImageRef.id.md) | property | The upload's id in this session. |
| <a id="sha256"></a>[`sha256`](ImageRef.sha256.md) | property | sha256 of the uploaded image; it enters `sceneHash`. |

## Declaration

```ts
export interface ImageRef {
  readonly id: string;
  readonly sha256: string;
}
```

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `ImageRef` names no product |
| 2. A precedent | pass: [createImageBitmap()](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap) (row `G23`); [Babylon.js DynamicTexture](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Materials/Textures/dynamicTexture.ts) (row `G23`) |
| 3. Two apps, or labs | one app recorded: app-bcb7ef21da (spec 3.1 rule 3 asks for two, or labs) |
| 4. The cheaper fix first | decided per need in Appendix B: rows `G23` at tier stable (a member only where no rule, data, asset or app code serves the need) |
