import type { PolyNodeWS } from './ws.js'; import type { PolyNodeEvent, EventMap } from './types/events.js'; import type { SubscriptionType, EventType } from './types/enums.js'; import type { SubscriptionFilters } from './types/ws.js'; type EventHandler = (event: T) => void; export declare class SubscriptionBuilder { private readonly _ws; private readonly _type; private readonly _filters; constructor(ws: PolyNodeWS, type: SubscriptionType); wallets(addresses: string[]): this; tokens(tokenIds: string[]): this; slugs(slugs: string[]): this; conditionIds(ids: string[]): this; side(side: 'BUY' | 'SELL'): this; status(status: 'pending' | 'confirmed' | 'all'): this; minSize(usd: number): this; maxSize(usd: number): this; eventTypes(types: EventType[]): this; snapshotCount(count: number): this; feeds(feedNames: string[]): this; /** Send the subscribe message and wait for server acknowledgment. */ send(): Promise; } export declare class Subscription { readonly type: SubscriptionType; readonly filters: SubscriptionFilters; private _id; private readonly _handlers; private readonly _queue; private _queueResolve; private _closed; private readonly _ws; constructor(ws: PolyNodeWS, type: SubscriptionType, filters: SubscriptionFilters); get id(): string | null; /** @internal Set the server-assigned subscription ID. */ _setId(id: string): void; /** Register a handler for a specific event type, or '*' for all. */ on(type: K, handler: EventHandler): this; on(type: '*', handler: EventHandler): this; /** Remove a handler. */ off(type: string, handler: EventHandler): this; /** @internal Route an event to registered handlers. */ _emit(event: PolyNodeEvent): void; /** Unsubscribe from this subscription. */ unsubscribe(): void; /** Async iterator for consuming events sequentially. */ [Symbol.asyncIterator](): AsyncIterableIterator; } export {}; //# sourceMappingURL=subscription.d.ts.map