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

4.0.3 • Public • Published

Installation

npm install --save @types/simple-get

Summary

This package contains type definitions for simple-get (https://github.com/feross/simple-get).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simple-get.

index.d.ts

/// <reference types="node" />

import { ClientRequest, IncomingMessage, RequestOptions } from "http";
import { Readable } from "stream";

interface SimpleGetOptions extends RequestOptions {
    url: string;
    /**
     * Default value: ```10```
     */
    maxRedirects?: number;
    body?: string | {
        [key: string]: unknown;
    } | Readable;
    form?: {
        [key: string]: unknown;
    };
    followRedirects?: boolean;
    /**
     * Serialize/deserialize request and response with JSON
     */
    json?: boolean;
}

export = simpleGet;

type Callback = (err: Error | null, res?: IncomingMessage) => void | never;

declare function simpleGet(options: string | SimpleGetOptions, cb: Callback): ClientRequest | never;

declare namespace simpleGet {
    export function concat(
        options: string | SimpleGetOptions,
        cb: (err: Error | null, res?: IncomingMessage, data?: Buffer | object) => void | never,
    ): ClientRequest | never;

    export function get(options: string | SimpleGetOptions, cb: Callback): ClientRequest | never;

    export function head(options: string | SimpleGetOptions, cb: Callback): ClientRequest | never;

    export function patch(options: string | SimpleGetOptions, cb: Callback): ClientRequest | never;

    export function post(options: string | SimpleGetOptions, cb: Callback): ClientRequest | never;

    export function put(options: string | SimpleGetOptions, cb: Callback): ClientRequest | never;

    function _delete(options: string | SimpleGetOptions, cb: Callback): ClientRequest | never;

    export { _delete as delete };
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Konrad Perlicki.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/simple-get

Weekly Downloads

7,046

Version

4.0.3

License

MIT

Unpacked Size

5.84 kB

Total Files

5

Last publish

Collaborators

  • types