import { a as Storage, d as StorageStartOptions, T as Trace, S as Selector, e as CreateResourceOptions, I as InstanceFor, M as MetadataFor, f as DatabaseMetadata, N as NamespaceMetadata } from '../shared/hive.DlaRxYsk.js'; import { RowObject, RowValues, Transaction, TransactionResult } from '../sdk/transaction.js'; import { ByteStream } from '../streams/index.js'; import { W as WebSocketClient, P as Protocol } from '../shared/hive.C0j2V6KY.js'; import '../sdk/logger.js'; import 'zod'; //#region src/index.d.ts type RemoteStorageConfig = { /** * Address to reach the API of the remote `Server` instance at. * * The `RemoteStorage` will automatically append the API version to the * configured address. * * @example * ```ts * new RemoteStorage({ * remote: 'http://localhost:3000/api', * // => 'http://localhost:3000/api/v1' * }); * ``` * * @example * ```ts * new RemoteStorage({ * remote: 'https://api.acme.co', * // => 'https://api.acme.co/v1' * }); * ``` */ remote: string; /** * Token to use for authentication. * * @default null */ token?: string | null | undefined; /** * Transport layer to use for communicating with the remote instance. * * @default 'http' */ transport?: 'http' | 'ws' | null | undefined; }; declare class RemoteStorage extends Storage { static readonly name = "remote-storage"; /** * Address to reach the remote `Server` instance at. */ private readonly remote; /** * Token to use for authentication. */ private readonly token; /** * Transport layer to use for communicating with the remote instance. */ transport: 'http' | 'ws' | null | undefined; /** * If configured, a WebSocketClient instance to use for communicating with * the remote instance. */ wsc: WebSocketClient | null; /** * EventEmitter instance to use for emitting events. */ private events; /** * Logger instance to use for logging. */ private logger; /** * Error handler to invoke with any errors which might occur during * background tasks. */ private onError; /** * ApiClient instance to use for interacting with the remote `Hive` * instance through its REST API. */ private readonly api; /** * If starting, a Reference to the Promise resolving to the RemoteStorage * instance once it has been started. */ private starting; /** * If stopping, a Reference to the Promise resolving to the RemoteStorage * instance once it has been stopped. */ private stopping; constructor(config: RemoteStorageConfig); start(opts: Omit & { logger?: StorageStartOptions['logger'] | null | undefined; onError?: StorageStartOptions['onError'] | null | undefined; trace?: Trace | null | undefined; emit?: boolean | null | undefined; }): Promise; stop(opts?: { trace?: Trace | null | undefined; emit?: boolean | null | undefined; }): Promise; create(selector: S, opts?: CreateResourceOptions): Promise<{ resource: InstanceFor; metadata: MetadataFor; }>; list(opts?: { parent?: Selector<'namespace' | 'database'> | null | undefined; trace?: Trace | null | undefined; emit?: boolean | null | undefined; }): Promise>; has(selector: Selector, opts?: { trace?: Trace | null | undefined; emit?: boolean | null | undefined; }): Promise; get(selector: S, opts?: { trace?: Trace | null | undefined; emit?: boolean | null | undefined; }): Promise<{ resource: InstanceFor; metadata: MetadataFor; }>; getMetadata(selector: S, opts?: { trace?: Trace | null | undefined; emit?: boolean | null | undefined; }): Promise>; getContents(selector: Selector<'database' | 'snapshot' | 'branch'>, opts?: { trace?: Trace | null | undefined; emit?: boolean | null | undefined; }): Promise<{ contents: ByteStream; metadata: DatabaseMetadata; }>; setContents(selector: Selector<'database' | 'snapshot' | 'branch'>, contents: ByteStream | Uint8Array | Selector<'database' | 'snapshot' | 'branch'>, opts?: { trace?: Trace | null | undefined; emit?: boolean | null | undefined; }): Promise; query = ReadonlyArray>(selector: Selector<'database' | 'snapshot' | 'branch'>, transaction: Transaction, opts?: { trace?: Trace | null | undefined; emit?: boolean | null | undefined; }): Promise>; free(selector: Selector, opts?: { trace?: Trace | null | undefined; emit?: boolean | null | undefined; }): Promise; delete(selector: Selector, opts?: { trace?: Trace | null | undefined; emit?: boolean | null | undefined; }): Promise; } export { RemoteStorage }; export type { RemoteStorageConfig };