import { CoreLogChannel, ObjectLike } from '@grandlinex/core'; import { Server } from 'net'; import { MergeInputType, SwaggerConfig, SwaggerRPath } from './Meta/SwaggerTypes.js'; import { RouteData } from './annotation/index.js'; export default class SwaggerUtil { static logger: CoreLogChannel | null; static getLogger(): CoreLogChannel; static writeMeta(conf: SwaggerConfig, kind: 'JSON' | 'YAML', path?: string): void; static readMeta(path: string): any; /** * Serves a meta page for Swagger UI or rapi-doc. * * @param {SwaggerConfig} conf The swagger configuration to expose via `/spec`. * @param {Object} [option] Options for serving the meta page. * @param {'swagger-ui'|'rapi-doc'} [option.type='swagger-ui'] The type of UI to serve. * @param {number} [option.port] The port to listen on. Defaults to 9000. * @param {string} [option.auth] Optional authentication key appended to the URL. * @returns {Promise} A promise that resolves with the created server instance or null. */ static serveMeta(conf: SwaggerConfig, option?: { type?: 'swagger-ui' | 'rapi-doc'; port?: number; auth?: string; }): Promise; static metaExtractor(root: ObjectLike, npmPackageVersion: boolean, ...path: ObjectLike[]): SwaggerConfig | undefined; static routeToSwaggerPath(route: RouteData): SwaggerRPath; static merge(root: SwaggerConfig, data: MergeInputType[]): SwaggerConfig; static mergeConfig(root: SwaggerConfig, data: SwaggerConfig[]): SwaggerConfig; }