import type { Root } from "../../core/Root"; import { Entity } from "../../core/util/Entity"; import { Container } from "../../core/render/Container"; export declare class MissingRefError extends Error { refName: string; constructor(refName: string); } export interface IParseSettings { /** * Container to add the parsed chart to, usually `root.container`. The * config must then build a [[Sprite]]. */ parent?: Container; /** * What a config block with a `type` does to an object that is already * there: `"strict"` replaces it with a new object of that type; `"soft"` * replaces it only if its type differs, and otherwise applies the block to * it, as if the block had no `type`. * * @default "strict" * @since 5.20.3 */ updateTargets?: "strict" | "soft"; /** * Objects a config names instead of carrying them, by that name: geodata * packs (`"geoJSON": "am5geodata_worldLow"`) and locales * (`"locale": "am5locales_de_DE"`). They are looked up here first, and then * as globals, which only the script version defines, so with npm imports * pass them here: * * ```TypeScript * import am5geodata_worldLow from "@amcharts/amcharts5-geodata/worldLow"; * parser.parse(config, { parent: root.container, resources: { am5geodata_worldLow } }); * ``` * * @since 5.21.4 */ resources?: { [name: string]: unknown; }; /** * Parses the config as code you wrote yourself. Its refs and `properties` * can then reach any object, and its `root` section can set anything on * the [[Root]], `sanitizeHTML` included. * * By default a config is data, so one from users or other sites cannot run * script: refs and `properties` go only through chart objects and plain * data, and the `root` section sets only what [[ChartSerializer]] writes. * Anything left out is named in a console warning. * * @default false * @since 5.22.0 */ trusted?: boolean; } /** * Builds charts from JSON configs. * * @see {@link https://docs.amcharts.com/v5/concepts/serializing/} for more info * @since 5.3.0 */ export declare class JsonParser { protected _root: Root; /** * IMPORTANT! Do not instantiate this class via `new Class()` syntax. * * Use static method `Class.new()` instead. * * @see {@link https://docs.amcharts.com/v5/getting-started/#new-element-syntax} for more info * @ignore */ constructor(root: Root, isReal: boolean); /** * Use this method to create an instance of this class. * * @see {@link https://docs.amcharts.com/v5/getting-started/#new-element-syntax} for more info * @param root Root element * @return Instantiated object */ static new>(this: C, root: Root): T; /** * Builds the chart objects a config describes, loading the classes it * needs first. * * @param object Config, as a plain object * @param settings Parse settings * @return A promise of the object the config builds, usually the chart */ parse(object: unknown, settings?: IParseSettings): Promise; /** * Builds the chart objects a config describes, from a JSON string. * * @param string JSON string * @param settings Parse settings * @return A promise of the object the config builds, usually the chart */ parseString(string: string, settings?: IParseSettings): Promise; } /** * Registers a class so that it can be parsed and instantiated by JSON parser. * * @param name Class name * @param ref Class reference * @ignore */ export declare function registerCustomClass(name: string, ref: any): void; //# sourceMappingURL=Json.d.ts.map