Bones/node_modules/popsicle/dist/base.d.ts
SOUTHERNCO\x2mjbyrn 7efe7605b8 Template Upload
2017-05-17 13:45:25 -04:00

31 lines
822 B
TypeScript

import { Url } from 'url';
export interface Query {
[key: string]: string | string[];
}
export interface Headers {
[name: string]: string | string[];
}
export declare type RawHeaders = string[];
export interface BaseOptions {
url?: string;
query?: string | Query;
headers?: Headers;
rawHeaders?: RawHeaders;
}
export default class Base {
Url: Url;
rawHeaders: RawHeaders;
constructor({url, headers, rawHeaders, query}: BaseOptions);
url: string;
query: string | Query;
headers: Headers;
toHeaders(): Headers;
set(name: string, value: string | string[]): Base;
append(name: string, value: string | string[]): this;
name(name: string): string;
get(name: string): string;
remove(name: string): this;
type(): string;
type(value: string): Base;
}