import { Filter, TrustedEvent } from "@welshman/util"; import { AdapterContext } from "./adapter.js"; import { Tracker } from "@welshman/store"; export declare const AUTO_CLOSE_TIMEOUT = 8000; export type IsEventValid = (event: TrustedEvent, url: string) => boolean; export type BaseRequestOptions = { signal?: AbortSignal; priority?: number; multiplex?: boolean; tracker?: Tracker; context?: AdapterContext; autoClose?: boolean; timeout?: number; resubscribeAttempts?: number; isEventValid?: IsEventValid; onEvent?: (event: TrustedEvent, url: string) => void; onDeleted?: (event: unknown, url: string) => void; onInvalid?: (event: unknown, url: string) => void; onFiltered?: (event: TrustedEvent, url: string) => void; onDuplicate?: (event: TrustedEvent, url: string) => void; onDisconnect?: (url: string) => void; onEose?: (url: string) => void; onClosed?: (message: string, url: string) => void; onClose?: () => void; }; export type RequestOneOptions = BaseRequestOptions & { relay: string; filters: Filter[]; }; export declare const requestOne: (options: RequestOneOptions) => Promise; export type RequestOptions = BaseRequestOptions & { relays: string[]; filters: Filter[]; threshold?: number; /** * How long to keep waiting, in ms, once each number of relays has finished having returned * something. `[8000, 3000, 0]` waits up to 8s, at most 3s more after the first such relay, and * stops at the second. A relay that answers with nothing says nothing, so it doesn't count. */ timeouts?: number[]; }; export declare const request: (options: RequestOptions) => Promise; export declare const load: (options: Omit) => Promise; //# sourceMappingURL=request.d.ts.map