UNPKG

1.14 kBTypeScriptView Raw
1/// <reference types="node" />
2import { Response } from 'got';
3import { Configuration } from './Configuration';
4export declare type Body = ({
5 [key: string]: any;
6} | string | Buffer | null);
7export declare enum Method {
8 GET = "GET",
9 PUT = "PUT",
10 POST = "POST",
11 DELETE = "DELETE"
12}
13export declare type Options = {
14 configuration: Configuration;
15 headers?: {
16 [headerName: string]: string;
17 };
18 jsonRequest?: boolean;
19 jsonResponse?: boolean;
20 /** @deprecated use jsonRequest and jsonResponse instead */
21 json?: boolean;
22 method?: Method;
23};
24export declare function request(target: string, body: Body, { configuration, headers, json, jsonRequest, jsonResponse, method }: Options): Promise<Response<any>>;
25export declare function get(target: string, { configuration, json, jsonResponse, ...rest }: Options): Promise<any>;
26export declare function put(target: string, body: Body, options: Options): Promise<Buffer>;
27export declare function post(target: string, body: Body, options: Options): Promise<Buffer>;
28export declare function del(target: string, options: Options): Promise<Buffer>;