import type { ErrorCallback, EspressoOptions } from './interfaces/index.js'; import type { ControllerRoutingClass } from './controller-routing/index.js'; import type { Express } from 'express'; /** * This class wraps an `express.js` instance, for routing injection. * How to use: * @example * ```ts * import express from 'express'; * import { Espresso } from '@bleed-believer/espresso'; * import { ApiRouting } from './api.routing.js'; * * // Create your express.js instance * const app = express(); * * // Create a new Espresso instance * const espresso = new Espresso(app); * * // Inject your root "ControllerRouting" class * espresso.inject(ApiRouting); * * // Start your api rest * app.listen(8080, () => { * console.log('Ready!'); * }); * ``` */ export declare class Espresso { private _target; private _onError; private _options; /** * Create an instance of Espresso * ``` * @param target An `express.js` instance target. * @param options An options object about how to inject the routes. */ constructor(target: Express, options?: Partial); private _verbose; /** * Injects to the `express.js` target instance all endpoints descendants of * the API root routing class. * @param route The root routing class of your API Rest. */ inject(route: ControllerRoutingClass): void; /** * Binds a function to the event manager for endpoint errors handling. * @param callback The function to bind to. */ onError(callback: ErrorCallback): void; /** * Unbinds a function from the event manager for endpoint errors handling. * @param callback The function to unbind from. */ offError(callback: ErrorCallback): void; }