Installation
npm install --save @types/hapi__call
Summary
This package contains type definitions for @hapi/call (https://github.com/hapijs/call#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hapi__call.
index.d.ts
/// <reference types="node" />
export interface RouteDefinition {
/**
* Generally this is an HTTP method or "*" to mean any.
* This field is case insensitive.
*
* - "get"
* - "head"
* - "post"
* - "put"
* - "delete"
* - "connect"
* - "options"
* - "trace"
* - "patch"
*/
method: string;
path: string;
}
export interface RouterOptions {
isCaseSensitive: boolean;
}
export interface Match<Handler> {
params: Partial<Record<string, string>>;
paramsArray: string[];
route: Handler;
}
export type Route<Handler> = Match<Handler> | Error;
export class Router<Handler> {
constructor(routerOptions?: RouterOptions);
add(definition: RouteDefinition, route?: Handler): void;
route(method: string, path: string): Route<Handler>;
}
Additional Details
- Last updated: Tue, 07 Nov 2023 03:09:37 GMT
- Dependencies: @types/node
Credits
These definitions were written by Rodrigo Saboya, and Sebastian Malton.