import type Content from "@arcgis/core/popup/content/Content";
/**
 * Defines the look and feel of pop-up windows when users click or query a
 * feature.
 *
 * See https://developers.arcgis.com/web-map-specification/objects/popupInfo/
 * and
 * https://developers.arcgis.com/web-scene-specification/objects/popupInfo/.
 */
export interface PopupInfoJson {
    /**
     * A string that appears in the body of the pop-up window as a description.
     * This can contain a field name enclosed in `{}`, such as `{DETAILS}`.
     */
    description?: string | null;
    /**
     * List of Arcade expressions added to the pop-up.
     */
    expressionInfos?: PopupExpressionInfoJson[] | null;
    /**
     * An array of {@link FieldInfoJson} objects defining how each field in the
     * dataset participates (or does not participate) in the pop-up window. The
     * order of the array is the order that fields are shown in the pop-up
     * window.
     */
    fieldInfos?: FieldInfoJson[] | null;
    /**
     * Array of various mediaInfo to display. Can be of type image, piechart,
     * barchart, columnchart, or linechart. The order given is the order in
     * which is displays.
     */
    mediaInfos?: MediaInfoJson[] | null;
    /**
     * An array of popupElement objects that represent an ordered list of popup
     * elements.
     */
    popupElements?: PopupElementJson[] | null;
    /**
     * Indicates whether to enable related records if they exist on a layer.
     */
    relatedRecordsInfo?: RelatedRecordsInfoJson | null;
    /**
     * Determines whether attachments will be loaded for feature layers that
     * have attachments.
     */
    showAttachments?: boolean | null;
    /**
     * Appears at the top of the pop-up window as a title. This can contain a
     * field name enclosed in `{}`, such as `{NAME}`.
     */
    title?: string | null;
}
/**
 * Popup elements allow users to author popups, using multiple elements such as
 * tabular views, string description, media (charts and images), and attachments
 * of the attributes and control the order in which they appear. Specifically,
 * popupElements do the following: 1) provide the ability to explicitly add a
 * field/ value table in addition to a description, 2) allow adding multiple
 * description elements, and 3) allow a user to author and consume elements of a
 * popup in the order of their choosing.
 *
 * Each popupElement has a type property. This string value indicates the type
 * of popupElement used.
 *
 * See https://developers.arcgis.com/web-map-specification/objects/popupElement/
 * and
 * https://developers.arcgis.com/web-scene-specification/objects/popupElement/.
 */
export interface PopupElementJson {
    /**
     * A dictionary of key value pairs representing attributes to be used
     * instead of fields and their values. This property is only used when the
     * element is of type expression and should be returned as part of the
     * arcade expression itself. This property allows passing arcade derived
     * attribute values into fields or media elements.
     */
    attributes?: Record<string, unknown> | null;
    /**
     * An optional string value describing the element in detail. This property
     * does not apply when the type is text or expression.
     */
    description?: string | null;
    /**
     * This property applies to elements of type relationship. An integer that
     * indicates the maximum number of records to display.
     */
    displayCount?: number | null;
    /**
     * This property applies to elements of type attachments and relationship. A
     * string value indicating how to display the attachment. Possible values
     * are, 'preview', and 'list' for attachments types, and 'list' for
     * relationship types. If list is specified, attachments show as links.
     */
    displayType?: string | null;
    /**
     * This property applies to elements of type expression. An Arcade
     * expression that defines the pop-up element content.
     */
    expressionInfo?: PopupExpressionInfoJson | null;
    /**
     * This property applies to elements of type fields. It is an array of
     * popupInfo.fieldInfo objects representing a field/value pair displayed as
     * a table within the popupElement. If the fieldInfos property is not
     * provided, the popupElement will display whatever is specified directly in
     * the popupInfo.fieldInfos property.
     */
    fieldInfos?: FieldInfoJson[] | null;
    /**
     * This property applies to elements of type media. An array of
     * popupInfo.mediaInfo objects representing an image or chart for display.
     * If no mediaInfos property is provided, the popupElement will display
     * whatever is specified in the popupInfo.mediaInfo property.
     */
    mediaInfos?: MediaInfoJson[] | null;
    /**
     * This property applies to elements of type relationship. Array of
     * orderByFields objects indicating the field display order for the related
     * records and whether they should be sorted in ascending 'asc' or
     * descending 'desc' order.
     */
    orderByFields?: OrderByFieldsJson[] | null;
    /**
     * This property applies to elements of type relationship. The id of the
     * relationship as defined in the feature layer definition.
     */
    relationshipId?: number | null;
    /**
     * This property applies to elements of type text. This is string value
     * indicating the text to be displayed within the popupElement. If no text
     * property is provided, the popupElement will display whatever is specified
     * in the popupInfo.description property.
     */
    text?: string | null;
    /**
     * An optional string value indicating what the element represents. This
     * property does not apply when the type is text or expression.
     */
    title?: string | null;
    /**
     * String value indicating which element to use.
     */
    type?: "attachments" | "fields" | "media" | "text" | "expression" | "relationship" | null;
}
/**
 * Converts a popup element JSON object to its appropriate ArcGIS API type.
 *
 * @param json The JSON to convert.
 */
export declare function jsonToContent(json: PopupElementJson): Content;
/**
 * The sort in the popupInfo for the parent feature. This impacts the sorting
 * order for the returned child records.
 *
 * See
 * {@link https://developers.arcgis.com/web-map-specification/objects/relatedRecordsInfo/}
 * {@link https://developers.arcgis.com/web-scene-specification/objects/relatedRecordsInfo/}.
 */
export interface RelatedRecordsInfoJson {
    /**
     * Array of orderByFields objects indicating the field display order for the
     * related records and whether they should be sorted in ascending 'asc' or
     * descending 'desc' order.
     */
    orderByFields?: OrderByFieldsJson[] | null;
    /**
     * Required boolean value indicating whether to display related records. If
     * true, client should const the user navigate to the related records.
     * Defaults to true if the layer participates in a relationship AND the
     * related layer/table has already been added to the map (either as an
     * operationalLayer or as a table).
     */
    showRelatedRecords: boolean;
}
/**
 * Object indicating the field display order for the related records and whether
 * they should be sorted in ascending or descending order.
 *
 * See
 * {@link https://developers.arcgis.com/web-map-specification/objects/orderByFields/}
 * {@link https://developers.arcgis.com/web-scene-specification/objects/orderByFields/}.
 */
export interface OrderByFieldsJson {
    /**
     * The attribute value of the field selected that will drive the sorting of
     * related records.
     */
    field?: string | null;
    /**
     * Set the ascending (asc) or descending (desc) sort order of the returned
     * related records.
     */
    order?: string | null;
}
/**
 * Defines how a field in the dataset participates (or does not participate) in
 * a pop-up window.
 *
 * See
 * {@link https://developers.arcgis.com/web-map-specification/objects/fieldInfo/}
 * {@link https://developers.arcgis.com/web-scene-specification/objects/fieldInfo/}.
 */
export interface FieldInfoJson {
    /**
     * The field name as defined by the service.
     */
    fieldName: string;
    /**
     * A format object used with numerical or date fields to provide more detail
     * about how the value should be displayed in a web map pop-up window.
     */
    format?: FormatJson | null;
    /**
     * Determines whether users can edit this field.
     */
    isEditable?: boolean | null;
    /**
     * The field alias. This can be overridden by the web map author.
     */
    label?: string | null;
    /**
     * The type of input box editors will see when editing the field. Applies
     * only to string fields.
     */
    stringFieldOption?: "textbox" | "textarea" | "richtext" | null;
    /**
     * Provides an editing hint for editors of the field. This string could
     * provide a short description of the field and how editors should format or
     * supply its value.
     */
    tooltip?: string | null;
    /**
     * Determines whether the field is visible in the pop-up window.
     */
    visible?: boolean | null;
}
/**
 * The format object can be used with numerical or date fields to provide more
 * detail about how values should be displayed in web map pop-up windows.
 *
 * See
 * {@link https://developers.arcgis.com/web-map-specification/objects/format/}
 * {@link https://developers.arcgis.com/web-scene-specification/objects/format/}.
 */
export interface FormatJson {
    /**
     * A string used with date fields to specify how the date should appear in
     * pop-up windows.
     */
    dateFormat?: DateFormatJsonType | null;
    /**
     * A Boolean used with numerical fields. A value of true allows the number
     * to have a digit (or thousands) separator when the value appears in pop-up
     * windows. Depending on the locale, this separator is a decimal point or a
     * comma. A value of false means that no separator will be used.
     */
    digitSeparator?: boolean | null;
    /**
     * An integer used with numerical fields to specify the number of supported
     * decimal places that should appear in pop-up windows. Any places beyond
     * this value are rounded.
     */
    places?: number | null;
}
/**
 * Possible date formats for {@link FormatJson.dateFormat}.
 */
export type DateFormatJsonType = "dayShortMonthYear" | "dayShortMonthYearLongTime" | "dayShortMonthYearLongTime24" | "dayShortMonthYearShortTime" | "dayShortMonthYearShortTime24" | "longDate" | "longDateLongTime" | "longDateLongTime24" | "longDateShortTime" | "longDateShortTime24" | "longMonthDayYear" | "longMonthDayYearLongTime" | "longMonthDayYearLongTime24" | "longMonthDayYearShortTime" | "longMonthDayYearShortTime24" | "longMonthYear" | "shortDate" | "shortDateLE" | "shortDateLELongTime" | "shortDateLELongTime24" | "shortDateLEShortTime" | "shortDateLEShortTime24" | "shortDateLongTime" | "shortDateLongTime24" | "shortDateShortTime" | "shortDateShortTime24" | "shortMonthYear" | "year";
/**
 * The type of the media used with {@link MediaInfoJson.type}.
 */
export type MediaJsonType = "image" | "barchart" | "columnchart" | "linechart" | "piechart";
/**
 * Defines an image or a chart to be displayed in a pop-up window. See
 * https://developers.arcgis.com/web-map-specification/objects/mediaInfo/ and
 * https://developers.arcgis.com/web-scene-specification/objects/mediaInfo/.
 */
export interface MediaInfoJson {
    /**
     * A string providing the alternate text for the media.
     */
    altText?: string | null;
    /**
     * A caption describing the media. This can contain a field name enclosed in
     * `{}`, such as `{IMAGE_CAPTION}`.
     */
    caption?: string | null;
    /**
     * Refresh interval of the layer in minutes. Non-zero value indicates
     * automatic layer refresh at the specified interval. Value of 0 indicates
     * auto refresh is not enabled. If the property does not exist, it's
     * equivalent to having a value of 0. Only applicable when type is set to
     * image.
     */
    refreshInterval?: number | null;
    /**
     * A title for the media. This can contain a field name enclosed in `{}`,
     * such as `{IMAGE_TITLE}`.
     */
    title?: string | null;
    /**
     * Defines the type of media. One of the {@link MediaJsonType} constants.
     */
    type?: string | null;
    /**
     * Contains information about how the image should be retrieved or how the
     * chart should be constructed.
     */
    value?: ValueJson | null;
}
/**
 * The value object contains information for pop-up windows about how images
 * should be retrieved or charts constructed.
 *
 * See {@link https://developers.arcgis.com/web-map-specification/objects/value/}
 * {@link https://developers.arcgis.com/web-scene-specification/objects/value/}.
 */
export interface ValueJson {
    /**
     * Used with charts. An array of field names to display in the chart.
     */
    fields?: string[] | null;
    /**
     * Used with images. A string containing a URL to be launched in a browser
     * when a user clicks the image.
     */
    linkURL?: string | null;
    /**
     * Used with charts. An optional string containing the name of a field. The
     * values of all fields in the chart will be normalized (divided) by the
     * value of this field.
     */
    normalizeField?: string | null;
    /**
     * Used with images. The URL to the image.
     */
    sourceURL?: string | null;
    /**
     * String value indicating the tooltip for a chart specified from another
     * field. This field is needed when related records are not sued. It is used
     * for showing tooltips from another field in the same layer or related
     * layer/table.
     */
    tooltipField?: string | null;
}
/**
 * Arcade expression added to the pop-up.
 *
 * See
 * {@link https://developers.arcgis.com/web-map-specification/objects/popupExpressionInfo/}.
 */
export interface PopupExpressionInfoJson {
    /**
     * The Arcade expression.
     */
    expression?: string | null;
    /**
     * Unique identifier for the expression.
     */
    name?: string | null;
    /**
     * Return type of the Arcade expression, can be number or string. Defaults
     * to string value. Number values are assumed to be double. This can be
     * determined by the authoring client by executing the expression using a
     * sample feature(s), although it can be corrected by the user. Knowing the
     * returnType allows the authoring client to present fields in relevant
     * contexts. For example, numeric fields in numeric contexts such as
     * charts.
     */
    returnType?: "string" | "number" | null;
    /**
     * Title of the expression.
     */
    title?: string | null;
}
