2023-02-10 06:02:47 -08:00
|
|
|
import type { PushRequest, PushResponse } from './push/types';
|
2022-12-07 06:13:36 -08:00
|
|
|
|
|
|
|
declare module 'sse-channel' {
|
|
|
|
declare class Channel {
|
|
|
|
constructor();
|
|
|
|
|
2023-02-10 06:02:47 -08:00
|
|
|
on(event: string, handler: (channel: string, res: PushResponse) => void): void;
|
2022-12-07 06:13:36 -08:00
|
|
|
|
2023-02-10 06:02:47 -08:00
|
|
|
removeClient: (res: PushResponse) => void;
|
2022-12-07 06:13:36 -08:00
|
|
|
|
2023-02-10 06:02:47 -08:00
|
|
|
addClient: (req: PushRequest, res: PushResponse) => void;
|
2022-12-07 06:13:36 -08:00
|
|
|
|
2023-02-10 06:02:47 -08:00
|
|
|
send: (msg: string, clients?: PushResponse[]) => void;
|
2022-12-07 06:13:36 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
export = Channel;
|
|
|
|
}
|