import { z } from 'zod'; import { ListRowsResponse, SeaTableRow, SeaTableTable } from './types.js'; export interface SeaTableClientConfig { serverUrl: string; apiToken: string; timeoutMs?: number; } declare const ListRowsQuerySchema: z.ZodObject<{ table: z.ZodString; page: z.ZodDefault; page_size: z.ZodDefault; }, "strip", z.ZodTypeAny, { table: string; page: number; page_size: number; }, { table: string; page?: number | undefined; page_size?: number | undefined; }>; export type ListRowsQuery = z.infer; /** Escape backticks in SQL identifiers to prevent injection. */ export declare function sanitizeIdentifier(name: string): string; export declare class SeaTableClient { private readonly tokenManager; private readonly limiter; private readonly serverUrl; private readonly apiToken; private readonly timeoutMs; private http?; private initialized; private initializing?; private metadataCache?; private static readonly METADATA_CACHE_TTL_MS; constructor(config: SeaTableClientConfig); /** Returns dtable_uuid and app_name from the last token exchange (available after first API call). */ getBaseInfo(): { dtableUuid?: string; appName?: string; }; private ensureInitialized; private init; private request; getMetadata(): Promise; clearMetadataCache(): void; listTables(): Promise; listRows(query: { table: string; page?: number; page_size?: number; }): Promise; getRow(table: string, rowId: string): Promise; addRow(table: string, row: Record): Promise; addRows(table: string, rows: Array>): Promise; updateRow(table: string, rowId: string, row: Record): Promise; updateRows(table: string, updates: Array<{ row_id: string; row: Record; }>): Promise<{ success: boolean; }>; deleteRow(table: string, rowId: string): Promise<{ success: boolean; }>; deleteRows(table: string, rowIds: string[]): Promise<{ success: boolean; }>; searchRows(table: string, query: Record): Promise; querySql(sql: string, parameters?: any[]): Promise<{ metadata: any; results: any[]; }>; listCollaborators(): Promise>; private resolveLinkColumn; createLinks(args: { table: string; linkColumn: string; pairs: Array<{ fromRowId: string; toRowId: string; }>; }): Promise; deleteLinks(args: { table: string; linkColumn: string; pairs: Array<{ fromRowId: string; toRowId: string; }>; }): Promise; addColumnOptions(args: { table: string; column: string; options: Array<{ name: string; color?: string; textColor?: string; }>; }): Promise; uploadFile(args: { table: string; column: string; rowId: string; fileName: string; fileData: string; replace?: boolean; }): Promise<{ file_name: string; file_size: number; asset_url: string; column_type: string; }>; getRowActivities(rowId: string, page?: number): Promise<{ activities: any[]; total_count: number; }>; createSnapshot(): Promise<{ status: string; snapshot: { dtable_uuid: string; dtable_name: string; commit_id: string; ctime: number; }; }>; private static readonly TEXT_EXTENSIONS; private static readonly MAX_FILE_SIZE; downloadFile(args: { table: string; column: string; rowId: string; fileName?: string; }): Promise<{ file_name: string; file_size: number; content: string; content_type: 'text' | 'pdf_text' | 'binary_url'; download_link?: string; }>; } /** Create a client from environment variables (selfhosted mode). */ export declare function createClientFromEnv(): SeaTableClient; /** Create a client from a provided API token (managed mode). Server URL from env. */ export declare function createClientFromToken(apiToken: string): SeaTableClient; export {}; //# sourceMappingURL=client.d.ts.map