import { type MysqlError } from './stream.js'; /** Sends bytes and returns every byte the server answered to them. */ export type MysqlExchange = (bytes: Uint8Array) => Promise; export type MysqlResultSet = { columns: { name: string; type: number; flags: number; }[]; rows: (string | null)[][]; }; export type MysqlAnswer = MysqlResultSet | { affectedRows: number; insertId: number; } | { error: MysqlError; }; /** Sign in: the server's greeting, then the handshake response (mysql_native_password), following an auth switch. */ export declare function mysqlSignIn(exchange: MysqlExchange, greeting: Uint8Array, user: string, password: string, database: string | null): Promise<{ ok: true; } | { error: MysqlError; }>; /** A text query (COM_QUERY): the first result of a script, as mysql_async reads it. */ export declare function mysqlQuery(exchange: MysqlExchange, sql: string): Promise; /** A prepared statement executed once with text-typed parameters (COM_STMT_PREPARE, EXECUTE, CLOSE), as Prisma sends a * parameterised query: binary parameters and rows. */ export declare function mysqlExecute(exchange: MysqlExchange, sql: string, params: (string | null)[]): Promise;