import { type Client } from "@connectrpc/connect"; import { type CaminoAutomergeDoc } from "@quixos/camino-datatypes/crdt-automerge"; import { CaminoService, type Value } from "./camino/api_pb.js"; import { type InvokeRequest } from "./quixos/runtime_pb.js"; declare const objectRefBrand: unique symbol; export type ObjectRef = string & { readonly [objectRefBrand]: ClassId; }; export type CaminoClient = Client; export type { InvokeRequest, Value }; export type DerivedDependency = { kind: "object"; objectId: string; } | { kind: "field"; objectId: string; fieldName: string; } | { kind: "edges"; objectId: string; sourceField?: string; }; export declare const recordDerivedDependency: (dependency: DerivedDependency) => void; export declare const getActiveDerivedDependencies: () => DerivedDependency[]; export declare const runWithDerivedDependencyTracking: (fn: () => Promise | T) => Promise<{ value: T; dependencies: DerivedDependency[]; }>; export type Field = { get(): Promise; set(value: T): Promise; }; export type CrdtField = Field> & { change(fn: (doc: { value: T; }) => void): Promise>; replaceFromJson(value: T): Promise; }; export type LiveFieldValue = { $caminoValue: T; $caminoSource: { field: { objectId: string; fieldName: string; fieldType?: string; fieldStorage?: string; conflictStrategy?: string; revision?: number | string | bigint; }; }; }; export declare const liveFieldValue: (params: { value: T; objectId: string; fieldName: string; fieldType?: string; fieldStorage?: string; conflictStrategy?: string; revision?: number | string | bigint; }) => LiveFieldValue; export type RuntimeHandler = (context: Context) => Promise | unknown; export type FieldOperation = { get?: RuntimeHandler; set?: RuntimeHandler; watchStart?: RuntimeHandler; watchStop?: RuntimeHandler; }; export declare const fieldOps: (operation: FieldOperation) => FieldOperation; export declare const derivedWithDeps: (operation: { get: RuntimeHandler; }) => FieldOperation; export type RuntimeFunctionSpec = { exportName: ExportName; symbol: string; operation?: string; field?: { name: string; type?: string; storage?: string; conflict?: string; }; }; type FieldCodec = { fieldType?: string; conflictStrategy?: string; }; export declare const jsToProtoValue: (value: unknown, codec?: FieldCodec) => Value; export declare const protoValueToJs: (value: Value | undefined) => unknown; export declare const jsObjectToProtoFields: (value: Record) => { [k: string]: Value; }; export declare const protoFieldsToJs: (fields: Record | undefined) => Record; export declare const canonicalFieldParams: (params: Record | undefined) => string; export declare const fieldOperationKey: (params: { objectId: string; fieldName: string; input?: Record; }) => string; export declare const objectRef: (objectId: string) => ObjectRef; export declare const createField: (camino: CaminoClient, objectId: string, fieldName: string, codec?: FieldCodec) => Field; export declare const createCrdtField: (camino: CaminoClient, objectId: string, fieldName: string, fieldType: string) => CrdtField; export declare const serveQuixosPackageRuntime: (params: { packageNamespace: string; packageName: string; runtimeProtocolVersion: string; functions: Spec; implementation: { [Name in Spec[number]["exportName"]]: RuntimeHandler | FieldOperation; }; createContext: (camino: CaminoClient, request: InvokeRequest) => Context; }) => void; //# sourceMappingURL=index.d.ts.map