npm.io
9.0.3 • Published 2 years ago

@types/hapi__call

Licence
MIT
Version
9.0.3
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

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 0337 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Rodrigo Saboya, and Sebastian Malton.