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

7.3.4 • Public • Published

Installation

npm install --save @types/tiny-json-http

Summary

This package contains type definitions for tiny-json-http (https://github.com/brianleroux/tiny-json-http).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tiny-json-http.

index.d.ts

declare namespace TinyJsonHttp {
    interface Options {
        url: string;
        data?: any;
        headers?: any;
        /**
         * Set to true the response body is returned as a buffer
         */
        buffer?: boolean | undefined;
        timeout?: number | undefined;
    }

    interface Result {
        body: any;
        headers: any;
    }
    type Callback = (err: Error | null, res?: Result) => void;

    interface Api {
        get(options: Options): Promise<Result>;
        get(options: Options, callback: Callback): void;

        head(options: Options): Promise<Result>;
        head(options: Options, callback: Callback): void;

        options(options: Options): Promise<Result>;
        options(options: Options, callback: Callback): void;

        post(options: Options): Promise<Result>;
        post(options: Options, callback: Callback): void;

        put(options: Options): Promise<Result>;
        put(options: Options, callback: Callback): void;

        patch(options: Options): Promise<Result>;
        patch(options: Options, callback: Callback): void;

        del(options: Options): Promise<Result>;
        del(options: Options, callback: Callback): void;
    }
}

declare const http: TinyJsonHttp.Api;

export = http;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Levi Bostian.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/tiny-json-http

Weekly Downloads

294

Version

7.3.4

License

MIT

Unpacked Size

5.12 kB

Total Files

5

Last publish

Collaborators

  • types