type OfflineGenerator = ((data: any, url: string) => Promise) | Promise | any; export declare class AppContext { /** * whether the standard api calls should be prevented * @type {boolean} */ offline: boolean; static context: string; /** * version of the core */ static version: string; /** * server prefix of api calls * @type {string} */ server_url: string; /** * server suffix for api calls * @type {string} */ server_json_suffix: string; isOffline: () => boolean; /** * converts the given api url to an absolute with optional get parameters * @param url * @param data * @returns {string} */ api2absURL: (url: string, data?: any) => string; private defaultGenerator; setDefaultOfflineGenerator: (generator: OfflineGenerator | null) => void; /** * handler in case phovea is set to be in offline mode * @param generator * @param data * @param url * @returns {Promise} */ private sendOffline; /** * api version of send * @param url api relative url * @param data arguments * @param method http method * @param expectedDataType expected data type to return, in case of JSON it will be parsed using JSON.parse * @param offlineGenerator in case phovea is set to be offline * @returns {Promise} */ sendAPI: (url: string, data?: any, method?: string, expectedDataType?: string, offlineGenerator?: OfflineGenerator) => Promise; /** * api version of getJSON * @param url api relative url * @param data arguments * @param offlineGenerator in case of offline flag is set what should be returned * @returns {Promise} */ getAPIJSON: (url: string, data?: any, offlineGenerator?: OfflineGenerator) => Promise; /** * api version of getData * @param url api relative url * @param data arguments * @param expectedDataType expected data type to return, in case of JSON it will be parsed using JSON.parse * @param offlineGenerator in case of offline flag is set what should be returned * @returns {Promise} */ getAPIData: (url: string, data?: any, expectedDataType?: string, offlineGenerator?: OfflineGenerator) => Promise; /** * @deprecated Use `appContext` instead. */ static getInstance(): AppContext; } export declare const appContext: AppContext; export {}; //# sourceMappingURL=AppContext.d.ts.map