import { IGeometryInstance } from "../core/types/IGeometryInstance";
import { IHubEditableContent } from "../core/types/IHubEditableContent";
import type { IArcGISContext } from "../types/IArcGISContext";
import { DownloadOperationStatus } from "./enums/downloadOperationStatus";
import { ServiceDownloadFormat } from "./enums/serviceDownloadFormat";
/**
 * This hash map was defined to support the previous implementation of the export item flow.
 * We are currently working on a new implementation that will replace this hash map, but we
 * need to keep this around for now to support the existing implementation.
 */
export declare const PORTAL_EXPORT_TYPES: {
    csv: {
        name: string;
        itemTypes: string[];
        supportsProjection: boolean;
    };
    kml: {
        name: string;
        itemTypes: string[];
        supportsProjection: boolean;
    };
    shapefile: {
        name: string;
        itemTypes: string[];
        supportsProjection: boolean;
    };
    fileGeodatabase: {
        name: string;
        itemTypes: string[];
        supportsProjection: boolean;
    };
    geojson: {
        name: string;
        itemTypes: string[];
        supportsProjection: boolean;
    };
    excel: {
        name: string;
        itemTypes: string[];
        supportsProjection: boolean;
    };
    featureCollection: {
        name: string;
        itemTypes: string[];
        supportsProjection: boolean;
    };
};
export type LegacyExportItemFormat = keyof typeof PORTAL_EXPORT_TYPES;
/**
 * Represents a file format related to a content entity that can be downloaded.
 * Formats can either be dynamic (i.e., generated on-the-fly) or static (i.e., pre-generated)
 */
export interface IDownloadFormat {
    type: "static" | "dynamic";
}
/**
 * Represents a static download format that is pre-generated and available for download.
 * If the format is a service-backed format, the `format` property will be set to the corresponding
 * service format. If the format is to an arbitrary static file, the `format` property should be undefined.
 */
export interface IStaticDownloadFormat extends IDownloadFormat {
    type: "static";
    format?: ServiceDownloadFormat;
    label: string;
    url: string;
}
/**
 * Represents a dynamic download format that is generated on-the-fly when requested.
 * The `format` property will be set to the corresponding service format.
 */
export interface IDynamicDownloadFormat extends IDownloadFormat {
    type: "dynamic";
    format: ServiceDownloadFormat;
}
/**
 * A callback function that is invoked to report the progress of a download operation.
 */
export type downloadProgressCallback = (status: DownloadOperationStatus, percent?: number) => void;
/**
 * Options for refining / filtering the results of the fetchDownloadFile operation.
 */
export interface IFetchDownloadFileOptions {
    entity: IHubEditableContent;
    format: ServiceDownloadFormat;
    context: IArcGISContext;
    layers?: number[];
    /**
     * [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) to filter results by
     * NOTE: image downloads only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) or an extent-like object
     */
    geometry?: IGeometryInstance;
    where?: string;
    progressCallback?: downloadProgressCallback;
    pollInterval?: number;
    updateCache?: boolean;
}
/**
 * Response object for the fetchDownloadFile operation.
 * The response object will contain either a Blob or a URL,
 * depending on the type of download operation that was performed.
 */
export type IFetchDownloadFileResponse = IFetchDownloadFileBlobResponse | IFetchDownloadFileUrlResponse;
/**
 * Base interface for all fetchDownloadFile response objects.
 */
interface IBaseFetchDownloadFileResponse {
    type: "blob" | "url";
    /**
     * If the response comes from our cache rather than a live download,
     * indicates the status of the cached file
     */
    cacheStatus?: DownloadCacheStatus;
}
/**
 * Represents the status of a cached download file.
 * - `ready` indicates that the file has up-to-date data
 * - `ready_unknown` indicates that we don't know if the file is up-to-date
 * - `stale` indicates that the file is out-of-date
 */
export type DownloadCacheStatus = "ready" | "ready_unknown" | "stale";
/**
 * Response object for the fetchDownloadFile operation when the response is a Blob.
 */
export interface IFetchDownloadFileBlobResponse extends IBaseFetchDownloadFileResponse {
    type: "blob";
    /**
     * The Blob object that contains the download file.
     */
    blob: Blob;
    /**
     * The name to assign to the file when saving it to disk.
     */
    filename: string;
}
/**
 * Response object for the fetchDownloadFile operation when the response is a URL.
 */
export interface IFetchDownloadFileUrlResponse extends IBaseFetchDownloadFileResponse {
    type: "url";
    href: string;
}
/**
 * Options for fetching download formats for an entity.
 */
export interface IFetchDownloadFormatsOptions {
    entity: IHubEditableContent;
    context: IArcGISContext;
    layers?: number[];
}
/**
 * Options for instantiating an ArcgisHubDownloadError object.
 */
interface IArcgisHubDownloadErrorOptions {
    rawMessage: string;
    messageId?: string;
    operation?: string;
}
/**
 * Error class for reporting well-known download errors that occur during the download process.
 */
export declare class ArcgisHubDownloadError extends Error {
    messageId?: string;
    operation?: string;
    constructor(options: IArcgisHubDownloadErrorOptions);
}
/**
 * Error class specifically for when download files exceed size limits.
 */
export declare class ArcgisHubDownloadFileTooLargeError extends ArcgisHubDownloadError {
    constructor(options: IArcgisHubDownloadErrorOptions);
}
export {};
