UNPKG

@nestjsvn/swagger-sse

Version:

OpenAPI documentation and interactive Swagger UI for NestJS Server-Sent Events endpoints

28 lines (27 loc) 1.02 kB
import * as ts from 'typescript'; /** * Plugin options for the SSE transformer */ export interface SsePluginOptions { /** Event naming convention to use */ eventNamingConvention?: 'kebab-case' | 'camelCase' | 'PascalCase'; /** Whether to introspect JSDoc comments for additional metadata */ introspectComments?: boolean; /** Whether to auto-generate operation IDs */ autoGenerateOperationId?: boolean; } /** * TypeScript AST transformer for automatic SSE endpoint detection * * This transformer automatically detects @Sse() decorated methods and adds * @ApiSse() decorators with inferred event types from Observable return types. * * @param program TypeScript program * @param options Plugin configuration options * @returns Transformer factory */ export declare function sseTransformer(program: ts.Program, options?: SsePluginOptions): ts.TransformerFactory<ts.SourceFile>; /** * Default plugin options */ export declare const defaultSsePluginOptions: Required<SsePluginOptions>;