@aliretail/react-utils
Version:
25 lines (24 loc) • 580 B
TypeScript
interface TApiCfgItem {
_HOST?: string;
[key: string]: string;
}
export interface IApiCfg {
base?: TApiCfgItem;
local?: TApiCfgItem;
development?: TApiCfgItem;
pre?: TApiCfgItem;
production?: TApiCfgItem;
}
declare class ApiMap {
apicfg: IApiCfg;
constructor(apimaps?: {});
private extendConfig;
init: (cfg?: IApiCfg) => void;
getApiCfg: () => TApiCfgItem;
getUrl(api: string): string;
isURL(url: string): boolean;
isLocalEnv(): boolean;
setEnv: (newEnv: string) => void;
getEnv(): any;
}
export default ApiMap;