import { Logger } from 'debuggo'; import { NextFunction, Router, RouterOptions } from 'express'; import https from 'https'; import { OpenAPIV3, ParseOptions, SchemaObject } from 'openapi-police'; import { RESTError } from './error.js'; import { Resource } from './resource.js'; import { APIRequest, APIResponse } from './types.js'; export declare class API { document: OpenAPIV3.Document; protected logger: Logger; protected resources: Resource[]; readonly originalSchemas: { [name: string]: OpenAPIV3.SchemaObject; }; protected dynamicSchemas: { [name: string]: SchemaObject; }; protected internalRouter: Promise; protected parseOptions: ParseOptions; constructor(info?: OpenAPIV3.InfoObject); protected getDebugLabel(): string; protected getDebugContext(): string; protected defaultSchemaRetriever(url: string): Promise; addResource(resource: Resource): this; registerSchema(name: string, schema: OpenAPIV3.SchemaObject): void; registerDynamicSchema(name: string, schema: SchemaObject): void; registerOperation(path: string, method: string, operation: OpenAPIV3.OperationObject): () => OpenAPIV3.OperationObject; registerTag(tag: OpenAPIV3.TagObject): void; registerOauth2Scope(name: string, description: string): void; getOauth2Schemes(): OpenAPIV3.OAuth2SecurityScheme[]; listen(httpPort: number, httpsPort?: number, httpsOptions?: https.ServerOptions): Promise; router(options?: RouterOptions): Promise; attach(base: Router, options?: RouterOptions): Promise; initSecurity(req: APIRequest, _res: APIResponse, next: NextFunction): void; securityValidator(req: APIRequest, res: APIResponse, next: NextFunction): void; handleError(err: any, req: APIRequest, res: APIResponse, next?: NextFunction): void; static newError(code: number, message?: string, info?: any, err?: any): RESTError; static fireError(code: number, message?: string, info?: any, err?: any): never; static handle404Error(req: APIRequest, res: APIResponse, next: NextFunction): void; }