@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
23 lines (22 loc) • 1.53 kB
TypeScript
/**
* Provides a utility method used to deserialize a JSON renderer object returned by the REST API.
*
* @since 4.0
* @see [Renderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/Renderer/)
* @see [Using fromJSON() to create a class instance](https://developers.arcgis.com/javascript/latest/using-fromjson)
*/
import type { RendererUnion } from "../types.js";
/**
* Creates a new instance of an appropriate [Renderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/Renderer/) class and initializes it with values from a JSON object
* generated from an ArcGIS product. The object passed into the input `json`
* parameter often comes from a response to a query operation in the REST API or a
* [toJSON()](https://pro.arcgis.com/en/pro-app/latest/tool-reference/conversion/features-to-json.htm)
* method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/using-fromjson)
* topic in the Guide for details and examples of when and how to use this function.
*
* @param json - A JSON representation of the instance in the ArcGIS format. See
* the [ArcGIS REST API documentation](https://developers.arcgis.com/documentation/common-data-types/renderer-objects.htm)
* for examples of the structure of various input JSON objects.
* @returns Returns a new instance of an appropriate Renderer class.
*/
export function fromJSON(json: object): RendererUnion | null | undefined;