import { Observable } from 'rxjs'; import { Http, Request, RequestOptions, RequestOptionsArgs } from '@angular/http'; import { Events } from 'ionic-angular'; import { Device } from '@ionic-native/device'; import { ConfigProvider } from '../../config/config'; import { Dialog } from '../../utils/dialog'; import { ResponseResult } from '../../utils/http/response/response-result'; import { JsonFileStorage } from '../storage/json-file-storage'; import { MemoryStorage } from '../storage/mem-storage'; export declare const ticket_expired: string; export interface HttpProviderOptionsArgs extends RequestOptionsArgs { showLoading?: boolean; loadingContent?: string; showErrorAlert?: boolean; cache?: boolean; cacheOnly?: boolean; memCache?: boolean; maxCacheAge?: number; } export declare class HttpProviderOptions extends RequestOptions { showLoading: boolean; loadingContent: string; showErrorAlert: boolean; cache: boolean; cacheOnly: boolean; memCache: boolean; maxCacheAge: number; constructor(options: HttpProviderOptionsArgs); merge(options?: HttpProviderOptionsArgs): HttpProviderOptions; } export interface LoginOptions { username: string; password: string; appId?: string; jpushId?: string; } export interface SubAcount { type?: string; name?: string; password?: string; } export interface LoginResult { successToken?: string; subAccounts?: Array; } export declare class HttpProvider { private _http; private jsonCache; private memCache; private dialog; constructor(_http: Http, jsonCache: JsonFileStorage, memCache: MemoryStorage, dialog: Dialog); readonly http: Http; requestWithError(url: string, options?: HttpProviderOptionsArgs, foundCacheCallback?: (result: T) => void): Promise; request(url: string, options?: HttpProviderOptionsArgs): Promise>; ajax(url: string | Request, options?: HttpProviderOptionsArgs): Observable>; private hashUrl(url, params); } export declare class CorsHttpProvider { private http; private events; private config; private device; private _ticket; ticket: string; readonly httpProvider: HttpProvider; constructor(http: HttpProvider, events: Events, config: ConfigProvider, device: Device); login(options: LoginOptions): Promise; logout(): Promise; request(url: string, options?: HttpProviderOptionsArgs, foundCacheCallback?: (result: T) => void): Promise; }