Interface bridge reference
Every member of the StillMade object a Block interface receives, with its signature and where it is available.
Standard and frame views receive the same StillMade object; members marked Frame views exist only there. In and Out are the Block's input and output values (see TypeScript). The view host checks every request itself: a read-only viewer cannot run the Block or save outputs from any view.
Inputs and runs
| Member | Where | What it does |
|---|---|---|
readonly input: Partial<In> | Every view | A copy of the current input values. Read it after onInput first fires. |
onInput(callback: (input: Partial<In>) => void): () => void | Every view | Receives the input when the view starts and each time the host changes it. Returns a function that stops listening. Initialize controls here. |
run(values: In): Promise<Out> | Every view | Checks the named input values, runs the Block (its recipe, JavaScript, module or hosted operation, after any approval the host asks for) and resolves to the checked outputs. One run at a time, 30 a minute. |
useOutput(outputs: Partial<Out>): Promise<Record<string, unknown>> | A saved project Step | Chooses media the view already holds (input media or a desktop recording) as the Block outputs without running. Only complete references the host issued are accepted. |
readonly schemaFields: Readonly<Record<string, unknown>> | Every view | Helpers that build form fields from the input ports and their schemas, honoring inputs the host locked. |
Shared state
| Member | Where | What it does | |
|---|---|---|---|
getShared(): {state: Record<string, unknown>; outputs: Record<string, unknown>; memory: unknown; canEdit: boolean} | Every view | A copy of the view state shared by everyone in the project, the last outputs, the Block memory and whether this person may edit. | |
onShared(callback: (shared: ReturnType<StillMadeView["getShared"]>) => void): () => void | Every view | Receives the shared state now and after every change by anyone. Returns a function that stops listening. | |
updateShared(values: Record<string, unknown>, preconditions?: Record<string, unknown>, options?: Record<string, unknown>): Promise<unknown> | Every view | Changes shared fields. Keep each independently edited value in its own field so two people never conflict; a field someone else changed first is refused. | |
bindShared(key: string, id: string): () => void | Every view | Binds a form element (by id) to one shared field: it shows other people's edits and saves this person's edits, keeping drafts while they type. | |
setSharedDefaults(values: Record<string, unknown>): void | Every view | Values bound controls show until someone saves the field. | |
| `scheduleSharedEdit(key: string, callback: () => unknown \ | Promise<unknown>): void` | Every view | Runs a named shared edit after a short pause (at most 500 ms after the first request), so rapid edits to one field (sliders, drags) become one save. |
connectDocument(options: Record<string, unknown>): Readonly<Record<string, unknown>> | Every view | Connects a declared JSON content store to shared edits once; returns its status, flush and recovery methods. | |
indexById(items: Array<{id: string; [key: string]: unknown}>): Map<string, {id: string; [key: string]: unknown}> | Every view | Indexes list items by their stable id. | |
diffDocument(before: Record<string, unknown>, after: Record<string, unknown>): Array<Record<string, unknown>> | Every view | The minimal list of edits between two versions of a document. | |
applyDocument(document: Record<string, unknown>, patches: Array<Record<string, unknown>>): Record<string, unknown> | Every view | Applies edits from diffDocument to a document. |
Media
| Member | Where | What it does | ||
|---|---|---|---|---|
previewImage(value: StillMadeImage): Promise<{url: string; width: number; height: number}> | Every view | A display-only PNG copy (at most 512 pixels a side) of an image the view may show. Keep passing the original value to run. | ||
| `previewMedia(value: StillMadeVideo \ | StillMadeAudio): Promise<{kind: "video" \ | "audio"; url: string}>` | Every view | A playable blob: URL for audio or video the view may play. Call releaseMedia when done. |
releaseMedia(url: string): void | Every view | Frees a URL previewMedia returned. | ||
asset(path: string): string | Frame views | A blob: URL for one of the view's own asset files, for <img>, new FontFace() or <video>. | ||
assetBytes(path: string): ArrayBuffer | Frame views | A copy of one of the view's own asset files. |
Generated interface
| Member | Where | What it does | |
|---|---|---|---|
render(targetId: string, tree: Array<Record<string, unknown>>): void | Every view | Renders a tree of StillMade controls into an element, for standard views that build their interface from data. | |
| `onAction(callback: (event: {action: string; value: unknown; checked: boolean; event: string}) => void \ | Promise<void>): () => void` | Every view | Receives actions from controls render drew. |
Connected work
| Member | Where | What it does | ||
|---|---|---|---|---|
| `connectedApp(operation: "tasks" \ | "preview-task" \ | "apply-task", args?: Record<string, unknown>): Promise<Record<string, unknown>>` | A saved project Step | Lists, previews and applies tasks of the Block's connected-app contract. |
sharedWork(operation: string, args?: Record<string, unknown>): Promise<Record<string, unknown>> | A saved project Step | Reads and contributes to shared work items (reviews, contributions) in the project. | ||
onSharedWorkRefresh(callback: () => void): () => void | A saved project Step | Called when shared work changes elsewhere; read it again. | ||
| `previewSharedWorkMedia(contributionId: string): Promise<{url: string; kind: "image" \ | "video" \ | "audio"}>` | A saved project Step | A display copy of media attached to a shared work contribution. |
releaseSharedWorkMedia(url: string): void | A saved project Step | Frees a URL previewSharedWorkMedia returned. | ||
desktop(operation: string, args?: Record<string, unknown>): Promise<Record<string, unknown>> | StillMade Desktop | Runs a declared desktop permission (screen or camera capture, clipboard, native tools) after the person grants it. |