import { Request, Response } from "express"; import { Context } from "../../types"; /** * Originally forked from sse-pubsub: * https://www.npmjs.com/package/sse-pubsub * Copyright for portions of project GrowthBook Proxy are held by Andrew Betts, 2017 * All other copyright is held by GrowthBook, Inc., 2022 */ export interface Options { pingInterval: number; maxStreamDuration: number; clientRetryInterval: number; startId: number; historySize: number; rewind: number; } interface Connection { req: Request; res: Response; events?: (string | RegExp)[]; } export declare class SSEChannel { private nextID; private clients; private messages; private active; private pingTimer; private options; private appContext?; constructor({ pingInterval, maxStreamDuration, clientRetryInterval, startId, historySize, rewind, }: Partial, appContext?: Context); publish(data?: any, eventName?: string): number | undefined; subscribe(req: Request, res: Response, events?: (string | RegExp)[]): Connection; unsubscribe(c: Connection): void; close(): void; listClients(): Record; getSubscriberCount(): number; private hasEventMatch; } export {};