@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
171 lines (154 loc) • 7.31 kB
TypeScript
/**
* A convenience module for importing [Content](https://developers.arcgis.com/javascript/latest/references/core/popup/content/Content/) classes when developing
* with [TypeScript](https://developers.arcgis.com/javascript/latest/get-started/#typescript).
* For example, rather than importing content elements one at a time like this:
*
* ```js
* import TextContent from "@arcgis/core/popup/content/TextContent.js";
* import MediaContent from "@arcgis/core/popup/content/MediaContent.js";
* import FieldsContent from "@arcgis/core/popup/content/FieldsContent.js";
* import AttachmentsContent from "@arcgis/core/popup/content/AttachmentsContent.js";
* import CustomContent from "@arcgis/core/popup/content/CustomContent.js";
* import ExpressionContent from "@arcgis/core/popup/content/ExpressionContent.js";
* import RelationshipContent from "@arcgis/core/popup/content/RelationshipContent.js";
* ```
*
* You can use this module to import them on a single line:
*
* ```js
* import { TextContent, MediaContent, FieldsContent, AttachmentsContent, CustomContent, ExpressionContent, RelationshipContent } from "@arcgis/core/popup/content.js";
* ```
*
* This module also allows you to implement [type guards](https://basarat.gitbook.io/typescript/type-system/typeguard)
* on the content elements, making your code smarter.
*
* ```js
* import { Content } from "@arcgis/core/popup/content.js";
*
* function logContentElement(content: Content): void {
* if (content.type === "media") {
* console.log("Content type is media");
* }
* else {
* // The compiler knows the content element must be `text | fields | media | attachment | custom`
* console.log("The value is not a valid popup content element.")
* }
* }
* ```
*
* @since 4.11
* @see [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/)
* @see [TextContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/TextContent/)
* @see [MediaContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/MediaContent/)
* @see [FieldsContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/FieldsContent/)
* @see [AttachmentsContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/AttachmentsContent/)
* @see [CustomContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/CustomContent/)
* @see [ExpressionContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/ExpressionContent/)
* @see [RelationshipContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/RelationshipContent/)
*/
import type AttachmentsContentClass from "./content/AttachmentsContent.js";
import type CustomContentClass from "./content/CustomContent.js";
import type ExpressionContentClass from "./content/ExpressionContent.js";
import type FieldsContentClass from "./content/FieldsContent.js";
import type MediaContentClass from "./content/MediaContent.js";
import type RelationshipContentClass from "./content/RelationshipContent.js";
import type TextContentClass from "./content/TextContent.js";
import type UtilityNetworkAssociationsContentClass from "./content/UtilityNetworkAssociationsContent.js";
/**
* AttachmentsContent represents an attachment element associated with a
* feature.
*/
export type AttachmentsContent = AttachmentsContentClass;
/**
* AttachmentsContent represents an attachment element associated with a
* feature.
*
* @typedef {module:esri/popup/content/AttachmentsContent} module:esri/popup/content~AttachmentsContent
*/
export const AttachmentsContent: typeof AttachmentsContentClass;
/**
* CustomContent represents a custom content element associated with a
* feature.
*/
export type CustomContent = CustomContentClass;
/**
* CustomContent represents a custom content element associated with a
* feature.
*
* @typedef {module:esri/popup/content/CustomContent} module:esri/popup/content~CustomContent
*/
export const CustomContent: typeof CustomContentClass;
/**
* ExpressionContent represents an expression element associated with a
* feature.
*/
export type ExpressionContent = ExpressionContentClass;
/**
* ExpressionContent represents an expression element associated with a
* feature.
*
* @typedef {module:esri/popup/content/ExpressionContent} module:esri/popup/content~ExpressionContent
*/
export const ExpressionContent: typeof ExpressionContentClass;
/**
* FieldsContent represents the [FieldInfo](https://developers.arcgis.com/javascript/latest/references/core/popup/FieldInfo/) associated with a
* feature.
*/
export type FieldsContent = FieldsContentClass;
/**
* FieldsContent represents the [FieldInfo](https://developers.arcgis.com/javascript/latest/references/core/popup/FieldInfo/) associated with a
* feature.
*
* @typedef {module:esri/popup/content/FieldsContent} module:esri/popup/content~FieldsContent
*/
export const FieldsContent: typeof FieldsContentClass;
/**
* MediaContent contains an individual or array of chart and/or image media elements
* to display within a popup's content.
*/
export type MediaContent = MediaContentClass;
/**
* MediaContent contains an individual or array of chart and/or image media elements
* to display within a popup's content.
*
* @typedef {module:esri/popup/content/MediaContent} module:esri/popup/content~MediaContent
*/
export const MediaContent: typeof MediaContentClass;
/**
* RelationshipContent represents an relationship element associated with a
* feature.
*/
export type RelationshipContent = RelationshipContentClass;
/**
* RelationshipContent represents an relationship element associated with a
* feature.
*
* @typedef {module:esri/popup/content/RelationshipContent} module:esri/popup/content~RelationshipContent
*/
export const RelationshipContent: typeof RelationshipContentClass;
/**
* TextContent defines descriptive text as an element within the [PopupTemplate's](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/)
* content.
*/
export type TextContent = TextContentClass;
/**
* TextContent defines descriptive text as an element within the [PopupTemplate's](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/)
* content.
*
* @typedef {module:esri/popup/content/TextContent} module:esri/popup/content~TextContent
*/
export const TextContent: typeof TextContentClass;
/**
* UtilityNetworkAssociationsContent represents an utility network associations element associated with a
* feature.
*/
export type UtilityNetworkAssociationsContent = UtilityNetworkAssociationsContentClass;
/**
* UtilityNetworkAssociationsContent represents an utility network associations element associated with a
* feature.
*
* @typedef {module:esri/popup/content/UtilityNetworkAssociationsContent} module:esri/popup/content~UtilityNetworkAssociationsContent
*/
export const UtilityNetworkAssociationsContent: typeof UtilityNetworkAssociationsContentClass;
/** Popup content element types. */
export type Content = AttachmentsContent | FieldsContent | MediaContent | TextContent | CustomContent | ExpressionContent | RelationshipContent | UtilityNetworkAssociationsContent;