import type { Route, Method, EventMatch, ResponseStatus, TaskItem } from '@stackpress/lib/types'; import type EventEmitter from '@stackpress/lib/EventEmitter'; import ExpressEmitter from '@stackpress/lib/ExpressEmitter'; import type { ActionRouterArgs, ActionRouteProps, ActionRouterMap, ActionRouterAction } from '../types.js'; import type Request from '../Request.js'; import type Response from '../Response.js'; import EntryRouter from './EntryRouter.js'; import ImportRouter from './ImportRouter.js'; import ViewRouter from './ViewRouter.js'; export default class ActionRouter extends ExpressEmitter> { readonly context: X; readonly routes: Map; readonly entry: EntryRouter; readonly import: ImportRouter; readonly view: ViewRouter; constructor(context: X); all(path: string, action: ActionRouterAction, priority?: number): { method: Method; path: string; } & this; connect(path: string, action: ActionRouterAction, priority?: number): { method: Method; path: string; } & this; delete(path: string, action: ActionRouterAction, priority?: number): { method: Method; path: string; } & this; emit(event: string, props: ActionRouteProps): Promise; emit(event: string, req: Request, res: Response): Promise; eventName(event: string | RegExp): string; eventName(method: Method, path: string): string; get(path: string, action: ActionRouterAction, priority?: number): { method: Method; path: string; } & this; head(path: string, action: ActionRouterAction, priority?: number): { method: Method; path: string; } & this; options(path: string, action: ActionRouterAction, priority?: number): { method: Method; path: string; } & this; patch(path: string, action: ActionRouterAction, priority?: number): { method: Method; path: string; } & this; post(path: string, action: ActionRouterAction, priority?: number): { method: Method; path: string; } & this; put(path: string, action: ActionRouterAction, priority?: number): { method: Method; path: string; } & this; route(method: Method, path: string, action: ActionRouterAction, priority?: number): { method: Method; path: string; } & this; trace(path: string, action: ActionRouterAction, priority?: number): { method: Method; path: string; } & this; use(emitter: EventEmitter>): this; protected _eventNameFromRoute(method: string, path: string): string; protected _task(match: EventMatch, task: TaskItem>): (...[props]: ActionRouterArgs) => Promise; createProps(req: Request, res: Response, ctx?: X): ActionRouteProps; }