UNPKG

circleci-api

Version:

A Node and Browser client for the CircleCI API, written in TypeScript.

32 lines (31 loc) 1.29 kB
import { AxiosPromise, AxiosRequestConfig } from "axios"; /** * Create a custom GET request for CircleCI * * @deprecated In favour of using the [client] instead. */ export declare function circleGet<T>(token: string, url: string, options?: AxiosRequestConfig): AxiosPromise<T>; /** * Create a custom POST request for CircleCI * * @deprecated In favour of using the [client] instead. */ export declare function circlePost<T>(token: string, url: string, body?: any, options?: AxiosRequestConfig): AxiosPromise<T>; /** * Create a custom DELETE request for CircleCI * * @deprecated In favour of using the [client] instead. */ export declare function circleDelete<T>(token: string, url: string, options?: AxiosRequestConfig): AxiosPromise<T>; export interface ClientFactory { get: <T>(url: string, options?: AxiosRequestConfig) => Promise<T>; post: <T>(url: string, body?: any, options?: AxiosRequestConfig) => Promise<T>; delete: <T>(url: string, options?: AxiosRequestConfig) => Promise<T>; } /** * Create a client for interacting with the CircleCI API. * * @param token CircleCI API token * @param circleHost Custom host address for CircleCI */ export declare function client(token: string, circleHost?: string): ClientFactory;