import type { Patch } from "./patch"; import type { QueryResult } from "./query-result"; import type { RpcMethod } from "./rpc-request"; type Arrayable = TResult | TResult[]; type TypeMap = Record<"Uuid" | "Thing", object>; type NormalRecord = { id: string | TTypeMap["Thing"]; [p: string]: unknown; }; type RelationRecord = { id: string | TTypeMap["Thing"]; in: string | TTypeMap["Thing"]; out: string | TTypeMap["Thing"]; [p: string]: unknown; }; export type RpcResultMapping = { ping: void; use: void; info: NormalRecord | null | undefined; signup: string; signin: string; authenticate: void; invalidate: void; let: void; unset: void; live: string | TTypeMap["Uuid"]; kill: void; query: QueryResult[]; select: Arrayable>; create: Arrayable>; insert: NormalRecord[]; insert_relation: RelationRecord[]; update: Arrayable>; upsert: Arrayable>; merge: Arrayable>; patch: Arrayable> | Arrayable[]; delete: Arrayable>; version: string; run: unknown; graphql: string; relate: Arrayable>; }; export type RpcResult = RpcResultMapping[TMethod]; export type BidirectionalRpcResponseOk = { id: `${RpcMethod}_${number}`; result: TResult; error?: never; }; export type BidirectionalRpcResponseErr = { id: `${RpcMethod}_${number}`; result?: never; error: { code: number; message: string; }; }; export type BidirectionalRpcResponse = BidirectionalRpcResponseOk | BidirectionalRpcResponseErr; export type IdLessRpcResponseOk = Omit, "id">; export type IdLessRpcResponseErr = Omit; export type IdLessRpcResponse = IdLessRpcResponseOk | IdLessRpcResponseErr; export type RpcResponse = BidirectionalRpcResponse | IdLessRpcResponse; export {}; //# sourceMappingURL=rpc-response.d.ts.map