Export template source from 810617559b0ee9c662c4b566e16cb3629b44fbce:quixos-instance/packages/web-studio-canvas-runtime
This commit is contained in:
+128
@@ -0,0 +1,128 @@
|
||||
// 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<typeof message0>) => Promise<void> }; "size": { "set": (value: BindingValue<typeof message1>) => Promise<void> }; "z": { "set": (value: number) => Promise<void> }; "canvas": { "connect": (target: QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">) => Promise<void> }; "subject": { "connect": (target: QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">) => Promise<void> } } } & 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<typeof message0>) => Promise<void> }; "size": { "set": (value: BindingValue<typeof message1>) => Promise<void> }; "z": { "set": (value: number) => Promise<void> }; "canvas": { "connect": (target: QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">) => Promise<void> }; "subject": { "connect": (target: QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">) => Promise<void> } } } & {signal?: AbortSignal}> };
|
||||
export type Implementation = { "createCanvas": QxHandler<Contexts["createCanvas"], QxObjectRef<"atom:atom:org.quixos.web-studio:canvas">>; "createPlacement": QxHandler<Contexts["createPlacement"], QxObjectRef<"atom:atom:org.quixos.web-studio:canvas-placement">> };
|
||||
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<string, QxHandlerSpec>;
|
||||
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),
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user