import type { BlipClient } from '../client.ts'; import { type Command, type CommandMethods, type Domain, type Identity, type NodeLike } from '../types/index.ts'; import { type URI } from '../utils/uri.ts'; type Unpacked = T extends Array ? U : T; type PromiseOrIterator = S extends true ? AsyncIterable> : Promise; type NamespaceCommand = Omit, 'uri' | 'id' | 'to'> & { uri: URI; }; export type SendCommandOptions = { to?: NodeLike; ownerIdentity?: Identity | Domain; domain?: Domain; }; export type ConsumeOptions = SendCommandOptions & { take?: number; skip?: number; fetchall?: boolean; max?: number; /** * If true, it will try to parallel fetch data in chunks * Be careful as this can be slower in situations with few data and will consume much more bandwidth * Set together with max or fetchall */ optimistic?: boolean; }; export declare class Namespace { protected readonly blipClient: BlipClient; private readonly ownerSubdomain; private readonly defaultOptions?; constructor(blipClient: BlipClient, ownerSubdomain: string, defaultOptions?: ConsumeOptions | undefined); get identity(): Identity; sendCommand(command: NamespaceCommand, opts: ConsumeOptions & { collection: true; stream: true; }): PromiseOrIterator; sendCommand(command: NamespaceCommand, opts?: ConsumeOptions & { collection?: boolean; stream?: false; }): PromiseOrIterator; private prepareCommandContext; private buildCommand; private extractCollection; private sendIterableCommand; private sendPlainCommand; private sendCollectionCommand; } export {}; //# sourceMappingURL=namespace.d.ts.map