@types/hapi__call
TypeScript icon, indicating that this package has built-in type declarations

9.0.3 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/hapi__call

Weekly Downloads

4,717

Version

9.0.3

License

MIT

Unpacked Size

4.48 kB

Total Files

5

Last publish

Collaborators

  • types