UNPKG

typenexus

Version:

TypeNexus is a good tool for API encapsulation and management. It provides a clean and lightweight way to package TypeORM functionality, helping you build applications faster while reducing template code redundancy and type conversion work.

31 lines (30 loc) 1.12 kB
import { Driver } from './Driver.js'; import { TypeNexusOptions } from './DriverOptions.js'; import { ActionMetadata } from './metadata/ActionMetadata.js'; import { Action } from './Action.js'; export declare class Controllers<T extends Driver> { private driver; private options; /** * Used to build metadata objects for controllers and middlewares. */ private metadataBuilder; /** * Used to check and handle controller action parameters. */ private parameterHandler; constructor(driver: T, options: TypeNexusOptions); registerControllers(classes?: Function[]): this; /** * Registers middleware that run before controller actions. */ registerMiddlewares(type: 'before' | 'after', classes: Function[], option: TypeNexusOptions): this; /** * Executes given controller action. */ protected executeAction(actionMetadata: ActionMetadata, action: Action): Promise<any>; /** * Handles result of the action method execution. */ protected handleCallMethodResult(result: any, action: ActionMetadata, options: Action): any; }