UNPKG

n8n

Version:

n8n Workflow Automation Tool

25 lines (24 loc) 1.19 kB
/// <reference types="node" /> /// <reference types="node/http" /> /// <reference types="n8n-workflow" /> import { EventEmitter } from 'events'; import type { Server } from 'http'; import type { Application } from 'express'; import { SSEPush } from './sse.push'; import { WebSocketPush } from './websocket.push'; import type { PushResponse, SSEPushRequest, WebSocketPushRequest } from './types'; import type { IPushDataType } from '../Interfaces'; import type { User } from '../databases/entities/User'; export declare class Push extends EventEmitter { isBidirectional: boolean; private backend; constructor(); handleRequest(req: SSEPushRequest | WebSocketPushRequest, res: PushResponse): void; broadcast(type: IPushDataType, data?: unknown): void; send(type: IPushDataType, data: unknown, pushRef: string): void; getBackend(): WebSocketPush | SSEPush; sendToUsers(type: IPushDataType, data: unknown, userIds: Array<User['id']>): void; onShutdown(): void; } export declare const setupPushServer: (restEndpoint: string, server: Server, app: Application) => void; export declare const setupPushHandler: (restEndpoint: string, app: Application) => void;