UNPKG

@snail-js/api

Version:

Http Request with Decorators Api, build on axios

21 lines (20 loc) 741 B
import { SnailServer } from "./snailServer"; export declare class SnailSse { private _serverInstance; private _baseUrl; private _url; private _version?; private _withCredentials; private _eventSource; constructor(server: SnailServer); private getSseOptions; private initVersion; open: () => EventSource; close: () => void; private registerSseEvent; private setEvent; on: (eventName: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void; off: (eventName: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void; get url(): string; get eventSource(): EventSource | null; }