UNPKG

smee-client

Version:

Client to proxy webhooks to localhost

22 lines (21 loc) 625 B
import { fetch as undiciFetch } from "undici"; import { EventSource, type ErrorEvent } from "eventsource"; type Severity = "info" | "error"; interface Options { source: string; target: string; logger?: Pick<Console, Severity>; fetch?: any; } declare class Client { #private; constructor({ source, target, logger, fetch, }: Options); static createChannel({ fetch }?: { fetch?: typeof undiciFetch | undefined; }): Promise<string>; onmessage(msg: MessageEvent): Promise<void>; onopen(): void; onerror(err: ErrorEvent): void; start(): EventSource; } export default Client;