import type ClientBase from "@tai-kun/surrealdb/basic-client"; import type { ClientCloseOptions, ClientConfig } from "@tai-kun/surrealdb/basic-client"; import { type CreateSurqlConfig, type Surql } from "./surql/create-surql"; type ClientConstructor = new (config: ClientConfig) => ClientBase; /** * @experimental */ export interface PoolSetupOptions { readonly signal?: AbortSignal | undefined; } type Alias = { readonly [name: string]: string | URL; }; /** * @experimental */ export interface PoolInit extends ClientConfig, CreateSurqlConfig { readonly Client: TClientConstructor; readonly alias?: TAlias | undefined; readonly setup?: (this: InstanceType, endpoint: URL, options: PoolSetupOptions, alias: keyof TAlias | undefined) => PromiseLike; } /** * @experimental */ export type PoolSurreal = InstanceType & Disposable & { disconnect(options?: ClientCloseOptions | undefined): void; }; type Endpoint = Extract; /** * @experimental */ export interface PoolInstance extends AsyncDisposable { get(endpoint: Endpoint | URL, options?: PoolSetupOptions | undefined): Promise>; close(endpoint: Endpoint | URL, options?: ClientCloseOptions | undefined): Promise; closeAll(options?: ClientCloseOptions | undefined): Promise; } /** * @experimental */ export interface PoolOptions { readonly alias?: TAlias | undefined; readonly setup?: PoolInit["setup"]; readonly closeDelay?: number | undefined; } /** * @experimental */ export interface InitializedPool { Pool: new (options?: PoolOptions | undefined) => PoolInstance & TPoolAlias>; surql: Surql; } /** * @experimental */ export default function initPool(init: PoolInit): InitializedPool; export {}; //# sourceMappingURL=init-pool.d.ts.map