import { type ConnectionInfo, type ConnectionState, type EngineAbc, type EngineAbcConfig, type EngineEventMap, type ProcessEndpointOptions } from "@tai-kun/surrealdb/engine"; import type { Formatter } from "@tai-kun/surrealdb/formatter"; import type { RpcMethod, RpcParams, RpcResult } from "@tai-kun/surrealdb/types"; import { type StatefulPromise, TaskEmitter, type TaskListener, type TaskListenerOptions } from "@tai-kun/surrealdb/utils"; export type CreateEngine = (config: EngineAbcConfig) => EngineAbc | PromiseLike; export type ClientEngines = { readonly [_ in string]?: CreateEngine | string | undefined; }; export interface ClientConfig { readonly engines: ClientEngines; readonly formatter: Formatter; readonly disableDefaultErrorHandler?: boolean | undefined; } export interface ClientConnectOptions extends ProcessEndpointOptions { readonly signal?: AbortSignal | undefined; } export interface ClientCloseOptions { readonly force?: boolean | undefined; readonly signal?: AbortSignal | undefined; } export interface ClientRpcOptions { readonly signal?: AbortSignal | undefined; } export default class BasicClient { protected readonly ee: TaskEmitter; protected readonly fmt: Formatter; protected eng: EngineAbc | null; private readonly _engines; constructor(config: ClientConfig); protected createEngine(scheme: string): Promise; /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/connecting/#state) */ get state(): ConnectionState; /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/connecting/#endpoint) */ get endpoint(): URL | null | undefined; /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/connecting/#namespace) */ get namespace(): string | null | undefined; /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/connecting/#database) */ get database(): string | null | undefined; /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/connecting/#token) */ get token(): string | null | undefined; /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/connecting/#getconnectioninfo) */ getConnectionInfo(): ConnectionInfo | undefined; /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/connecting/#on) */ on(event: TEvent, listener: TaskListener): void; /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/connecting/#off) */ off(event: TEvent, listener: TaskListener): void; /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/connecting/#once) */ once(event: TEvent, options?: TaskListenerOptions | undefined): StatefulPromise; /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/connecting/#connect) */ connect(endpoint: string | URL, options?: ClientConnectOptions | undefined): Promise; /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/connecting/#close) */ close(options?: ClientCloseOptions | undefined): Promise; rpc>(method: TMethod, params: RpcParams, options?: ClientRpcOptions | undefined): Promise; } //# sourceMappingURL=client.d.ts.map