import { COAServiceError } from './transporter/coaServiceError'; import { IRequestOptions } from './transporter/requestOption'; /** * リクエスト成功の場合のレスポンス本文のstatus属性の値 * 失敗の場合はstring型だが、成功の場合のみnumber型が返却されるので注意すること。 */ export declare const RESPONSE_BODY_STAUS_SUCCESS = 0; export { COAServiceError, IRequestOptions }; export type IResponseBodyAsJson = { /** * COAの提示するステータス * 0でなければBadRequest */ status?: string | number; /** * COAの提示するメッセージ */ message?: string; } & Record; export type IResponseBody = IResponseBodyAsJson; /** * transporter abstract class * トランスポーター抽象クラス */ export declare abstract class Transporter { abstract request(options: IRequestOptions): Promise; } /** * FetchTransporter */ export declare class FetchTransporter implements Transporter { /** * Default user agent. */ static readonly USER_AGENT: string; expectedStatusCodes: number[]; constructor(expectedStatusCodes: number[]); /** * Configures request options before making a request. */ static CONFIGURE(options: IRequestOptions): IRequestOptions; /** * Makes a request with given options and invokes callback. */ request(options: IRequestOptions): Promise; /** * Wraps the response callback. */ private wrapCallback; }