Implement scoped interface extents across QX, generated bindings, SDK, Orch, Camino and browser queries. Preserve native projection, aggregation, pagination and watch invalidation without synthetic persisted objects. Validate exact query grants and scope freshness on execution and replay. Add local PostgreSQL, transport, browser and code-generation coverage. C1 implementation slice only: full-text indexes and Studio search adoption (C2/C3) remain tracked in the implementation handoff. No publication or deployment.
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
import { type QxValueType } from "./bindings.js";
|
|
import type { QueryResponse } from "./camino/api_pb.js";
|
|
import type { QxObjectRef } from "./references.js";
|
|
export type QxQueryPartial<T> = T extends QxObjectRef ? T : T extends readonly (infer Item)[] ? QxQueryPartial<Item>[] : T extends object ? {
|
|
[Key in keyof T]?: QxQueryPartial<T[Key]>;
|
|
} : T;
|
|
export type QxQuerySnapshot<T> = {
|
|
runId: string;
|
|
sequence: bigint;
|
|
dataVersion: string;
|
|
bindingDigest: string;
|
|
consistency: string;
|
|
fields: {
|
|
path: readonly (string | number)[];
|
|
status: "pending" | "error";
|
|
error?: string;
|
|
}[];
|
|
} & ({
|
|
status: "ready";
|
|
data: T;
|
|
} | {
|
|
status: "partial";
|
|
data: QxQueryPartial<T>;
|
|
});
|
|
declare const queryTypes: unique symbol;
|
|
/** Generated shape evidence, not permission to run a query. */
|
|
export interface QxQueryDescriptor<Variables, Result, Root extends {
|
|
kind: "object" | "workspace-interface";
|
|
interface: string;
|
|
} = {
|
|
kind: "object" | "workspace-interface";
|
|
interface: string;
|
|
}> {
|
|
readonly id: string;
|
|
readonly definitionDigest: string;
|
|
readonly root: Root;
|
|
readonly variables: QxValueType;
|
|
readonly output: QxValueType;
|
|
readonly watch: boolean;
|
|
readonly [queryTypes]?: (variables: Variables, result: Result) => [Variables, Result];
|
|
}
|
|
export declare function decodeQuerySnapshot<T>(response: QueryResponse, output: QxValueType, runId: string, sequence: bigint): QxQuerySnapshot<T>;
|
|
export {};
|
|
//# sourceMappingURL=queries.d.ts.map
|