import type { SqlClient, SetupOptions, PgFileSystemOptions } from "../../core/types.js"; import { PgFileSystem as CorePgFileSystem } from "../../core/filesystem.js"; export { FsQuotaError } from "../../core/types.js"; export type { VersionDiffCountOptions, VersionDiffOptions, VersionDiffStreamOptions, WorkspaceUsage, WorkspaceUsageOptions, } from "../../core/types.js"; /** * Structural interface matching `pg.PoolClient`. * Keeps `pg` as a peer dep: no direct import required. */ export interface NodePgPoolClient { query(text: string, values?: unknown[]): Promise<{ rows: Record[]; rowCount: number | null; }>; release(err?: Error | boolean): void; } /** * Structural interface matching `pg.Pool`. */ export interface NodePgPool { query(text: string, values?: unknown[]): Promise<{ rows: Record[]; rowCount: number | null; }>; connect(): Promise; } /** * Creates a SqlClient backed by a node-postgres Pool. * * @example * ```ts * import pg from "pg"; * import { createNodePgClient } from "bash-gres/node-postgres"; * * const pool = new pg.Pool({ connectionString: "postgres://localhost:5432/mydb" }); * const client = createNodePgClient(pool); * ``` */ export declare function createNodePgClient(pool: NodePgPool): SqlClient; /** * node-postgres-native setup: accepts a `pg.Pool` instance directly. * * @example * ```ts * import pg from "pg"; * import { setup } from "bash-gres/node-postgres"; * * const pool = new pg.Pool({ connectionString: "postgres://localhost:5432/mydb" }); * await setup(pool); * ``` */ export declare function setup(pool: NodePgPool, options?: SetupOptions): Promise; export type NodePgFileSystemOptions = Omit & { db: NodePgPool; }; /** * PgFileSystem that accepts a `pg.Pool` instance directly. * * @example * ```ts * import pg from "pg"; * import { PgFileSystem } from "bash-gres/node-postgres"; * * const pool = new pg.Pool({ connectionString: "postgres://localhost:5432/mydb" }); * const fs = new PgFileSystem({ db: pool, workspaceId: "ws-1" }); * ``` */ export declare class PgFileSystem extends CorePgFileSystem { constructor(options: NodePgFileSystemOptions); } //# sourceMappingURL=index.d.ts.map