@foal/core
Version:
Full-featured Node.js framework, with no complexity
29 lines (28 loc) • 1.15 kB
TypeScript
import { Class } from '../class.interface';
import { IApiComponents, IApiOperation, IApiTag } from '../openapi';
import { ServiceManager } from '../service-manager';
import { Route } from './route.interface';
/**
* Recursively get the property names of an object and its prototypes.
*
* @param {(object|null)} obj - The object.
* @returns {string[]} The property names.
*/
export declare function getMethods(obj: object | null): string[];
/**
* Recursively create the routes of a controller and its subcontrollers from the
* controller class definition.
*
* @export
* @param {string} parentPath - Prefix of all the route paths.
* @param {HookFunction[]} parentHooks - First hooks of all the route hooks.
* @param {Class} controllerClass - The controller class.
* @param {ServiceManager} services - The application services.
* @returns {Route[]} The created routes.
*/
export declare function makeControllerRoutes(controllerClass: Class, services: ServiceManager, openapi?: boolean, documentControllers?: object[]): Generator<{
route: Route;
components: IApiComponents;
operation: IApiOperation;
tags?: IApiTag[];
}>;