export interface ResHttp { data?: any; err?: string; } export interface ComboList { table: string; value: string; text: string; order: string; where?: string; } export interface CustomAlertConfig { title: string; message: string; placeholder: string; uppercase?: 'off' | 'sentences' | 'words' | 'characters'; length?: number | false; } export interface InitConfig { serverUrls: string[]; production: boolean; uploadUrl?: string; loginUrl?: string; maintenanceUrl?: string; customHeaders?: { [key: string]: string; }; } export interface RestBase { url?: string; path: string; type: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; httpHeaders?: any; queryParams?: any; responseType?: 'text' | 'json' | any; options?: {}; returnCurrent?: boolean; } export interface RestGet extends RestBase { type: 'GET'; body?: never; } export interface RestPost extends RestBase { type: 'POST'; body?: { [key: string]: any; }; } export interface RestPut extends RestBase { type: 'PUT'; body?: { [key: string]: any; }; } export interface RestPatch extends RestBase { type: 'PATCH'; body?: { [key: string]: any; }; } export interface RestDelete extends RestBase { type: 'DELETE'; body?: never; } export type Rest = RestGet | RestPost | RestPut | RestPatch | RestDelete; export type RestResult = T['returnCurrent'] extends true ? Promise<{ currentEndpoint: string; [key: string]: any; }> : Promise<{ [key: string]: any; }>;