import { RequestHandler } from "express"; import dotenv from "dotenv"; import morgan from "morgan"; export declare type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH"; /** * Source: https://github.com/isaacs/node-lru-cache */ export interface CacheOptions { ctxKey: string; max?: number; maxSize?: number; sizeCalculation?: (value: any, key: string) => number; dispose?: (value: any, key: string) => void; ttl?: number; allowStale?: boolean; updateAgeOnGet?: boolean; updateAgeOnHas?: false; } export interface AddRoute { method?: HttpMethod; path?: string; middlewares?: RequestHandler[]; secure?: boolean; fields?: Field[]; summary?: string; description?: string; cache?: boolean; } export interface Config { port?: string | number; disableListening?: boolean; useCors?: boolean; readyMessage?: string; dotenvConfig?: dotenv.DotenvConfigOptions; auth?: { authMiddleware: RequestHandler; secureAllRoutes?: boolean; }; doc?: { version?: string; title?: string; description?: string; servers?: DocServer[]; headers?: any[]; }; morgan?: { format: string; options?: morgan.Options; }; uses?: any[]; generateDoc?: boolean; controllersPath?: string; cache?: CacheOptions; } export interface DocServer { url: string; description: string; } export declare type Field = string | fieldObject; export interface RouteStore { path: string; method: HttpMethod; fields: Field[]; summary: string; description: string; } export interface fieldObject { name: string; type?: "string" | "number" | "boolean"; optional?: boolean; enum?: string[]; description?: string; }