dinoloop-es8
Version:
A lightweight REST API Library for building scalable Node.js server-side applications powered by Typescript
73 lines (72 loc) • 1.84 kB
TypeScript
import { IDino } from '../modules/interfaces';
/**
* Creates dino instance
*/
export declare class Dino implements IDino {
private appContainer;
private isBinded;
/**
* app - ExpressApp
* , baseUri - application mounted path
*/
constructor(app: any, baseUri: string);
/**
* Register API controller
*/
registerController<T>(controller: Function & {
prototype: T;
}): void;
/**
* Register RequestStart middleware
*/
requestStart<T>(middleware: Function & {
prototype: T;
}): void;
/**
* Register RequestEnd middleware
*/
requestEnd<T>(middleware: Function & {
prototype: T;
}): void;
/**
* Register ServerError middleware
*/
serverError<T>(middleware: Function & {
prototype: T;
}): void;
/**
* Register ApplicationStart middleware
*/
applicationStart<T>(middleware: Function & {
prototype: T;
}): void;
/**
* Register ApplicationError controller
*/
registerApplicationError<T>(type: Function & {
prototype: T;
}): void;
/**
* Register express Router handler
*/
useRouter(cb: () => any): void;
/**
* RouteNotFoundMiddleware is unregistered
*/
disableRouteNotFoundException(): void;
/**
* Reserved for future use
*/
enableUserIdentity(): void;
/**
* Configures Dino to use DIFramework
*/
dependencyResolver<T>(injector: T, cb: (injector: T, type: any) => any): void;
/**
* Binds the dino instance to express app
* @Throws Error(Errors.routerNotRegistered)
* @Throws Error(Errors.dinoAlreadyBinded)
* @Throws Error(Errors.baseUriInvalid)
*/
bind(): void;
}