x-api-sdk-ts
Version:
TypeScript Library for the X (ex-twitter) API V2
14 lines (13 loc) • 1.41 kB
TypeScript
import { AbstractRequestClient, RCResponse } from '../interfaces/IRequestClient';
import { ICustomBaseResponse } from 'src/types/x-api/base_response';
export declare class RequestClient extends AbstractRequestClient {
get<T extends ICustomBaseResponse>(url: string, params?: Record<string, any>, headers?: Record<string, string>): Promise<RCResponse<T, string | import("..").IXError | null | undefined>>;
post<T extends ICustomBaseResponse>(url: string, body?: any, headers?: Record<string, string>, params?: Record<string, any>, contentType?: 'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data'): Promise<RCResponse<T, string | import("..").IXError | null | undefined>>;
put<T extends ICustomBaseResponse>(url: string, body?: any, headers?: Record<string, string>, params?: Record<string, any>): Promise<RCResponse<T, string | import("..").IXError | null | undefined>>;
delete<T extends ICustomBaseResponse>(url: string, headers?: Record<string, string>, params?: Record<string, any>): Promise<RCResponse<T, string | import("..").IXError | null | undefined>>;
patch<T extends ICustomBaseResponse>(url: string, body?: any, headers?: Record<string, string>, params?: Record<string, any>): Promise<RCResponse<T, string | import("..").IXError | null | undefined>>;
private request;
private parseResponse;
private buildUrl;
private buildFormData;
}