routup
Version:
Routup is a minimalistic http based routing framework.
24 lines (23 loc) • 940 B
TypeScript
import { MethodName } from '../constants';
import type { DispatchEvent, Dispatcher } from '../dispatcher';
import { HookManager } from '../hook';
import type { Path } from '../path';
import { PathMatcher } from '../path';
import type { HandlerConfig } from './types';
export declare class Handler implements Dispatcher {
readonly '@instanceof': symbol;
protected config: HandlerConfig;
protected hookManager: HookManager;
protected pathMatcher: PathMatcher | undefined;
protected _method: MethodName | undefined;
constructor(handler: HandlerConfig);
get type(): "error" | "core";
get path(): string | undefined;
get method(): MethodName | undefined;
dispatch(event: DispatchEvent): Promise<void>;
matchPath(path: string): boolean;
setPath(path?: Path): void;
matchMethod(method: `${MethodName}`): boolean;
setMethod(input?: `${MethodName}`): void;
protected mountHooks(): void;
}