UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

30 lines (29 loc) 2.84 kB
import type SharedTemplateMetadata from "./SharedTemplateMetadata.js"; import type { LoadableMixin } from "../../core/Loadable.js"; import type { EsriPromiseMixin } from "../../core/Promise.js"; import type { SharedTemplateType } from "./types.js"; /** * Represents a shared editing template. This is a type of template accessed through the `sharedTemplates` * [resource](https://developers.arcgis.com/rest/services-reference/enterprise/shared-templates/) * on the feature service, as opposed to "traditional" * [feature templates](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureTemplate/), which are defined in a layer's metadata. * * Before using a `SharedTemplate` as part of a feature creation workflow, it is typically necessary to load the template by calling its [load()](https://developers.arcgis.com/javascript/latest/references/core/editing/sharedTemplates/SharedTemplate/#load) method. Shared template definitions often contain references to other shared templates. Calling [load()](https://developers.arcgis.com/javascript/latest/references/core/editing/sharedTemplates/SharedTemplate/#load) fetches and loads these referenced templates. * * The `SharedTemplate` class represents the complete information about a shared template. This is the information obtained from the * [`sharedTemplates/templates` endpoint](https://developers.arcgis.com/rest/services-reference/enterprise/fs-template/) * of a feature service, which may constitute a large payload. By contrast, the [SharedTemplateMetadata](https://developers.arcgis.com/javascript/latest/references/core/editing/sharedTemplates/SharedTemplateMetadata/) class represents only the metadata about a shared template, which is a smaller payload obtained from the [`sharedTemplates/query` * endpoint](https://developers.arcgis.com/rest/services-reference/enterprise/query-shared-templates/). Use the [SharedTemplateMetadata](https://developers.arcgis.com/javascript/latest/references/core/editing/sharedTemplates/SharedTemplateMetadata/) class when needing minimal information about many shared templates, (e.g. populating a gallery or picker interface). Use the `SharedTemplate` class when needing full information about a specific template, (e.g. when a particular template has been selected for use in a feature creation workflow). * * @since 4.32 * @see [SharedTemplateMetadata](https://developers.arcgis.com/javascript/latest/references/core/editing/sharedTemplates/SharedTemplateMetadata/) */ export default abstract class SharedTemplate<T extends any = any> extends SharedTemplateSuperclass { /** * The type of the template. * * @default "feature" */ get type(): SharedTemplateType; } declare const SharedTemplateSuperclass: typeof SharedTemplateMetadata & typeof EsriPromiseMixin & typeof LoadableMixin