22 lines
948 B
TypeScript
22 lines
948 B
TypeScript
import { RequestHandler, Router } from "express";
|
|
import { PathParams } from "express-serve-static-core";
|
|
export default abstract class Controller {
|
|
private static readonly routes;
|
|
static route(route: string, params?: RouteParams, absolute?: boolean): string;
|
|
private router?;
|
|
getGlobalHandlers(): RequestHandler[];
|
|
hasGlobalHandlers(): boolean;
|
|
setupGlobalHandlers(router: Router): void;
|
|
getRoutesPrefix(): string;
|
|
abstract routes(): void;
|
|
setupRoutes(router: Router): void;
|
|
protected use(handler: RequestHandler): void;
|
|
protected get(path: PathParams, handler: RequestHandler, routeName?: string, ...middlewares: RequestHandler[]): void;
|
|
protected post(path: PathParams, handler: RequestHandler, routeName?: string, ...middlewares: RequestHandler[]): void;
|
|
private wrap;
|
|
private registerRoutes;
|
|
}
|
|
export declare type RouteParams = {
|
|
[p: string]: string;
|
|
} | string[] | string | number;
|