tax-invoice
Version:
发票SDK-提供完整的发票API开票接口
38 lines (37 loc) • 897 B
TypeScript
import { InvoiceConfig } from './config';
/**
* 发票API客户端
*/
export declare class InvoiceClient {
private config;
private axiosInstance;
private token;
private appendFormData;
private formatDebugData;
private debugLogRequest;
private debugLogResponse;
private debugLogError;
/**
* 构造函数
* @param config 配置信息
*/
constructor(config: Partial<InvoiceConfig>);
/**
* 设置授权令牌
* @param token 授权令牌
*/
setToken(token: string): void;
/**
* 获取授权令牌
* @returns 授权令牌
*/
getToken(): string;
/**
* 发送请求
* @param method HTTP方法
* @param path 请求路径
* @param data 请求数据
* @returns 响应结果
*/
request<T = any>(method: string, path: string, data?: Record<string, any>): Promise<T>;
}