import { Headers, HttpRequestOptions } from "@nativescript/core/http"; import { ImageSource } from "@nativescript/core/image-source"; import { File } from "@nativescript/core/file-system"; export interface HttpsSSLPinningOptions { host: string; certificate: string; allowInvalidCertificates?: boolean; validatesDomainName?: boolean; commonName?: string; } export interface CacheOptions { diskLocation: string; diskSize: number; memorySize?: number; } export interface HttpsFormDataParam { data: any; parameterName: string; fileName?: string; contentType?: string; } export interface HttpsRequestObject { [key: string]: string | number | boolean | HttpsRequestObject | Array | HttpsFormDataParam; } export declare type CachePolicy = "noCache" | "onlyCache" | "ignoreCache"; export interface HttpsRequestOptions extends HttpRequestOptions { url: string; method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD"; headers?: Headers; params?: HttpsRequestObject; body?: HttpsRequestObject | HttpsFormDataParam[]; content?: string; timeout?: number; allowLargeResponse?: boolean; onProgress?: (current: number, total: number) => void; cachePolicy?: CachePolicy; useLegacy?: boolean; } export interface HttpsResponse { headers?: Headers; statusCode?: number; content?: any; reason?: string; description?: string; url?: string; failure?: any; } export interface HttpsRequest { nativeRequest: any; cancel(): any; run(success: any, failure: any): any; } export interface HttpsResponseLegacy { toArrayBuffer(): ArrayBuffer; toArrayBufferAsync(): Promise; toString(): string; toStringAsync(): Promise; toJSON(): any; toJSONAsync(): Promise; toImage(): Promise; toFile(destinationFilePath: string): Promise; } export declare function getFilenameFromUrl(url: string): string; export declare function parseJSON(source: string): any;