<commit_before>// Type definitions for got 9.4
// Project: https://github.com/sindresorhus/got#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
//                 <NAME> <https://github.com/LinusU>
//                 <NAME> <https://github.com/ikokostya>
//                 <NAME> <https://github.com/stijnvn>
//                 <NAME> <https://github.com/wingsbob>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

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

import { Url, URL } from 'url';
import * as http from 'http';
import * as https from 'https';
import * as nodeStream from 'stream';
import { CookieJar } from 'tough-cookie';

export = got;

declare class RequestError extends StdError {
    name: 'RequestError';
}

declare class ReadError extends StdError {
    name: 'ReadError';
}

declare class ParseError extends StdError {
    name: 'ParseError';
    statusCode: number;
    statusMessage: string;
}

declare class HTTPError extends StdError {
    name: 'HTTPError';
    statusCode: number;
    statusMessage: string;
    headers: http.IncomingHttpHeaders;
}

declare class MaxRedirectsError extends StdError {
    name: 'MaxRedirectsError';
    statusCode: number;
    statusMessage: string;
    redirectUrls: string[];
}

declare class UnsupportedProtocolError extends StdError {
    name: 'UnsupportedProtocolError';
}

declare class CancelError extends StdError {
    name: 'CancelError';
}

declare class TimeoutError extends StdError {
    name: 'TimeoutError';
}

declare class StdError extends Error {
    code?: string;
    host?: string;
    hostname?: string;
    method?: string;
    path?: string;
    protocol?: string;
    url?: string;
    response?: any;
}

declare const got: got.DefaultGotInstance;

interface InternalRequestOptions extends https.RequestOptions {
    // Redeclare options with `any` type for allow specify types incompatible with http.RequestOptions.
    timeout?: any;
    agent?: any;
}

declare namespace got {
    interface GotFn {
        (url: GotUrl): GotPromise<string>;
        (url: GotUrl, options: GotJSONOptions): GotPromise<any>;
        (url: GotUrl, options: GotFormOptions<string>): GotPromise<string>;
        (url: GotUrl, options: GotFormOptions<null>): GotPromise<Buffer>;
        (url: GotUrl, options: GotBodyOptions<string>): GotPromise<string>;
        (url: GotUrl, options: GotBodyOptions<null>): GotPromise<Buffer>;
    }

    interface GotJSONFn {
        (url: GotUrl): GotPromise<any>;
        (url: GotUrl, options: GotJSONOptions): GotPromise<any>;
        (url: GotUrl, options: GotFormOptions<string>): GotPromise<any>;
        (url: GotUrl, options: GotBodyOptions<string>): GotPromise<any>;
    }

    type GotInstance<T = GotFn> = T &
        Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', T> &
        {
            stream: got.GotStreamFn & Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', got.GotStreamFn>;
            extend: GotExtend;
            RequestError: typeof RequestError;
            ReadError: typeof ReadError;
            ParseError: typeof ParseError;
            HTTPError: typeof HTTPError;
            MaxRedirectsError: typeof MaxRedirectsError;
            UnsupportedProtocolError: typeof UnsupportedProtocolError;
            CancelError: typeof CancelError;
            TimeoutError: typeof TimeoutError;
        };

    type DefaultGotInstance = GotInstance;
    type JSONGotInstance = GotInstance<GotJSONFn>;

    interface GotExtend {
        (options: got.GotFormOptions<string> | got.GotBodyOptions<string> | got.GotFormOptions<null> | got.GotBodyOptions<null>): DefaultGotInstance;
        (options: got.GotJSONOptions): JSONGotInstance;<commit_msg>Fix build<commit_after>// Type definitions for got 9.4
// Project: https://github.com/sindresorhus/got#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
//                 <NAME> <https://github.com/LinusU>
//                 <NAME> <https://github.com/ikokostya>
//                 <NAME> <https://github.com/stijnvn>
//                 <NAME> <https://github.com/wingsbob>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

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

import { Url, URL } from 'url';
import * as http from 'http';
import * as https from 'https';
import * as nodeStream from 'stream';
import { CookieJar } from 'tough-cookie';

export = got;

declare class RequestError extends StdError {
    name: 'RequestError';
}

declare class ReadError extends StdError {
    name: 'ReadError';
}

declare class ParseError extends StdError {
    name: 'ParseError';
    statusCode: number;
    statusMessage: string;
}

declare class HTTPError extends StdError {
    name: 'HTTPError';
    statusCode: number;
    statusMessage: string;
    headers: http.IncomingHttpHeaders;
}

declare class MaxRedirectsError extends StdError {
    name: 'MaxRedirectsError';
    statusCode: number;
    statusMessage: string;
    redirectUrls: string[];
}

declare class UnsupportedProtocolError extends StdError {
    name: 'UnsupportedProtocolError';
}

declare class CancelError extends StdError {
    name: 'CancelError';
}

declare class TimeoutError extends StdError {
    name: 'TimeoutError';
}

declare class StdError extends Error {
    code?: string;
    host?: string;
    hostname?: string;
    method?: string;
    path?: string;
    protocol?: string;
    url?: string;
    response?: any;
}

declare const got: got.DefaultGotInstance;

interface InternalRequestOptions extends https.RequestOptions {
    // Redeclare options with `any` type for allow specify types incompatible with http.RequestOptions.
    timeout?: any;
    agent?: any;
}

declare namespace got {
    interface GotFn {
        (url: GotUrl): GotPromise<string>;
        (url: GotUrl, options: GotJSONOptions): GotPromise<any>;
        (url: GotUrl, options: GotFormOptions<string>): GotPromise<string>;
        (url: GotUrl, options: GotFormOptions<null>): GotPromise<Buffer>;
        (url: GotUrl, options: GotBodyOptions<string>): GotPromise<string>;
        (url: GotUrl, options: GotBodyOptions<null>): GotPromise<Buffer>;
    }

    interface GotJSONFn {
        (url: GotUrl): GotPromise<any>;
        (url: GotUrl, options: GotJSONOptions): GotPromise<any>;
        (url: GotUrl, options: GotFormOptions<string>): GotPromise<any>;
        (url: GotUrl, options: GotBodyOptions<string>): GotPromise<any>;
    }

    type GotInstance<T = GotFn> = T &
        Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', T> &
        {
            stream: GotStreamFn & Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', GotStreamFn>;
            extend: GotExtend;
            RequestError: typeof RequestError;
            ReadError: typeof ReadError;
            ParseError: typeof ParseError;
            HTTPError: typeof HTTPError;
            MaxRedirectsError: typeof MaxRedirectsError;
            UnsupportedProtocolError: typeof UnsupportedProtocolError;
            CancelError: typeof CancelError;
            TimeoutError: typeof TimeoutError;
        };

    type DefaultGotInstance = GotInstance;
    type JSONGotInstance = GotInstance<GotJSONFn>;

    interface GotExtend {
        (options: GotJSONOptions): JSONGotInstance;
        (options: GotFormOptions<string> | GotBodyOptions<string> | GotFormOptions<null> | GotBodyOptions<null>): DefaultGotInstance;
{'fraction_non_alphanumeric': 0.1159090909090909, 'fraction_numerical': 0.0010695187165775401, 'mean_word_length': 3.2481544576944916, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 71, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5484225', 'n_tokens_mistral': 2207, 'n_tokens_neox': 2168, 'n_words': 572}