// Generated by quixos-codegen-ts. Do not edit. Binding ABI version 1. import { bindQxHandler, type BindingValue, type QxObjectRef, type QxHandler, type QxContextLifecycle, type QxHandlerSpec, type QxMessages } from "@quixos/camino-package-runtime"; import { positionBinding as message0 } from "../messages.js"; import { sizeBinding as message1 } from "../messages.js"; export const packageRevisionId = "package:org.quixos.web-studio:canvas-runtime@1"; export type Contexts = { "createCanvas": { "objectId": QxObjectRef<"atom:atom:org.quixos.web-studio:canvas">; "input": null; "ports": { } } & QxContextLifecycle<{ "objectId": QxObjectRef<"atom:atom:org.quixos.web-studio:canvas">; "input": null; "ports": { } } & {signal?: AbortSignal}>; "createPlacement": { "objectId": QxObjectRef<"atom:atom:org.quixos.web-studio:canvas-placement">; "input": { "canvas_id": QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">; "subject_id": QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">; "x": number; "y": number; "width": number; "height": number; "z": number }; "ports": { "position": { "set": (value: BindingValue) => Promise }; "size": { "set": (value: BindingValue) => Promise }; "z": { "set": (value: number) => Promise }; "canvas": { "connect": (target: QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">) => Promise }; "subject": { "connect": (target: QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">) => Promise } } } & QxContextLifecycle<{ "objectId": QxObjectRef<"atom:atom:org.quixos.web-studio:canvas-placement">; "input": { "canvas_id": QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">; "subject_id": QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">; "x": number; "y": number; "width": number; "height": number; "z": number }; "ports": { "position": { "set": (value: BindingValue) => Promise }; "size": { "set": (value: BindingValue) => Promise }; "z": { "set": (value: number) => Promise }; "canvas": { "connect": (target: QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">) => Promise }; "subject": { "connect": (target: QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">) => Promise } } } & {signal?: AbortSignal}> }; export type Implementation = { "createCanvas": QxHandler>; "createPlacement": QxHandler> }; const messages = { "org.quixos.web-studio.CanvasPosition": message0, "org.quixos.web-studio.CanvasSize": message1 } satisfies QxMessages; const specs = { "createCanvas": { "inputType": { "kind": "builtin", "name": "unit" }, "outputType": { "kind": "object-ref", "expectation": { "kind": "atom", "atomId": "atom:org.quixos.web-studio:canvas" } }, "ports": {} }, "createPlacement": { "inputType": { "kind": "record", "fields": { "canvas_id": { "kind": "object-ref", "expectation": { "kind": "interface", "interfaceRevisionId": "interface:org.quixos.web-studio.canvas@1" } }, "subject_id": { "kind": "object-ref", "expectation": { "kind": "interface", "interfaceRevisionId": "interface:org.quixos.web-studio.placeable@1" } }, "x": { "kind": "scalar", "name": "double" }, "y": { "kind": "scalar", "name": "double" }, "width": { "kind": "scalar", "name": "double" }, "height": { "kind": "scalar", "name": "double" }, "z": { "kind": "scalar", "name": "int32" } } }, "outputType": { "kind": "object-ref", "expectation": { "kind": "atom", "atomId": "atom:org.quixos.web-studio:canvas-placement" } }, "ports": { "position": { "kind": "state", "valueType": { "kind": "message", "descriptorId": "org.quixos.web-studio.CanvasPosition" }, "primitives": [ "write" ], "id": "port:web-studio-placement-constructor:position" }, "size": { "kind": "state", "valueType": { "kind": "message", "descriptorId": "org.quixos.web-studio.CanvasSize" }, "primitives": [ "write" ], "id": "port:web-studio-placement-constructor:size" }, "z": { "kind": "state", "valueType": { "kind": "scalar", "name": "int32" }, "primitives": [ "write" ], "id": "port:web-studio-placement-constructor:z" }, "canvas": { "kind": "edge", "id": "port:web-studio-placement-constructor:canvas", "primitives": [ "connect" ] }, "subject": { "kind": "edge", "id": "port:web-studio-placement-constructor:subject", "primitives": [ "connect" ] } } } } satisfies Record; export const createRuntime = (implementation: Implementation) => ({ packageRevisionId, exports: { "export:org.quixos.web-studio.canvas-runtime:create-canvas": bindQxHandler(specs["createCanvas"], implementation["createCanvas"], messages), "export:org.quixos.web-studio.canvas-runtime:create-placement": bindQxHandler(specs["createPlacement"], implementation["createPlacement"], messages), }, });