import Color from "@arcgis/core/Color.js";
import SpatialReference from "@arcgis/core/geometry/SpatialReference";
import MeshSymbol3D from "@arcgis/core/symbols/MeshSymbol3D.js";
import PictureMarkerSymbol from "@arcgis/core/symbols/PictureMarkerSymbol.js";
import SimpleFillSymbol from "@arcgis/core/symbols/SimpleFillSymbol.js";
import SimpleLineSymbol from "@arcgis/core/symbols/SimpleLineSymbol.js";
import SimpleMarkerSymbol from "@arcgis/core/symbols/SimpleMarkerSymbol.js";
import type { LayerExtension } from "../mapping/_LayerExtension.js";
import type { GeometryType } from "../support/esri.js";
import { DateFormat, NumberFormat, TimeFormat } from "../utilities/format/formats.js";
import { FeatureSet } from "./FeatureSet.js";
import type { IDxfJsonComponentContext } from "./support/_dxfInterfaces.js";
/**
 * A union of simple fill, line, and marker symbols.
 */
export type SimpleSymbol = SimpleFillSymbol | SimpleLineSymbol | SimpleMarkerSymbol;
export declare const FIELD_NAME_REGEX: RegExp;
/**
 * Data for a cell in a table.
 */
export interface CellData {
    /**
     * The formatted value of the cell.
     */
    formatted?: string;
    /**
     * The raw value of the cell.
     */
    raw: string | number | boolean | Date;
}
/**
 * Data for a layer to be added.
 */
export interface UploadDataOptions extends ConversionFormatOptions {
    /**
     * The cells in the table.
     */
    data: CellData[][];
    /**
     * The header row contains column names.
     */
    includeHeaderRow?: boolean;
    /**
     * The format of the geometry in this table.
     */
    geometryFormat?: GeometryFormat;
    /**
     * The names of the geometry field(s).
     */
    geometryFields?: string[];
    /**
     * Optionally the primary key field.
     */
    primaryKeyField?: string;
    /**
     * Typically a string field with text formatted for display.
     */
    displayField?: string;
    /**
     * The spatial reference of the geometry in this table.
     */
    inSpatialReference?: SpatialReference;
    /**
     * The output spatial reference of the converted table.
     */
    outSpatialReference?: SpatialReference;
    /**
     * A list of fields to include. Defaults to the FeatureSources PopupTemplate
     * outfields if available, otherwise "*" meaning all fields.
     */
    outFields?: string[];
}
/**
 * Conversion options from CSV.
 */
export interface FromCsvOptions extends CsvBaseOptions {
    /**
     * When importing from CSV, this is the spatial reference of the geometry in
     * the CSV.
     */
    inSpatialReference?: SpatialReference;
    /**
     * Optionally the primary key field, used for converting from CSV to
     * features.
     */
    primaryKeyField?: string;
}
/**
 * Conversion options to CSV.
 */
export interface ToCsvOptions extends CsvBaseOptions {
    /**
     * Whether to always quote values, even if they do not require it. The
     * default is false.
     */
    alwaysQuote?: boolean;
    /**
     * Whether to include a Unicode byte order mark at the beginning of the
     * text. True by default.
     */
    includeByteOrderMark?: boolean;
}
/**
 * Base options for CSV conversion.
 */
interface CsvBaseOptions extends ConversionFormatOptions {
    /**
     * The delimiter between fields. If not specified, an attempt will be made
     * to auto-detect the delimiter.
     */
    delimiter?: string;
    /**
     * The delimiter between rows. The default is the platform-specific line
     * ending (e.g. "\r\n" on Windows, "\n" on Unix or MacOS).
     */
    rowDelimiter?: string;
    /**
     * Whether to include a header row with field names. Default is true.
     */
    includeHeaderRow?: boolean;
    /**
     * The format for serializing the geometry. The default is WKT.
     */
    geometryFormat?: GeometryFormat;
    /**
     * A set of custom field names to use with the selected geometry format.
     */
    geometryFields?: string[];
    /**
     * A list of fields to include. Defaults to the FeatureSources PopupTemplate
     * outfields if available, otherwise "*" meaning all fields.
     */
    outFields?: string[];
    /**
     * When exporting to CSV, this is the spatial reference of the geometry in
     * the CSV. The default is WGS84. When importing from CSV, this is the
     * spatial reference of the geometry in the result.
     */
    outSpatialReference?: SpatialReference;
}
/**
 * Conversion options from XLSX.
 */
export interface FromXLSXOptions extends BaseXLSXOptions {
    /**
     * When importing from XLSX, this is the spatial reference of the geometry
     * in the XLSX file.
     */
    inSpatialReference?: SpatialReference;
    /**
     * Optionally the primary key field, used for converting from XLSX to
     * features.
     */
    primaryKeyField?: string;
}
/**
 * Conversion options to XLSX.
 */
export interface ToXLSXOptions extends BaseXLSXOptions {
}
/**
 * Base options for XLSX conversion.
 */
interface BaseXLSXOptions extends ConversionFormatOptions {
    /**
     * Whether to include a header row with field names. Default is true.
     */
    includeHeaderRow?: boolean;
    /**
     * The format for serializing the geometry. The default is WKT.
     */
    geometryFormat?: GeometryFormat;
    /**
     * A set of custom field names to use with the selected geometry format.
     */
    geometryFields?: string[];
    /**
     * A list of fields to include. Defaults to the FeatureSources PopupTemplate
     * outfields if available, otherwise "*" meaning all fields.
     */
    outFields?: string[];
    /**
     * When exporting to XLSX, the name of the resulting work sheet. The default
     * is "sheet1".
     */
    sheetName?: string;
    /**
     * When exporting to XLSX, this is the spatial reference of the geometry in
     * the XLSX file. The default is WGS84. When importing from XLSX, this is
     * the spatial reference of the geometry in the result.
     */
    outSpatialReference?: SpatialReference;
}
/**
 * Conversion options from Shapefile.
 */
export interface FromShapefileOptions extends BaseShapefileOptions {
    /**
     * Optionally the primary key field, used for converting from Shapefile to
     * features.
     */
    primaryKeyField?: string;
}
/**
 * Conversion options to Shapefile.
 */
export interface ToShapefileOptions extends BaseShapefileOptions {
}
/**
 * Options for exporting to a Shapefile.
 */
interface BaseShapefileOptions extends ConversionFormatOptions {
    /**
     * When exporting to a shapefile, the file name to use.
     */
    fileName?: string;
    /**
     * A list of fields to include. Defaults to the FeatureSources PopupTemplate
     * outfields if available, otherwise "*" meaning all fields.
     */
    outFields?: string[];
    /**
     * When exporting to a shapefile, this is the spatial reference of the
     * geometry in the shapefile file. The default is WGS84. When importing from
     * shapefile, this is the spatial reference of the geometry in the result.
     */
    outSpatialReference?: SpatialReference;
}
interface ConversionFormatOptions {
    /**
     * If true, the configured formatters will be run on the raw values in the
     * supplied data and these values will be output with type information if
     * possible. If false, the formatted or presentable values already present
     * in the supplied data will be taken 'as-is'. Field types configured on the
     * input will be ignored and all values will be output as strings.
     */
    useFormattedValues?: boolean;
    /**
     * The format for dates. The default is DateFormat.ROUND_TRIP. This can be a
     * defined DateFormat string, the "timestamp" pseudo-format, or a custom
     * format string.
     */
    dateFormat?: DateFormat | "timestamp" | string;
    /**
     * The format for time-only fields. The default is TimeFormat.ROUND_TRIP.
     * This can be a defined TimeFormat string, or a custom format string.
     */
    timeFormat?: TimeFormat | "timestamp" | string;
    /**
     * The format for numbers. The default is NumberFormat.ROUND_TRIP.
     */
    numberFormat?: NumberFormat | string;
    /**
     * The locale to use for formatting values. Accepts a valid locale code
     * (example: "inv", "fr" or "de-AT"). Default is "inv" or invariant
     * culture.
     */
    locale?: string;
    /**
     * Whether to a prefix values that start with typical formula triggering
     * chars (=,-,+,@).
     */
    escapeFormulaChars?: boolean;
    /**
     * Indicates if a primary key should be generated if not found, defaults to
     * true.
     */
    generatePrimaryKey?: boolean;
}
/**
 * Geometry format when exporting geometry to CSV.
 */
export declare enum GeometryFormat {
    /**
     * Geometry will not be included.
     */
    NONE = "NONE",
    /**
     * Geometry will be in OGC WKT format (see
     * https://en.wikipedia.org/wiki/Well-known_text).
     */
    WKT = "WKT",
    /**
     * Points only. Coordinates are in separate "x" and "y" columns.
     */
    XY = "XY",
    /**
     * Points only. Coordinates are in separate "x", "y", and "z" columns.
     */
    XYZ = "XYZ",
    /**
     * Points only. Coordinates are in separate "latitude" and "longitude"
     * columns.
     */
    LAT_LON = "LAT_LONG",
    /**
     * Geometry will be in GeoJSON format (see http://geojson.org).
     */
    GEO_JSON = "GEO_JSON",
    /**
     * Geometry will be in ArcGIS Portal/REST JSON format (see
     * https://developers.arcgis.com/web-map-specification/objects/geometry/).
     */
    ARCGIS_JSON = "ARCGIS_JSON"
}
/**
 * Options for converting a DXF file to layer extensions.
 */
export interface DxfToLayerExtensionsOptions {
    /**
     * The spatial reference of the input DXF data.
     */
    inputSpatialReference: SpatialReference;
    /**
     * The spatial reference for the output layers.
     */
    outputSpatialReference: SpatialReference;
}
/**
 * A collection of well known field names associated with different geometry
 * formats.
 */
export declare const geometryTypeHeaders: Partial<Record<GeometryFormat, string[][]>>;
/**
 * Converts layer data into a {@link data/FeatureSet!FeatureSet}.
 *
 * @param uploadData The data to convert. This is an intermediate step produced
 *   by all File => FeatureSet transforms.
 */
export declare function uploadDataToFeatureSet(uploadData: UploadDataOptions): Promise<FeatureSet>;
/**
 * Converts a {@link data/FeatureSet!FeatureSet } to a CSV blob.
 *
 * @param featureSet The feature set to convert.
 * @param options Options for the conversion.
 */
export declare function toCsv(featureSet: FeatureSet, options?: ToCsvOptions): Promise<Blob>;
/**
 * Parses data from a blob or string representing a CSV.
 *
 * @param csvData The data to convert.
 * @param options Options for the conversion.
 */
export declare function csvToUploadData(csvData: Blob | string, options?: FromCsvOptions): Promise<UploadDataOptions>;
/**
 * Converts a Blob or string that represents CSV data to a
 * {@link data/FeatureSet!FeatureSet}.
 *
 * @param csvData The data to convert.
 * @param options Options for the conversion.
 */
export declare function csvToFeatureSet(csvData: Blob | string, options?: FromCsvOptions): Promise<FeatureSet>;
/**
 * Converts a {@link data/FeatureSet!FeatureSet } to an XLSX blob.
 *
 * @param featureSet The feature set to convert.
 * @param options Options for the conversion.
 */
export declare function toXLSX(featureSet: FeatureSet, options?: ToXLSXOptions): Promise<Blob>;
/**
 * Parses data from a blob representing an XLSX.
 *
 * @param xlsxData The blob.
 * @param options Options for the conversion.
 */
export declare function xlsxToUploadData(xlsxData: Blob, options: FromXLSXOptions): Promise<UploadDataOptions>;
/**
 * Converts a Blob that represents XLSX data to a
 * {@link data/FeatureSet!FeatureSet}.
 *
 * @param xlsxData The data to convert.
 * @param options Options for the conversion.
 */
export declare function xlsxToFeatureSet(xlsxData: Blob, options?: FromXLSXOptions): Promise<FeatureSet>;
/**
 * Creates an instance of Esri Color using a provided KML color hex code.
 *
 * @param kmlColor The hex code to use.
 */
export declare function kmlHexToEsriColor(kmlColor: string): Color;
/**
 * Converts KML coordinates string to x,y, and z values.
 *
 * @param coordinates The string coordinates to convert.
 */
export declare function parseKMLCoordinates(coordinates: string): {
    x: number;
    y: number;
    z: number;
}[];
/**
 * Parses the style element to generate the appropriate symbol.
 *
 * @param style The style element to use for symbol construction.
 * @param geometryType The feature geometry that will be used to determine a
 *   default symbol in case there is no style element.
 * @param index The index used to alternate symbol colors between features.
 */
export declare function parseKMLSymbol(style: Element | undefined, geometryType: GeometryType, index: number): PictureMarkerSymbol | SimpleSymbol;
/**
 * Converts a {@link data/FeatureSet!FeatureSet } to a zipped shapefile blob.
 *
 * @param featureSet The feature set to convert.
 * @param options Options for the conversion.
 */
export declare function toShapefile(featureSet: FeatureSet, options?: ToShapefileOptions): Promise<Blob>;
/**
 * Converts a Blob that represents KML data to layer extensions.
 *
 * @param kmlBlob The KML blob to be used for parsing and generating layer
 *   extensions.
 */
export declare function kmlToLayerExtensions(kmlBlob: Blob): Promise<LayerExtension[]>;
/**
 * Converts a Blob that represents DXF data to an array of layer extensions.
 *
 * @param dxfBlob The Blob containing DXF data to convert.
 * @param options The options for converting the DXF file.
 * @param contextOverrides Optional overrides for the DXF JSON component
 *   context.
 * @returns A promise that resolves to an array of `LayerExtension` objects.
 */
export declare function dxfToLayerExtensions(dxfBlob: Blob, options: DxfToLayerExtensionsOptions, contextOverrides?: Partial<IDxfJsonComponentContext>): Promise<LayerExtension[]>;
/**
 * Converts a Blob that represents zipped Shapefile data to a data table.
 *
 * @param shapefileData The data to convert.
 * @param options Options for the conversion.
 */
export declare function shapefileToUploadData(shapefileData: Blob, options: FromShapefileOptions): Promise<UploadDataOptions>;
/**
 * Converts a Blob that represents zipped Shapefile data to a
 * {@link data/FeatureSet!FeatureSet}.
 *
 * @param shapefileData The data to convert.
 * @param options Options for the conversion.
 */
export declare function shapefileToFeatureSet(shapefileData: Blob, options?: FromShapefileOptions): Promise<FeatureSet>;
/**
 * Uses geometry type to determine symbol type and uses the index to alternate
 * between colors of generated symbols.
 *
 * @param colorIndex The index used to alternate symbol colors.
 * @param geometryType The geometry type used to return the appropriate symbol.
 */
export declare function getDefaultSymbol(colorIndex: number, geometryType: GeometryType): SimpleSymbol | MeshSymbol3D | undefined;
export {};
