UNPKG

@anyhowstep/ts-route-server

Version:

15 lines (14 loc) 764 B
import { Definition } from "@anyhowstep/ts-route-shared"; import { Handler, VoidHandler } from "./Handler"; export declare type HandlerArray<P, B, Q, D, M> = (Handler<P, B, Q, D, M, any, any> | VoidHandler<P, B, Q, D, M, any>)[]; export declare class Route<P, B, Q, D, M, L = { _dummy: undefined; }> { private definition; private handlerArr; constructor(definition: Definition<P, B, Q, D, M>, handlerArr?: HandlerArray<P, B, Q, D, M>); add<N extends {}>(handler: Handler<P, B, Q, D, M, L, N>): Route<P, B, Q, D, M, L & N>; addVoid(handler: VoidHandler<P, B, Q, D, M, L>): Route<P, B, Q, D, M, L>; getDefinition(): Definition<P, B, Q, D, M>; getHandlerArr(): (Handler<P, B, Q, D, M, any, any> | VoidHandler<P, B, Q, D, M, any>)[]; }