import { ActionHandlerBuilder } from "./action-handler"; export declare class RequestContext { #private; requestId: string; body?: { [x: string]: any; }; constructor(requestId: string); set(key: string, data: any): void; get(key: string): any; } export declare class SystemHandlerError extends Error { cause?: Error; constructor(reason: string, cause: Error); } interface SystemConfig { /** * If the system, when handling requests, * should use path-to-regexp for matching * the pattern or if it should only be * literal. */ usePattern?: boolean; /** * Do you want to name this specific System * for Docs and Debugging purposes? */ name?: string; /** * Do you want the system to expect you to call validate * on your action handler builders */ useManualActionValidation?: boolean; } /** * System is the Top Layer of abstraction. It is the place * where you register Action Handlers and you execute those * handlers. * * A System wraps those handlers in some basic boilerplate, * traces them, and keeps track of some buffered metadata about * itself. */ export declare class System { #private; config: SystemConfig; constructor(config?: SystemConfig); handlersFor(action: string): ActionHandlerBuilder[]; addHandler(action: string, handler: ActionHandlerBuilder): this; when(action: string): ActionHandlerBuilder; register(moduleName: string, module: any): this; getModule(moduleName: string): any; beforeAll(): ActionHandlerBuilder; afterAll(): ActionHandlerBuilder; handle(actionType: string, payload: { [x: string]: any; }): Promise; info(): { usesPatterns: boolean; name: string; actions: { name: string; handlers: string[]; }[]; }; } export {}; //# sourceMappingURL=system.d.ts.map