UNPKG

@mieweb/wikigdrive

Version:

Google Drive to MarkDown synchronization

64 lines 2.87 kB
import type * as express from 'express'; import winston from 'winston'; export declare const HttpStatus: { OK: number; CREATED: number; NO_CONTENT: number; }; export interface RouteDoc { description?: string; summary?: string; example?: string; } export declare class ErrorHandler { readonly req: express.Request; readonly res: express.Response; readonly subPath: string; readonly logger: winston.Logger; catch(err: any): Promise<void>; } export interface ControllerRoute { errorHandlers: ErrorHandler[]; roles: string[]; method?: string; routePath?: string; methodFunc: string; responseObjectType: string; responseContentType: string; responseStatus: number; hidden: boolean; routeDocs?: RouteDoc; responseDocs?: RouteDoc; } export declare class ControllerCallContext { readonly route: ControllerRoute; readonly subPath: string; readonly req: express.Request; readonly res: express.Response; readonly logger: winston.Logger; constructor(route: ControllerRoute, subPath: string, req: express.Request, res: express.Response, logger: winston.Logger); routeParamMethod(): Promise<string>; routeParamPath(name: string): Promise<string>; routeParamBody<K>(): Promise<K>; routeParamQuery<K>(name: string): Promise<K>; routeParamUser(): Promise<any>; } export declare class Controller { readonly subPath: string; private static routes; private static counter; constructor(subPath: string); getRoute(instance: Controller, methodFunc: string): ControllerRoute; getRouter(): Promise<express.Router>; } export declare function RouteUse(routePath: string, docs?: RouteDoc): (_func: undefined, ctx: DecoratorContext) => void; export declare function RouteGet(routePath: string, docs?: RouteDoc): (_func: undefined, ctx: DecoratorContext) => void; export declare function RoutePut(routePath: string, docs?: RouteDoc): (_func: undefined, ctx: DecoratorContext) => void; export declare function RoutePost(routePath: string, docs?: RouteDoc): (_func: undefined, ctx: DecoratorContext) => void; export declare function RouteDelete(routePath: string, docs?: RouteDoc): (_func: undefined, ctx: DecoratorContext) => void; export declare function RouteDocsHidden(): (controller: any, methodProp: string) => void; export declare function RouteHasRole(roles: string[]): (controller: any, methodProp: string) => void; export declare function RouteResponse(objType?: string, docs?: RouteDoc, contentType?: string): (_func: undefined, ctx: DecoratorContext) => void; export declare function RouteErrorHandler(errorHandler: ErrorHandler): (_func: undefined, ctx: DecoratorContext) => void; export declare function RouteResponseStatus(status?: number): (_func: undefined, ctx: DecoratorContext) => void; //# sourceMappingURL=Controller.d.ts.map