import { cWebRouteModule } from "./server"; export { Request, Response, NextFunction } from 'express'; import { ifFunction } from "./route"; import { SwaggerHelp } from "./swagger"; /** * 这里负责http的解析,然后传递给对于的处理方法 * 目前比较简陋,后续需要增加一下处理 */ export declare var WebRouteModule: { name: string; instance: cWebRouteModule; /**在模块初始化开始前注册 */ use(...handlers: any[]): boolean; /**帮助文档 教你怎么填配置信息 */ SwaggerHelp: typeof SwaggerHelp; /**在模块初始化开始前注册 */ enableStatic: (root: string) => boolean; /**注册代码模块的位置 */ routePath(routePath: string): void; /** * 是否开启跨域 */ openCross(b_switch?: boolean): void; /** * @description 开启Swagger模块 * @date 2020-01-16 * @param {{ basedir: string; jsPath: string; description?: string; title?: string; version?: string; host?: string; basePath?: string; produces?: string[]; schemes?: string[]; }} { basedir, jsPath, description = 'This is a sample server', title = 'Swagger', version = '1.0.0', host = 'localhost', basePath = '', produces = [ * "application/json" * ], schemes = ['http'] } */ openSwagger({ basedir, jsPath, description, title, version, host, basePath, produces, schemes }: { basedir: string; jsPath: string; description?: string | undefined; title?: string | undefined; version?: string | undefined; host?: string | undefined; basePath?: string | undefined; produces?: string[] | undefined; schemes?: string[] | undefined; }): void; /** * 注册响应函数 * @param dirname 接口文件地址 * @param event 接口名字 * @param paramlist 提前检查的参数 不满足会提前返回失败 * @param func 处理函数 */ registRoute(dirname: string, event: string, paramlist: string[], func: ifFunction): void; /** * 初始化模块 * @param port */ init(port: number, limit?: string | { [x: string]: string | boolean | undefined; gzip?: boolean | undefined; json?: string | undefined; text?: string | undefined; raw?: string | undefined; urlencoded?: string | undefined; } | undefined): Promise; };