n8n
Version:
n8n Workflow Automation Tool
25 lines (24 loc) • 1.15 kB
TypeScript
import type { Server } from 'http';
import type { Application } from 'express';
import type { IPushDataType } from '../Interfaces';
import { OrchestrationService } from '../services/orchestration.service';
import { SSEPush } from './sse.push';
import { WebSocketPush } from './websocket.push';
import type { PushResponse, SSEPushRequest, WebSocketPushRequest } from './types';
import { TypedEmitter } from '../TypedEmitter';
type PushEvents = {
editorUiConnected: string;
};
export declare class Push extends TypedEmitter<PushEvents> {
private readonly orchestrationService;
private backend;
constructor(orchestrationService: OrchestrationService);
handleRequest(req: SSEPushRequest | WebSocketPushRequest, res: PushResponse): void;
broadcast(type: IPushDataType, data?: unknown): void;
send(type: IPushDataType, data: unknown, pushRef: string): void;
getBackend(): SSEPush | WebSocketPush;
onShutdown(): void;
}
export declare const setupPushServer: (restEndpoint: string, server: Server, app: Application) => void;
export declare const setupPushHandler: (restEndpoint: string, app: Application) => void;
export {};