@hopeio/utils
Version:
javascript utils
32 lines (31 loc) • 1.26 kB
TypeScript
import { Channel } from './const';
import { Fetch } from '../types';
declare class Client {
private static instance;
private constructor();
static getInstance(): Client;
private _fetch;
private _failCallback;
set fetch(value: Fetch<any>);
set failCallback(value: (error: any) => void);
accessToken: string;
accessKey: string;
refreshToken: string;
psToken: string;
_proxy: string;
set proxy(value: string);
private iv;
setToken(accessToken: string, refreshToken: string): void;
private DefaultBaseURL;
private DefaultZoneURL;
private DefaultPartSize;
request<T>(channel: Channel, key: string, param: Record<string, any>, other: Record<string, any>, api?: string): Promise<T>;
requestApiUser<T>(key: string, param: Record<string, any>, other: Record<string, any>): Promise<T>;
requestWoStore<T>(key: string, param: Record<string, any>, other: Record<string, any>): Promise<T>;
requestWoHome<T>(key: string, param: Record<string, any>, other: Record<string, any>): Promise<T>;
encrypt(data: string, channel: string): Promise<string>;
decrypt(data: string, channel?: Channel): Promise<string>;
private newBody;
}
export declare const client: Client;
export {};