UNPKG

express-decorated-router

Version:

Define Express routes using TypeScript decorators

16 lines (15 loc) 783 B
import { IRouter } from 'express-serve-static-core'; /** Public interface for the express-decorated-router library */ export declare class ExpressDecoratedRouter { /** * Apply routes to the Express application. You should call reset() after calling this. * @param app The Express application * @throws {ParentControllerError} If the input of a @Parent decoration has not been decorated with @Controller * @throws {UnregisteredControllerError} If a class decorated with @Parent was not annotated with @Controller */ static applyRoutes(app: IRouter): typeof ExpressDecoratedRouter; /** * Reset the library, freeing resources. You should call this method after calling applyRoutes() */ static reset(): typeof ExpressDecoratedRouter; }