UNPKG

thrilled-be-core

Version:

Core Express backend package with middleware, logging, security, and base application setup

37 lines 1.23 kB
import { Express } from 'express'; import { Logger } from '../logging/Logger'; export interface Plugin { /** Unique name of the plugin */ name: string; /** Version of the plugin */ version: string; /** Plugin dependencies that must be loaded before this plugin */ dependencies?: string[]; /** Register the plugin with the Express app */ register(app: Express, config: unknown): Promise<void> | void; } export declare abstract class BasePlugin implements Plugin { abstract readonly name: string; abstract readonly version: string; protected logger: Logger; dependencies?: string[]; constructor(logger?: Logger); register(app: Express, config: unknown): Promise<void>; /** * Setup the plugin with configuration */ protected abstract setup(config: unknown): Promise<void> | void; /** * Register middleware for this plugin */ protected registerMiddleware(_app: Express): void; /** * Register routes for this plugin */ protected registerRoutes(_app: Express): void; /** * Register error handlers for this plugin */ protected registerErrorHandlers(_app: Express): void; } //# sourceMappingURL=Plugin.d.ts.map