UNPKG

easy-api.ts

Version:

A powerful library to create your own API with ease.

36 lines (35 loc) 1.08 kB
/** * Represents the additional information * about an API route. */ type IRouteAdditionalData = Record<string, any>; /** * This class is responsible of handling * and managing additional data about API routes. */ export declare class RouteDataManager { /** * The route data cache. */ static cache: Map<string, IRouteAdditionalData>; /** * Adds an information object to a certain route. * @param route - Route name. * @param structure - Additional data structure. * @returns {void} */ static addData(route: string, structure: IRouteAdditionalData): void; /** * Returns an information object structure of a route. * @param route - Route name to retrieve the additional data from. * @returns {IRouteAdditionalData | undefined} */ static getData(route: string): IRouteAdditionalData | undefined; /** * Check whether the given route has addition data. * @param route - Route name to look up. * @returns {boolean} */ static hasData(route: string): boolean; } export {};