UNPKG

@esri/solution-common

Version:

Provides general helper functions for @esri/solution.js.

848 lines (847 loc) 37.2 kB
/** @license * Copyright 2019 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Provides general helper functions. * * @module featureServiceHelpers */ import { IDefaultSpatialReferenceAndExtent, IDependency, IFeatureServiceProperties, IItemTemplate, INumberValuePair } from "./interfaces"; import { IQueryRelatedResponse, UserSession } from "./arcgisRestJS"; /** * Get the related records for a feature service. * * @param url Feature service's URL, e.g., layer.url * @param relationshipId Id of relationship * @param objectIds Objects in the feature service whose related records are sought */ export declare function getFeatureServiceRelatedRecords(url: string, relationshipId: number, objectIds?: number[]): Promise<IQueryRelatedResponse>; /** * Templatize the ID, url, field references ect * * @param itemTemplate Template for feature service item * @param dependencies Array of IDependency for name mapping * @param templatizeFieldReferences Templatize all field references within a layer * @param templateDictionary Hash mapping property names to replacement values * @returns A promise that will resolve when template has been updated * @private */ export declare function templatize(itemTemplate: IItemTemplate, dependencies: IDependency[], templatizeFieldReferences: boolean, templateDictionary?: any): IItemTemplate; /** * Delete key properties that are system managed * * @param layer The data layer instance with field name references within * @param isPortal When true we are deploying to portal */ export declare function deleteViewProps(layer: any, isPortal: boolean): void; /** * Cache properties that contain field references * * removeProp added for issue #644 * setting all props on add for online now * investigating if we can also just allow them to be set during add for portal * * @param layer The data layer instance with field name references within * @param fieldInfos the object that stores the cached field infos * @param isView When true the current layer is a view and does not need to cache subtype details * @param isPortal When true we are deploying to portal * @returns An updated instance of the fieldInfos */ export declare function cacheFieldInfos(layer: any, fieldInfos: any, isView: boolean, isPortal: boolean): any; /** * Cache the stored contingent values so we can add them in subsequent addToDef calls * * @param id The layer id for the associated values to be stored with * @param fieldInfos The object that stores the cached field infos * @param itemTemplate The current itemTemplate being processed * @returns An updated instance of the fieldInfos */ export declare function cacheContingentValues(id: string, fieldInfos: any, itemTemplate: IItemTemplate): any; /** * Cache the stored contingent values so we can add them in subsequent addToDef calls * * @param layer The current layer to check indexes on * @param fieldInfos The object that stores the cached field infos * @returns An updated instance of the fieldInfos */ export declare function cacheIndexes(layer: any, fieldInfos: any, isView: boolean, isMsView: boolean): any; /** * Helper function to cache a single property into the fieldInfos object * This property will be removed from the layer instance. * * @param layer the data layer being cloned * @param prop the property name used to cache * @param fieldInfos the object that will store the cached property * @param removeProp when true relationships prop will be set to null and subtype props will be deleted * @private */ export declare function _cacheFieldInfo(layer: any, prop: string, fieldInfos: any, removeProp: boolean): void; /** * Cache popup info that can contain field references * * @param data The items data property * @returns An updated instance of the popupInfos */ export declare function cachePopupInfos(data: any): any; /** * Helper function to cache a single popupInfo * This property will be reset on the layer * * @param popupInfos object to store the cahced popupInfo * @param type is it a layer or table * @param _items list or either layers or tables * @private */ export declare function _cachePopupInfo(popupInfos: IPopupInfos, type: "layers" | "tables", _items: any): void; /** * Store basic layer information for potential replacement if we are unable to access a given service * added for issue #859 * * @param layerId the id for the layer * @param itemId the id for the item * @param url the url for the layer * @param templateDictionary Hash of key details used for variable replacement * @returns templatized itemTemplate */ export declare function cacheLayerInfo(layerId: string, itemId: string, url: string, templateDictionary: any): void; /** * Creates an item in a specified folder (except for Group item type). * * @param itemTemplate Item to be created; n.b.: this item is modified * @param templateDictionary Hash mapping property names to replacement values * @param createResponse Response from create service * @returns An updated instance of the template * @private */ export declare function updateTemplate(itemTemplate: IItemTemplate, templateDictionary: any, createResponse: any): IItemTemplate; /** * Updates the items typeKeywords to include any typeKeywords that * were added by the create service request * * @param itemTemplate Item to be created; n.b.: this item is modified * @param createResponse Response from create service * @returns An updated instance of the template * @private */ export declare function _updateTypeKeywords(itemTemplate: IItemTemplate, createResponse: any): IItemTemplate; /** * Add layer urls from tracking views to the templateDictionary to be used for adlib replacements * * @param itemTemplate Item to be created; n.b.: this item is modified * @param templateDictionary Hash mapping property names to replacement values * @returns void * @private */ export declare function _setTrackingViewLayerSettings(itemTemplate: IItemTemplate, templateDictionary: any): void; /** * Create the name mapping object that will allow for all templatized field * references to be de-templatized. * This also removes the stored sourceFields and newFields arrays from fieldInfos. * * @example * \{ layer0: \{ fields: \{ lowerCaseSourceFieldName: newFieldNameAfterDeployment \} \} \} * * @param layerInfos The object that stores the cached layer properties and name mapping * @returns The settings object that will be used to de-templatize the field references. */ export declare function getLayerSettings(layerInfos: any, url: string, itemId: string, enterpriseIDMapping?: any): any; /** * Set the names and titles for all feature services. * * This function will ensure that we have unique feature service names. * The feature service name will have a generated GUID appended. * * @param templates A collection of AGO item templates. * @returns An updated collection of AGO templates with unique feature service names. */ export declare function setNamesAndTitles(templates: IItemTemplate[]): IItemTemplate[]; /** * This is used when deploying views. * We need to update fields referenced in adminLayerInfo for relationships prior to deploying the view. * This moves the fieldInfos for the views source layers from the item settings for the source layer * to the item settings for the view. * * @param itemTemplate The current itemTemplate being processed. * @param settings The settings object used to de-templatize the various templates within the item. */ export declare function updateSettingsFieldInfos(itemTemplate: IItemTemplate, settings: any): void; /** * Add flag to indicate item should be ignored. * Construct template dictionary to detemplatize any references to this item by other items. * * @param template Template for feature service item * @param authentication Credentials for the request * @returns A promise that will resolve when template has been updated * @private */ export declare function updateTemplateForInvalidDesignations(template: IItemTemplate, authentication: UserSession): Promise<IItemTemplate>; /** * Get the contingent values for each layer in the service. * Remove key props that cannot be included with the addToDef call on deploy. * Store the values alongside other key feature service properties in the template * * @param properties the current feature services properties * @param adminUrl the current feature service url * @param authentication Credentials for the request to AGOL * @returns A promise that will resolve when the contingent values have been fetched. * This function will update the provided properties argument when contingent values are found. */ export declare function processContingentValues(properties: IFeatureServiceProperties, adminUrl: string, authentication: UserSession): Promise<void>; /** * Replace the field name reference templates with the new field names after deployment. * * @param fieldInfos The object that stores the cached layer properties and name mapping * @param popupInfos The object from the popupInfo property for the layer * @param adminLayerInfos The object from the adminLayerInfo property for the layer * @param settings The settings object that has all of the mappings for de-templatizing. * @returns An object that contains updated instances of popupInfos, fieldInfos, and adminLayerInfos */ export declare function deTemplatizeFieldInfos(fieldInfos: any, popupInfos: any, adminLayerInfos: any, settings: any): any; /** * This is used when deploying views. * We need to update fields referenced in adminLayerInfo for relationships prior to deploying the view. * This moves the fieldInfos for the views source layers from the item settings for the source layer * to the item settings for the view. * * @param itemTemplate The current itemTemplate being processed. * @returns array of layers and tables */ export declare function getLayersAndTables(itemTemplate: IItemTemplate): any[]; /** * Fetch each layer and table from service so we can determine what fields they have. * This is leveraged when we are using existing services so we can determine if we need to * remove any fields from views that depend on these layers and tables. * * @param url Feature service endpoint * @param ids layer and table ids * @param authentication Credentials for the request * @returns A promise that will resolve an array of promises with either a failure or the data * @private */ export declare function getExistingLayersAndTables(url: string, ids: number[], authentication: UserSession): Promise<any>; /** * Adds the layers and tables of a feature service to it and restores their relationships. * * @param itemTemplate Feature service * @param templateDictionary Hash mapping Solution source id to id of its clone (and name & URL for feature * service) * @param popupInfos the cached popup info from the layers * @param authentication Credentials for the request * @returns A promise that will resolve when all layers and tables have been added * @private */ export declare function addFeatureServiceLayersAndTables(itemTemplate: IItemTemplate, templateDictionary: any, popupInfos: IPopupInfos, authentication: UserSession): Promise<void>; /** * Updates a feature service with a list of layers and/or tables. * * @param serviceUrl URL of feature service * @param listToAdd List of layers and/or tables to add * @param templateDictionary Hash mapping Solution source id to id of its clone (and name & URL for feature * service) * @param authentication Credentials for the request * @param key * @param adminLayerInfos Hash map of a layers adminLayerInfo * @param fieldInfos Hash map of properties that contain field references * @param itemTemplate * @returns A promise that will resolve when the feature service has been updated * @private */ export declare function addFeatureServiceDefinition(serviceUrl: string, listToAdd: any[], templateDictionary: any, authentication: UserSession, key: string, adminLayerInfos: any, fieldInfos: any, itemTemplate: IItemTemplate): Promise<void>; /** * When a view is a multi service view sort based on the id * https://github.com/Esri/solution.js/issues/1048 * * @param layersAndTables The list of layers and tables for the current template * @param isSelfReferential Indicates if any layers or tables have relationships with other layers or tables in the same service * @param itemTemplate The current itemTemplate being processed * * @returns Sorted list of layers and tables when using a multi-service view * @private */ export declare function _updateOrder(layersAndTables: any[], isSelfReferential: boolean, itemTemplate: IItemTemplate): any[]; /** * When a view is a multi service view add each layer separately * https://github.com/Esri/solution.js/issues/871 * * @param itemTemplate The current itemTemplate being processed * @param options Add to service definition options * @param layerChunks Groups of layers or tables to add to the service * @param isSelfReferential Indicates if any layers or tables have relationships with other layers or tables in the same service * @param authentication Credentials for the request * * @returns Add to service definition options * @private */ export declare function _updateAddOptions(itemTemplate: IItemTemplate, options: any, layerChunks: any[], isSelfReferential: boolean, authentication: UserSession): any; /** * Determine if any layer or table within the service references * other layers or tables within the same service * * @param layersAndTables the list of layers and tables from the service * * @returns true when valid internal references are found * @private */ export declare function _isSelfReferential(layersAndTables: any[]): boolean; /** * Remove "multiScaleGeometryInfo" for issue #526 to prevent invalid enablement of layer optimization * * @param layer the layer to evaluate * @private */ export declare function removeLayerOptimization(layer: any): void; /** * Handle portal specific updates to the item * * @param item the item to update * @param itemTemplate the item template * @param templateDictionary Hash mapping Solution source id to id of its clone * * @returns the updated item * @private */ export declare function _updateForPortal(item: any, itemTemplate: IItemTemplate, templateDictionary: any): any; /** * Get a list of the source layer field names * * @param table the table instance to compare * @param itemTemplate the item template * @param templateDictionary Hash mapping Solution source id to id of its clone * * @returns an array of the source layers fields * @private */ export declare function _getFieldNames(table: any, itemTemplate: IItemTemplate, templateDictionary: any): string[]; /** * Get a list of any dynamically calculated fields * These fields are still valid but will not exist in the source service * * @param table the table instance to compare * * @returns an array of field names * @private */ export declare function _getDynamicFieldNames(table: any): string[]; /** * Remove fields references from fields and indexes that do not exist in the source service * * @param item Layer or table * @param templateDictionary Hash mapping Solution source id to id of its clone * * @returns updated layer or table * @private */ export declare function _updateItemFields(item: any, fieldNames: string[]): any; /** * Filter the sourceLayerFields for the table * * @param table the table instance to evaluate * @param sourceLayerFields array of fields from the source service * @returns Updated instance of the table * @private */ export declare function _updateSourceLayerFields(table: any, sourceLayerFields: string[]): any; /** * When the itemm is a view with a geometry field update the value to * use the table name from the view layer def * * @param item the item details from the current template * @param templateDictionary Hash mapping property names to replacement values * @private */ export declare function _updateGeomFieldName(adminLayerInfo: any, templateDictionary: any): void; /** * Add the fields to the templateDictionary when a service has views * these are used to compare with fields from the view when domains are involved * when a view field has a domain that differs from that of the source service * the definition needs to be modified in an update call rather than when it is first added. * This should only happen when the domain differs. * * @param itemTemplate * @param templateDictionary Hash mapping Solution source id to id of its clone (and name & URL for feature service) * @private */ export declare function _updateTemplateDictionaryFields(itemTemplate: IItemTemplate, templateDictionary: any, compareItemId?: boolean): void; /** * Set the defaultSpatialReference variable with the services spatial reference. * If this item is a Feature Service that has child views then we will use this value * if one or more of the child views spatial reference differs from that of its parent. * * @param templateDictionary Hash mapping Solution source id to id of its clone (and name & URL for feature service) * @param itemId The source id for the item * @param spatialReference \{ wkid: 102100 \} for example * @private */ export declare function setDefaultSpatialReference(templateDictionary: any, itemId: string, spatialReference: any): void; /** * Compare the spatial reference of the current item against its dependencies. * The spatial reference of a view cannot differ from its source service. * If the view has a different spatial reference from its source use the source spatial reference. * * @param serviceInfo Basic service information * @param itemTemplate The current template to process * @param templateDictionary Hash mapping Solution source id to id of its clone (and name & URL for feature service) * @private */ export declare function validateSpatialReferenceAndExtent(serviceInfo: any, itemTemplate: IItemTemplate, templateDictionary: any): void; /** * Get the spatial reference from a views source. * Optionally ensure that the source has a valid geometry type prior to using its values. * * @param serviceInfo Basic service information * @param itemTemplate The current template to process * @param templateDictionary Hash mapping Solution source id to id of its clone (and name & URL for feature service) * @param validateGeom When true the source must contain a geometryType for values to be returned * * @returns An object that contains the default spatial reference and extent value * @private */ export declare function _getSourceSpatialReferenceAndExtent(serviceInfo: any, itemTemplate: IItemTemplate, templateDictionary: any, validateGeom: boolean): IDefaultSpatialReferenceAndExtent; /** * Updates a feature service with a list of layers and/or tables. * * @param itemTemplate * @param fieldInfos Hash map of properties that contain field references * @param popupInfos Hash map of a layers popupInfo * @param adminLayerInfos Hash map of a layers adminLayerInfo * @param templateDictionary Hash mapping Solution source id to id of its clone (and name & URL for feature service) * @param authentication Credentials for the request * @returns A promise that will resolve when the feature service has been updated * @private */ export declare function updateLayerFieldReferences(itemTemplate: IItemTemplate, fieldInfos: any, popupInfos: IPopupInfos, adminLayerInfos: any, templateDictionary: any): Promise<any>; /** * Update the names of fields for each layer or table after it has been * added to the definition * * @param itemTemplate Item to be created * @param layerInfos Hash map of properties that contain field references and various layer info * @param popupInfos Hash map of a layers popupInfo * @param adminLayerInfos Hash map of a layers adminLayerInfo * @param templateDictionary * @param authentication Credentials for the request * @returns An object with detemplatized field references * @private */ export declare function postProcessFields(itemTemplate: IItemTemplate, layerInfos: any, popupInfos: any, adminLayerInfos: any, templateDictionary: any): Promise<any>; /** * Set isViewOverride to false for single source view fields in portal when the field has * a domain and isViewOverride is not currently defined * * https://devtopia.esri.com/WebGIS/solution-deployment-apps/issues/414 * * @param item that stores the view fields * @param isPortal When true we are deploying to portal * @param isMsView When true the view is a multi-source view * * This function will update the item that is provided * @private */ export declare function _validateViewDomainFields(item: any, isPortal: boolean, isMsView: boolean): void; /** * Add popup info back to the layer item * * @param itemTemplate * @param popupInfos popup info to be added back to the layer * @private */ export declare function updatePopupInfo(itemTemplate: IItemTemplate, popupInfos: any): void; /** * Helper function to templatize value and make sure its converted to lowercase * * @param basePath path used to de-templatize while deploying * @param value to be converted to lower case for lookup while deploying * @private */ export declare function _templatize(basePath: string, value: string, suffix?: string): string; /** * templatize an objects property * * @param object the object with the property to templatize * @param property the property of the object to templatize * @param basePath path used to de-templatize while deploying * @private */ export declare function _templatizeProperty(object: any, property: string, basePath: string, suffix: string): void; /** * Templatize field references, serviceItemId, and adminLayerInfo for a layer * * @param dataItem from the items data property * @param adminItem from the services admin api * @param itemTemplate Template for feature service item * @param dependencies Array of IDependency for name mapping * @param templatizeFieldReferences Templatize all field references within a layer * @returns A promise that will resolve when template has been updated * @private */ export declare function _templatizeLayer(dataItem: any, adminItem: any, itemTemplate: IItemTemplate, dependencies: IDependency[], templatizeFieldReferences: boolean, templateDictionary: any): void; /** * Repair common issues that can occur with feature service field references. * This function will mutate the input item if any of the common issues have occured. * * @param adminItem layer or table from the service */ export declare function _validateFields(adminItem: any): void; /** * Update primary display field if casing doesn't match. * Update primary display field to the first non OID or GlobalId if the field isn't in the layer. * * @param adminItem layer or table from the service * @param fieldNames string list of fields names * @private */ export declare function _validateDisplayField(adminItem: any, fieldNames: string[]): void; /** * Remove indexes on fields that don't exist in the layer. * Remove duplicate indexes on the same field. * * @param adminItem layer or table from the service * @param fieldNames string list of fields names * @private */ export declare function _validateIndexes(adminItem: any, fieldNames: string[]): void; /** * Remove field references from templates that no longer exist. * * @param adminItem layer or table from the service * @param fieldNames string list of fields names * @private */ export declare function _validateTemplatesFields(adminItem: any, fieldNames: string[]): void; /** * Remove field references from templates that no longer exist. * * @param adminItem layer or table from the service * @param fieldNames string list of fields names * @private */ export declare function _validateTypesTemplates(adminItem: any, fieldNames: string[]): void; /** * Check if edit feilds exist but with lower case * * @param adminItem layer or table from the service * @param fieldNames string list of fields names * @private */ export declare function _validateEditFieldsInfo(adminItem: any, fieldNames: string[]): void; /** * * Templatize all field references within a layer * This is necessary to support potential field name changes when deploying to portal * Portal will force all field names to be lower case * * @param dataItem The data layer instance with field name references within * @param itemID The id for the item that contains this layer. * @param layer JSON return from the layer being templatized. * @param dependencies * @returns An updated instance of the layer * @private */ export declare function _templatizeLayerFieldReferences(dataItem: any, itemID: string, layer: any, dependencies: IDependency[]): void; /** * Templatize a layers adminLayerInfo by removing properties that will case issues with clone. * Also templatizes the source service name when we are dealing with a view. * * @param layer The layer to be modified * @param dependencies Array of service dependencies * @returns A new copy of the modified adminLayerInfo for the given layer * @private */ export declare function _templatizeAdminLayerInfo(layer: any, dependencies: IDependency[], templateDictionary: any): any; /** * Remove sourceId and templatize the sourceServiceName * * @param object The layer to be modified * @param dependencies Array of service dependencies * @private */ export declare function _processAdminObject(object: any, dependencies: IDependency[]): void; /** * Templatize the name based on the given dependencies * * @param lookupName The current name from the source service * @param dependencies Array of IDependency for name mapping * @returns The templatized name || undefined when no matching dependency is found * @private */ export declare function _templatizeSourceServiceName(lookupName: string, dependencies: IDependency[]): string | string[] | undefined; /** * templatize the fields referenced in adminLayerInfo * * @param layer the layer object with the adminLayerInfo property to templatize * @param basePath path used to de-templatize while deploying * @param itemID the id for the item that contains this layer * @private */ export declare function _templatizeAdminLayerInfoFields(layer: any, dependencies: IDependency[]): void; /** * find id based on dependency name * * @param lookupName name of dependency we want to find the id of * @param dependencies array of item dependencies * @private */ export declare function _getDependantItemId(lookupName: string, dependencies: IDependency[]): string; /** * templatize the sourceLayerFields referenced in adminLayerInfo * * @param fields array of sourceLayerFields to templatize * @param basePath path used to de-templatize while deploying * @private */ export declare function _templatizeAdminSourceLayerFields(fields: any[], basePath: string): void; /** * templatize the topFilter property from adminLayerInfo related tables * * @param topFilter the topFilter object to templatize * @param basePath path used to de-templatize while deploying * @private */ export declare function _templatizeTopFilter(topFilter: any, basePath: string): void; /** * templatize the relationships key fields using the related table id in the basePath * * @param layer the layer that has the relationships to templatize * @param itemID the id of the item that contains the related table * @private */ export declare function _templatizeRelationshipFields(layer: any, itemID: string): void; /** * templatize the popupInfo * * @param layerDefinition the layerDefinition that has the popupInfo to templatize * @param layer the JSON for the layer being templatized * @param basePath path used to de-templatize while deploying * @param itemID the id for the item that contains this layer * @param fieldNames array of fieldNames * @private */ export declare function _templatizePopupInfo(layerDefinition: any, layer: any, basePath: string, itemID: any, fieldNames: string[]): void; /** * templatize field name when referenced like this: \{\{fieldName\}\} * checks each field name from the layer * * @param object with the property to test for a field name * @param property that could have a field name referenced * @param fieldNames array for field names for the layer * @param basePath path used to de-templatize while deploying * @private */ export declare function _templatizeName(object: any, property: string, fieldNames: string[], basePath: string): void; /** * templatize field name when referenced like this: \{\{fieldName\}\} * checks each field name from the layer * * @param fieldInfos object that contains the popups fieldInfos * @param layer json of layer being cloned * @param itemID id of the item that contains the current layer * @param basePath path used to de-templatize while deploying * @private */ export declare function _templatizePopupInfoFieldInfos(fieldInfos: any[], layer: any, itemID: any, basePath: string): void; /** * templatize field name when referenced like this: \{\{fieldName\}\} * checks each field name from the layer * * @param name the field name to templatize * @param layer json of layer being cloned * @param itemID id of the item that contains the current layer * @param basePath path used to de-templatize while deploying * @private */ export declare function _templatizeFieldName(name: string, layer: any, itemID: string, basePath: string): string; /** * templatize field name when referenced in expressionInfos * * @param expressionInfos the popups expressionInfos to check * @param fieldNames array of the layers field names * @param basePath path used to de-templatize while deploying * @private */ export declare function _templatizeExpressionInfos(expressionInfos: any[], fieldNames: string[], basePath: string): any[]; /** * templatize field name when referenced in popupElelments * * @param popupElelments the popups popupElelments to check * @param basePath path used to de-templatize while deploying * @param layer json of layer being cloned * @param itemID id of the item that contains the current layer * @param fieldNames array of field names * @private */ export declare function _templatizePopupElements(popupElelments: any[], basePath: string, layer: any, itemID: string, fieldNames: any): void; /** * templatize field name when referenced in mediaInfos * * @param mediaInfos the popups mediaInfos to check * @param fieldNames array of the layers field names * @param basePath path used to de-templatize while deploying * @param layer json of layer being cloned * @param itemID id of the item that contains the current layer * @private */ export declare function _templatizeMediaInfos(mediaInfos: any, fieldNames: string[], basePath: string, layer: any, itemId: string): void; /** * templatize field names when referenced in definitionEditor * * @param layer the layer with the definition editor * @param basePath path used to de-templatize while deploying * @param fieldNames json of layer being cloned * @private */ export declare function _templatizeDefinitionEditor(layer: any, basePath: string, fieldNames: string[]): void; /** * templatize field names when referenced in definitionExpression * * @param layer the layer with the definition editor * @param basePath path used to de-templatize while deploying * @param fieldNames array of field names * @private */ export declare function _templatizeDefinitionExpression(layer: any, basePath: string, fieldNames: string[]): void; /** * Case sensitive test for field names that appear anywhere within a string * * @param expression the expression to test for field name references * @param basePath path used to de-templatize while deploying * @param fieldNames array of the layers field names * @private */ export declare function _templatizeSimpleName(expression: string, basePath: string, fieldNames: string[], suffix: string): string; /** * Templatize field references within a layers drawingInfo * * @param layer the data layer * @param basePath path used to de-templatize while deploying * @param fieldNames array of the layers field names * @private */ export declare function _templatizeDrawingInfo(layer: any, basePath: string, fieldNames: string[]): void; /** * Templatize field references within a layers drawingInfo * * @param renderer the layers renderer * @param basePath path used to de-templatize while deploying * @param fieldNames array of the layers field names * @private */ export declare function _templatizeRenderer(renderer: any, basePath: string, fieldNames: string[]): void; /** * Templatize field references within a layers renderer * * @param renderer the renderer object to check for field references * @param basePath path used to de-templatize while deploying * @param fieldNames array of field names that will be used to search expressions * @private */ export declare function _templatizeGenRenderer(renderer: any, basePath: string, fieldNames: string[]): void; /** * Templatize field references within a layers renderer * * @param renderer the renderer object to check for field references * @param basePath path used to de-templatize while deploying * @param fieldNames array of field names that will be used to search expressions * @private */ export declare function _templatizeTemporalRenderer(renderer: any, basePath: string, fieldNames: string[]): void; /** * Templatize renderers authoringInfo * * @param authoringInfo object containing metadata about the authoring process * @param basePath path used to de-templatize while deploying * @param fieldNames the name of fields from the layer * @private */ export declare function _templatizeAuthoringInfo(authoringInfo: any, basePath: string, fieldNames: string[]): void; /** * Templatize field references within an arcade expression * * @param text the text that contains the expression * @param fieldName name of the field to test for * @param basePath path used to de-templatize while deploying * @private */ export declare function _templatizeArcadeExpressions(text: string, fieldName: string, basePath: string): string; /** * templatize field names when referenced in the layers labelingInfo * * @param labelingInfo the object that contains the labelingInfo * @param basePath path used to de-templatize while deploying * @param fieldNames array of the layers field names * @private */ export declare function _templatizeLabelingInfo(labelingInfo: any, basePath: string, fieldNames: string[]): void; /** * templatize the layers editing templates * * @param layer the data layer being cloned * @param basePath path used to de-templatize while deploying * @private */ export declare function _templatizeTemplates(layer: any, basePath: string): void; /** * templatize the layer types and templates * * @param layer the data layer being cloned * @param basePath path used to de-templatize while deploying * @private */ export declare function _templatizeTypeTemplates(layer: any, basePath: string): void; /** * templatize object keys * * @param obj the object to templatize * @param basePath path used to de-templatize while deploying * @param suffix expected suffix for template variable * @private */ export declare function _templatizeKeys(obj: any, basePath: string, suffix: string): any; /** * templatize fields referenced in the layers time info * * @param layer the data layer being cloned * @param basePath path used to de-templatize while deploying * @private */ export declare function _templatizeTimeInfo(layer: any, basePath: string): void; /** * templatize the layers definition query * * @param layer the data layer being cloned * @param basePath path used to de-templatize while deploying * @param fieldNames array of the layers field names * @private */ export declare function _templatizeDefinitionQuery(layer: any, basePath: string, fieldNames: string[]): void; /** * Helper function to create the name mapping used to * de-templatize the field reference * * @param fieldInfos the object that stores the cached information * @param id the id for the current layer being processed * @private */ export declare function _getNameMapping(fieldInfos: any, id: string): any; export interface IPopupInfos { layers: INumberValuePair; tables: INumberValuePair; } /** * Helper function to ensure same chunk size value is used in multiple locations * * @returns a number that represents how many layers should be included per addToDef call * @private */ export declare function _getLayerChunkSize(): number;