npm.io
3.0.5 • Published 2 years ago

@types/hapipal__avocat

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

Installation

npm install --save @types/hapipal__avocat

Summary

This package contains type definitions for @hapipal/avocat (https://github.com/hapipal/avocat#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hapipal__avocat.

index.d.ts

import { Boom } from "@hapi/boom";
import { ResponseObject } from "@hapi/hapi";

export interface Options {
    return?: boolean | undefined;
    includeMessage?: boolean | undefined;
}

// the return type has to be any because the following scenarios exist:
// 1. options.return = false - this will always throw or return false
// 2. options.return = true - this will either return false or a Boom type
// Due to scenario 2 and that behavior changes based on options, a return
// type of any is the only way I see this working
export function rethrow(err: ResponseObject | Boom, options?: Options): any;

Additional Details

Credits

These definitions were written by Tim Costa.