import { type Value } from "./camino/api_pb.js"; import { liveValue, type RuntimeHandler, type DerivedHandler } from "./index.js"; export type { QxObjectRef } from "./references.js"; declare const watchBrand: unique symbol; export type QxWatchHandle = string & { readonly [watchBrand]: true; }; export type MessageBinding = { encode(value: T): Value; decode(value: Value): T; }; export type QxLiveValue = ReturnType; export declare const opaqueReactPropsBinding: MessageBinding>; export type BindingValue = B extends MessageBinding ? T : never; export type QxHandler = (context: C) => O | Promise; export type QxDerived = { kind: "derived"; get: QxHandler; }; export type QxSession = { id: string; run(work: (context: C) => Promise): Promise; close(): Promise; }; export type QxContextLifecycle = { signal?: AbortSignal; openSession?: () => Promise>; }; export declare const qxDerived: (get: QxHandler) => QxDerived; /** Versioned binding ABI. This mirrors the language-neutral value IR. */ export type QxValueType = { kind: "builtin"; name: "unit" | "watch-handle"; } | { kind: "scalar"; name: string; } | { kind: "message"; descriptorId: string; } | { kind: "record"; fields: Record; } | { kind: "object-ref"; expectation: unknown; } | { kind: "optional" | "list"; value: QxValueType; }; export type QxOperationSpec = { id: string; inputType: QxValueType; outputType: QxValueType; }; export type QxPortSpec = { kind: "state"; id: string; valueType: QxValueType; primitives: string[]; } | { kind: "edge"; id: string; primitives: string[]; } | { kind: "interface"; id: string; operations: Record; } | { kind: "constructor"; id: string; inputType: QxValueType; }; export type QxHandlerSpec = { inputType: QxValueType; outputType: QxValueType; eventType?: QxValueType; ports: Record; }; export type QxMessages = Record>; export declare const decodeQxValue: (type: QxValueType, value: Value | undefined, messages: QxMessages) => any; export declare const encodeQxValue: (type: QxValueType, value: any, messages: QxMessages) => Value; /** The sole unchecked cast connects generated contracts to the dynamic RPC runtime. */ export declare const bindQxHandler: (spec: QxHandlerSpec, handler: QxHandler | QxDerived, messages: QxMessages) => RuntimeHandler | DerivedHandler; //# sourceMappingURL=bindings.d.ts.map