241 lines
13 KiB
TypeScript
241 lines
13 KiB
TypeScript
// Generated by quixos-codegen-ts. Do not edit. Binding ABI version 1.
|
|
import { bindQxHandler, type BindingValue, type QxObjectRef, type QxHandler, type QxContextLifecycle, type QxLiveValue, 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";
|
|
declare const appliedType: unique symbol;
|
|
type QxApplied<Definition extends string, Arguments extends readonly unknown[]> = string & {readonly [appliedType]: (value: [Definition, Arguments]) => [Definition, Arguments]};
|
|
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": { "placement": { "objectId": QxObjectRef<"interface:interface:org.quixos.web-studio.canvas-placement@1">; "live": { "position.get": () => Promise<QxLiveValue>; "position.set": (input: BindingValue<typeof message0>) => Promise<QxLiveValue>; "size.get": () => Promise<QxLiveValue>; "size.set": (input: BindingValue<typeof message1>) => Promise<QxLiveValue>; "z.get": () => Promise<QxLiveValue>; "z.set": (input: number) => Promise<QxLiveValue>; "subject.resolve": () => Promise<QxLiveValue>; "subject.connect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">) => Promise<QxLiveValue>; "subject.disconnect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">) => Promise<QxLiveValue>; "canvas.resolve": () => Promise<QxLiveValue>; "canvas.connect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">) => Promise<QxLiveValue>; "canvas.disconnect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">) => Promise<QxLiveValue> }; "position.get": () => Promise<BindingValue<typeof message0>>; "position.set": (input: BindingValue<typeof message0>) => Promise<null>; "size.get": () => Promise<BindingValue<typeof message1>>; "size.set": (input: BindingValue<typeof message1>) => Promise<null>; "z.get": () => Promise<number>; "z.set": (input: number) => Promise<null>; "subject.resolve": () => Promise<QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">>; "subject.connect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">) => Promise<null>; "subject.disconnect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">) => Promise<null>; "canvas.resolve": () => Promise<QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">>; "canvas.connect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">) => Promise<null>; "canvas.disconnect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">) => Promise<null> } } } & 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": { "placement": { "objectId": QxObjectRef<"interface:interface:org.quixos.web-studio.canvas-placement@1">; "live": { "position.get": () => Promise<QxLiveValue>; "position.set": (input: BindingValue<typeof message0>) => Promise<QxLiveValue>; "size.get": () => Promise<QxLiveValue>; "size.set": (input: BindingValue<typeof message1>) => Promise<QxLiveValue>; "z.get": () => Promise<QxLiveValue>; "z.set": (input: number) => Promise<QxLiveValue>; "subject.resolve": () => Promise<QxLiveValue>; "subject.connect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">) => Promise<QxLiveValue>; "subject.disconnect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">) => Promise<QxLiveValue>; "canvas.resolve": () => Promise<QxLiveValue>; "canvas.connect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">) => Promise<QxLiveValue>; "canvas.disconnect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">) => Promise<QxLiveValue> }; "position.get": () => Promise<BindingValue<typeof message0>>; "position.set": (input: BindingValue<typeof message0>) => Promise<null>; "size.get": () => Promise<BindingValue<typeof message1>>; "size.set": (input: BindingValue<typeof message1>) => Promise<null>; "z.get": () => Promise<number>; "z.set": (input: number) => Promise<null>; "subject.resolve": () => Promise<QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">>; "subject.connect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">) => Promise<null>; "subject.disconnect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.placeable@1">) => Promise<null>; "canvas.resolve": () => Promise<QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">>; "canvas.connect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">) => Promise<null>; "canvas.disconnect": (input: QxObjectRef<"interface:interface:org.quixos.web-studio.canvas@1">) => Promise<null> } } } & {signal?: AbortSignal}> };
|
|
export type Results = { "createCanvas": QxObjectRef<"atom:atom:org.quixos.web-studio:canvas">; "createPlacement": QxObjectRef<"atom:atom:org.quixos.web-studio:canvas-placement"> };
|
|
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": {
|
|
"placement": {
|
|
"kind": "interface",
|
|
"id": "port:web-studio-placement-constructor:placement",
|
|
"operations": {
|
|
"position.get": {
|
|
"id": "operation:org.quixos.web-studio.canvas-placement:position:get",
|
|
"inputType": {
|
|
"kind": "builtin",
|
|
"name": "unit"
|
|
},
|
|
"outputType": {
|
|
"kind": "message",
|
|
"descriptorId": "org.quixos.web-studio.CanvasPosition"
|
|
}
|
|
},
|
|
"position.set": {
|
|
"id": "operation:org.quixos.web-studio.canvas-placement:position:set",
|
|
"inputType": {
|
|
"kind": "message",
|
|
"descriptorId": "org.quixos.web-studio.CanvasPosition"
|
|
},
|
|
"outputType": {
|
|
"kind": "builtin",
|
|
"name": "unit"
|
|
}
|
|
},
|
|
"size.get": {
|
|
"id": "operation:org.quixos.web-studio.canvas-placement:size:get",
|
|
"inputType": {
|
|
"kind": "builtin",
|
|
"name": "unit"
|
|
},
|
|
"outputType": {
|
|
"kind": "message",
|
|
"descriptorId": "org.quixos.web-studio.CanvasSize"
|
|
}
|
|
},
|
|
"size.set": {
|
|
"id": "operation:org.quixos.web-studio.canvas-placement:size:set",
|
|
"inputType": {
|
|
"kind": "message",
|
|
"descriptorId": "org.quixos.web-studio.CanvasSize"
|
|
},
|
|
"outputType": {
|
|
"kind": "builtin",
|
|
"name": "unit"
|
|
}
|
|
},
|
|
"z.get": {
|
|
"id": "operation:org.quixos.web-studio.canvas-placement:z:get",
|
|
"inputType": {
|
|
"kind": "builtin",
|
|
"name": "unit"
|
|
},
|
|
"outputType": {
|
|
"kind": "scalar",
|
|
"name": "int32"
|
|
}
|
|
},
|
|
"z.set": {
|
|
"id": "operation:org.quixos.web-studio.canvas-placement:z:set",
|
|
"inputType": {
|
|
"kind": "scalar",
|
|
"name": "int32"
|
|
},
|
|
"outputType": {
|
|
"kind": "builtin",
|
|
"name": "unit"
|
|
}
|
|
},
|
|
"subject.resolve": {
|
|
"id": "operation:org.quixos.web-studio.canvas-placement:subject:resolve",
|
|
"inputType": {
|
|
"kind": "builtin",
|
|
"name": "unit"
|
|
},
|
|
"outputType": {
|
|
"kind": "object-ref",
|
|
"expectation": {
|
|
"kind": "interface",
|
|
"interfaceRevisionId": "interface:org.quixos.web-studio.placeable@1"
|
|
}
|
|
}
|
|
},
|
|
"subject.connect": {
|
|
"id": "operation:org.quixos.web-studio.canvas-placement:subject:connect",
|
|
"inputType": {
|
|
"kind": "object-ref",
|
|
"expectation": {
|
|
"kind": "interface",
|
|
"interfaceRevisionId": "interface:org.quixos.web-studio.placeable@1"
|
|
}
|
|
},
|
|
"outputType": {
|
|
"kind": "builtin",
|
|
"name": "unit"
|
|
}
|
|
},
|
|
"subject.disconnect": {
|
|
"id": "operation:org.quixos.web-studio.canvas-placement:subject:disconnect",
|
|
"inputType": {
|
|
"kind": "object-ref",
|
|
"expectation": {
|
|
"kind": "interface",
|
|
"interfaceRevisionId": "interface:org.quixos.web-studio.placeable@1"
|
|
}
|
|
},
|
|
"outputType": {
|
|
"kind": "builtin",
|
|
"name": "unit"
|
|
}
|
|
},
|
|
"canvas.resolve": {
|
|
"id": "operation:org.quixos.web-studio.canvas-placement:canvas:resolve",
|
|
"inputType": {
|
|
"kind": "builtin",
|
|
"name": "unit"
|
|
},
|
|
"outputType": {
|
|
"kind": "object-ref",
|
|
"expectation": {
|
|
"kind": "interface",
|
|
"interfaceRevisionId": "interface:org.quixos.web-studio.canvas@1"
|
|
}
|
|
}
|
|
},
|
|
"canvas.connect": {
|
|
"id": "operation:org.quixos.web-studio.canvas-placement:canvas:connect",
|
|
"inputType": {
|
|
"kind": "object-ref",
|
|
"expectation": {
|
|
"kind": "interface",
|
|
"interfaceRevisionId": "interface:org.quixos.web-studio.canvas@1"
|
|
}
|
|
},
|
|
"outputType": {
|
|
"kind": "builtin",
|
|
"name": "unit"
|
|
}
|
|
},
|
|
"canvas.disconnect": {
|
|
"id": "operation:org.quixos.web-studio.canvas-placement:canvas:disconnect",
|
|
"inputType": {
|
|
"kind": "object-ref",
|
|
"expectation": {
|
|
"kind": "interface",
|
|
"interfaceRevisionId": "interface:org.quixos.web-studio.canvas@1"
|
|
}
|
|
},
|
|
"outputType": {
|
|
"kind": "builtin",
|
|
"name": "unit"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} 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),
|
|
},
|
|
});
|