import { TypeMap, Table } from 'apache-arrow'; import z from 'zod'; declare enum Region { AWS_US_EAST_1 = "aws-us-east-1", AWS_US_EAST_2 = "aws-us-east-2", AWS_US_WEST_2 = "aws-us-west-2", AWS_EU_WEST_1 = "aws-eu-west-1", AWS_AP_SOUTH_1 = "aws-ap-south-1" } declare enum Runtime { TINY = "tiny", SMALL = "small", MEDIUM = "medium", LARGE = "large", X_LARGE = "x-large", XX_LARGE = "2x-large", XXXX_LARGE = "4x-large", MEDIUM_HIMEM = "medium-himem", LARGE_HIMEM = "large-himem", X_LARGE_HIMEM = "x-large-himem", XX_LARGE_HIMEM = "2x-large-himem", XXXX_LARGE_HIMEM = "4x-large-himem", TINY_A10_GPU = "tiny-a10-gpu", SMALL_A10_GPU = "small-a10-gpu", MEDIUM_A10_GPU = "medium-a10-gpu" } declare enum ResultsFormat { JSON = "json", ARROW = "arrow" } declare enum DataCompression { NONE = "none", GZIP = "gzip", BROTLI = "brotli" } declare enum GeometryRepresentation { WKT = "wkt", WKB = "wkb", EWKT = "ewkt", EWKB = "ewkb", GEOJSON = "geojson" } declare enum SessionType { SINGLE = "single", MULTI = "multi" } declare enum SessionStatus { PENDING = "PENDING", PREPARING = "PREPARING", PREPARE_FAILED = "PREPARE_FAILED", REQUESTED = "REQUESTED", DEPLOYING = "DEPLOYING", DEPLOY_FAILED = "DEPLOY_FAILED", DEPLOYED = "DEPLOYED", INITIALIZING = "INITIALIZING", INIT_FAILED = "INIT_FAILED", READY = "READY", DESTROY_REQUESTED = "DESTROY_REQUESTED", DESTROYING = "DESTROYING", DESTROY_FAILED = "DESTROY_FAILED", DESTROYED = "DESTROYED" } interface AuthCredentials { token?: string | undefined; apiKey?: string | undefined; } interface SocketApiSubset { send(data: string): void; close(): void; addEventListener(type: E, listener: (event: WebSocketEventMap[E]) => void, options?: AddEventListenerOptions): void; removeEventListener(type: E, listener: (event: WebSocketEventMap[E]) => void): void; } type OpenSocket = (url: string, auth: AuthCredentials) => SocketApiSubset; declare const ConnectionOptionsSchema: z.ZodObject<{ apiKey: z.ZodOptional; token: z.ZodOptional; apiUrl: z.ZodOptional; runtime: z.ZodOptional; region: z.ZodOptional; version: z.ZodOptional>; resultsFormat: z.ZodOptional>; dataCompression: z.ZodOptional>; geometryRepresentation: z.ZodOptional>; sessionType: z.ZodOptional>; forceNew: z.ZodOptional; shutdownAfterInactiveSeconds: z.ZodOptional; clientChain: z.ZodOptional; }, "strip", z.ZodTypeAny, { version?: string | null | undefined; apiKey?: string | undefined; token?: string | undefined; apiUrl?: string | undefined; runtime?: string | undefined; region?: string | undefined; resultsFormat?: ResultsFormat.ARROW | undefined; dataCompression?: DataCompression | undefined; geometryRepresentation?: GeometryRepresentation | undefined; sessionType?: SessionType | undefined; forceNew?: boolean | undefined; shutdownAfterInactiveSeconds?: number | undefined; clientChain?: string | undefined; }, { version?: string | null | undefined; apiKey?: string | undefined; token?: string | undefined; apiUrl?: string | undefined; runtime?: string | undefined; region?: string | undefined; resultsFormat?: ResultsFormat.ARROW | undefined; dataCompression?: DataCompression | undefined; geometryRepresentation?: GeometryRepresentation | undefined; sessionType?: SessionType | undefined; forceNew?: boolean | undefined; shutdownAfterInactiveSeconds?: number | undefined; clientChain?: string | undefined; }>; type ConnectionOptions = z.infer; type ConnectionTestHarness = { fetch: typeof fetch; openSocket?: OpenSocket; protocolVersion?: string | undefined; }; type ExecuteOptions = { signal?: AbortSignal; }; declare class Connection { static connect(options: ConnectionOptions, testHarness?: ConnectionTestHarness): Promise; static connectDirect(wsUrl: string, options: ConnectionOptions): Promise; private options; private fetch; private fetchOptions; private apiUrl; private compression; private openSocket; private ws; private protocolVersion; private wsListeners; private sessionAbortController; constructor(options: ConnectionOptions, testHarness?: ConnectionTestHarness); private establishSession; private connectToWebSocket; private openWebSocket; execute(statement: string, options?: ExecuteOptions): Promise>; private waitForMessage; private addWsListener; private onWsError; private onWsClose; close(): void; [Symbol.dispose](): void; } export { Connection, type ConnectionOptions, DataCompression, GeometryRepresentation, Region, ResultsFormat, Runtime, SessionStatus, SessionType };