@nestjsvn/swagger-sse
Version:
OpenAPI documentation and interactive Swagger UI for NestJS Server-Sent Events endpoints
36 lines (35 loc) • 1.29 kB
TypeScript
import { INestApplication } from '@nestjs/common';
import { OpenAPIObject, SwaggerCustomOptions } from '@nestjs/swagger';
/**
* Setup SSE plugin for Swagger UI
*
* This function configures Swagger UI with SSE support by:
* - Adding the SwaggerSsePlugin to the plugins array
* - Including custom JS and CSS assets
* - Setting up the Swagger UI with enhanced SSE capabilities
*
* @param app NestJS application instance
* @param document OpenAPI document
* @param path Swagger UI path
* @param options Additional Swagger options
*
* @example
* ```typescript
* const document = SwaggerModule.createDocument(app, config);
* setupSsePlugin(app, document, 'api-docs');
* ```
*/
export declare function setupSsePlugin(app: INestApplication, document: OpenAPIObject, swaggerPath: string, options?: SwaggerCustomOptions): void;
/**
* Advanced setup with custom configuration
*/
export declare function setupSsePluginAdvanced(app: INestApplication, document: OpenAPIObject, swaggerPath: string, options?: SwaggerCustomOptions & {
sseConfig?: {
enableEventFiltering?: boolean;
enableEventSearch?: boolean;
maxEventLogSize?: number;
enableExport?: boolean;
enableReconnection?: boolean;
reconnectionDelay?: number;
};
}): void;