9.0.3 • Published 6 months ago
@types/hapi__call v9.0.3
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
// Type definitions for @hapi/call 9.0
// Project: https://github.com/hapijs/call#readme
// Definitions by: Rodrigo Saboya <https://github.com/saboya>
// Sebastian Malton <https://github.com/nokel81>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <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 Jun 2022 20:31:34 GMT
- Dependencies: @types/node
- Global values: none
Credits
These definitions were written by Rodrigo Saboya, and Sebastian Malton.