import { z } from 'zod'; import { type SqlfuCommandConfirmParams } from '../api/internal.js'; import type { AdHocSqlParams, AdHocSqlResult, DisposableClient, SqlfuHost, SqlfuUiHost } from '../host.js'; import type { Client, SqlfuProjectConfig } from '../types.js'; import type { QueryExecutionResponse, SchemaCheckCard, SchemaCheckRecommendation, StudioForeignKey, StudioReverseForeignKey, TableRowsResponse } from './shared.js'; export type ResolvedUiProject = { initialized: true; projectRoot: string; config: SqlfuProjectConfig; } | { initialized: false; projectRoot: string; configPath: string; }; export type SqlfuUiProjectConfig = Partial> & { generate?: Partial; }; export type SqlfuUiProject = { initialized: true; projectRoot: string; config?: SqlfuUiProjectConfig; } | { initialized: false; projectRoot: string; configPath?: string; }; export type UiRouterContext = { project: SqlfuUiProject; host: SqlfuUiHost; }; type ResolvedSqlfuUiHost = Omit & { openDb(config: SqlfuProjectConfig): Promise; openScratchDb(slug: string): Promise; execAdHocSql(client: Client, sql: string, params: AdHocSqlParams): Promise; }; export declare const uiRouter: { project: { status: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, import("@orpc/server").Schema, import("@orpc/server").Schema<{ initialized: boolean; projectRoot: string; serverVersion: string; }, { initialized: boolean; projectRoot: string; serverVersion: string; }>, Record, Record>; }; schema: { get: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, import("@orpc/server").Schema, import("@orpc/server").Schema<{ projectName: string; projectRoot: string; relations: { name: string; kind: "table" | "view"; rowCount: number; columns: { name: string; type: string; notNull: boolean; primaryKey: boolean; }[]; foreignKeys: StudioForeignKey[]; referencedBy: StudioReverseForeignKey[]; sql: string | undefined; }[]; }, { projectName: string; projectRoot: string; relations: { name: string; kind: "table" | "view"; rowCount: number; columns: { name: string; type: string; notNull: boolean; primaryKey: boolean; }[]; foreignKeys: StudioForeignKey[]; referencedBy: StudioReverseForeignKey[]; sql: string | undefined; }[]; }>, Record, Record>; check: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, import("@orpc/server").Schema, import("@orpc/server").Schema<{ cards: SchemaCheckCard[]; recommendations: SchemaCheckRecommendation[]; error?: undefined; } | { cards: never[]; recommendations: never[]; error: string; }, { cards: SchemaCheckCard[]; recommendations: SchemaCheckRecommendation[]; error?: undefined; } | { cards: never[]; recommendations: never[]; error: string; }>, Record, Record>; authorities: { get: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, import("@orpc/server").Schema, import("@orpc/server").Schema<{ desiredSchemaSql: string; migrations: ({ id: string; fileName: string; content: string; applied: boolean; applied_at: string | null; integrity: "checksum mismatch" | "ok" | null; timestamp: undefined; name: string; } | { id: string; fileName: string; content: string; applied: boolean; applied_at: string | null; integrity: "checksum mismatch" | "ok" | null; timestamp: string; name: string; })[]; migrationHistory: ({ id: string; fileName: string | null; content: string; applied: boolean; applied_at: string; integrity: "checksum mismatch" | "ok"; timestamp: undefined; name: string; } | { id: string; fileName: string | null; content: string; applied: boolean; applied_at: string; integrity: "checksum mismatch" | "ok"; timestamp: string; name: string; })[]; liveSchemaSql: string; }, { desiredSchemaSql: string; migrations: ({ id: string; fileName: string; content: string; applied: boolean; applied_at: string | null; integrity: "checksum mismatch" | "ok" | null; timestamp: undefined; name: string; } | { id: string; fileName: string; content: string; applied: boolean; applied_at: string | null; integrity: "checksum mismatch" | "ok" | null; timestamp: string; name: string; })[]; migrationHistory: ({ id: string; fileName: string | null; content: string; applied: boolean; applied_at: string; integrity: "checksum mismatch" | "ok"; timestamp: undefined; name: string; } | { id: string; fileName: string | null; content: string; applied: boolean; applied_at: string; integrity: "checksum mismatch" | "ok"; timestamp: string; name: string; })[]; liveSchemaSql: string; }>, Record, Record>; resultantSchema: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ source: z.ZodEnum<{ history: "history"; migrations: "migrations"; }>; id: z.ZodString; }, z.core.$strip>, import("@orpc/server").Schema<{ sql: string; }, { sql: string; }>, Record, Record>; }; command: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ command: z.ZodString; }, z.core.$strip>, import("@orpc/server").Schema, AsyncGenerator>, Record, Record>; submitConfirmation: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ id: z.ZodString; body: z.ZodNullable; }, z.core.$strip>, import("@orpc/server").Schema<{ ok: true; }, { ok: true; }>, Record, Record>; definitions: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ sql: z.ZodString; }, z.core.$strip>, import("@orpc/server").Schema<{ readonly ok: true; }, { readonly ok: true; }>, Record, Record>; }; catalog: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, import("@orpc/server").Schema, import("@orpc/server").Schema, Record, Record>; table: { list: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ relationName: z.ZodString; page: z.ZodNumber; pageSize: z.ZodNumber; }, z.core.$strip>, import("@orpc/server").Schema, Record, Record>; save: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ relationName: z.ZodString; page: z.ZodNumber; pageSize: z.ZodNumber; originalRows: z.ZodArray>; rows: z.ZodArray>; rowKeys: z.ZodArray; values: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"new">; value: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"rowid">; value: z.ZodNumber; }, z.core.$strip>], "kind">>; }, z.core.$strip>, import("@orpc/server").Schema, Record, Record>; delete: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ relationName: z.ZodString; page: z.ZodNumber; pageSize: z.ZodNumber; originalRow: z.ZodRecord; rowKey: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"primaryKey">; values: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"new">; value: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"rowid">; value: z.ZodNumber; }, z.core.$strip>], "kind">; }, z.core.$strip>, import("@orpc/server").Schema, Record, Record>; }; sql: { run: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ sql: z.ZodString; params: z.ZodOptional; }, z.core.$strip>, import("@orpc/server").Schema<{ sql: string; mode: 'rows'; rows: { [k: string]: any; }[]; metadata?: undefined; } | { sql: string; mode: 'metadata'; metadata: import("../types.js").QueryMetadata; rows?: undefined; }, { sql: string; mode: 'rows'; rows: { [k: string]: any; }[]; metadata?: undefined; } | { sql: string; mode: 'metadata'; metadata: import("../types.js").QueryMetadata; rows?: undefined; }>, Record, Record>; analyze: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ sql: z.ZodString; }, z.core.$strip>, import("@orpc/server").Schema, Record, Record>; save: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ sql: z.ZodString; name: z.ZodString; }, z.core.$strip>, import("@orpc/server").Schema<{ savedPath: string; }, { savedPath: string; }>, Record, Record>; }; query: { execute: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ queryId: z.ZodString; data: z.ZodOptional>; params: z.ZodOptional>; }, z.core.$strip>, import("@orpc/server").Schema, Record, Record>; update: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ queryId: z.ZodString; sql: z.ZodString; }, z.core.$strip>, import("@orpc/server").Schema<{ id: string; sqlFile: string; }, { id: string; sqlFile: string; }>, Record, Record>; rename: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ queryId: z.ZodString; name: z.ZodString; }, z.core.$strip>, import("@orpc/server").Schema<{ id: string; sqlFile: string; }, { id: string; sqlFile: string; }>, Record, Record>; delete: import("@orpc/server").DecoratedProcedure, UiRouterContext, UiRouterContext>, import("@orpc/server").MergedCurrentContext, z.ZodObject<{ queryId: z.ZodString; }, z.core.$strip>, import("@orpc/server").Schema<{ id: string; sqlFile: string; }, { id: string; sqlFile: string; }>, Record, Record>; }; }; export type UiRouter = typeof uiRouter; export type CommandEvent = { kind: 'needsConfirmation'; id: string; params: SqlfuCommandConfirmParams; } | { kind: 'done'; }; export {};