import { Entity, Settings, IEntityEvents, IEntitySettings, IEntityPrivate } from "../../core/util/Entity"; import { Color } from "../../core/util/Color"; export interface ISerializerSettings extends IEntitySettings { /** * Settings to leave out of the output. Ignored when `includeSettings` is * set. */ excludeSettings?: Array; /** * The only settings to write; all others are left out. */ includeSettings?: Array; /** * Settings whose plain-object values are written with all their keys. * In other settings, a plain object comes out empty. * * @since 5.7.0 */ fullSettings?: Array; /** * Properties to leave out of the output, e.g. `"data"`. * * @since 5.3.2 */ excludeProperties?: Array; /** * An array of properties to include in the serialized data. * * @ignore * @since 5.15.0 */ includeProperties?: Array; /** * How many levels of nested objects to write; deeper ones are left out. * * @default 2 */ maxDepth?: number; /** * Write an animation started in code that loops forever - a globe that * keeps turning, a marker that keeps pulsing - into the `animations` * setting, so the saved chart plays it too. Animations that end (`appear()`, * state changes, zooming) are never written, and neither is one whose easing * is a function of its own rather than one of amCharts' easings. * * @default true * @since 5.20.8 */ runningAnimations?: boolean; /** * Writes the elements' states. * * @default false * @since 5.15.0 */ includeStates?: boolean; /** * Writes the elements' adapters. * * @default false * @since 5.15.0 */ includeAdapters?: boolean; /** * Include events in the output. * * @since 5.15.0 * @default false * @todo implement * @ignore */ includeEvents?: boolean; /** * How adapter callbacks are written (see `includeAdapters`): `"string"` as * their source code, `"function"` as the functions themselves, which JSON * can't hold. [[ChartSerializer]] uses `"function"` unless set. * * @default "string" */ functionsAs?: "string" | "function"; } export interface ISerializerPrivate extends IEntityPrivate { } export interface ISerializerEvents extends IEntityEvents { } /** * Serializes charts or individual elements into plain objects, which can be * saved as JSON. * * @see {@link https://www.amcharts.com/docs/v5/concepts/serializing/} for more info * @since 5.3.0 */ export declare class Serializer extends Entity { static className: string; static classNames: Array; _settings: ISerializerSettings; _privateSettings: ISerializerPrivate; _events: ISerializerEvents; protected _refs: { [index: string]: any; }; /** * Set while serializing data. A `#` or `@` at the start of a string means a * reference in a config, so strings are escaped - but most of a data row is * handed back untouched when parsed, and escaping it there would corrupt it * a little more on every round trip. `_escapeParsed` puts the escaping back * in the few places the parser does read values. * * @ignore */ protected _serializingData: boolean; protected _inInterfaceColors: boolean; protected _interfaceColorKey(color: Color): string | undefined; /** * Serializes data, which is values rather than configuration. * * @ignore */ serializeData(values: Array): unknown; /** * Escapes the strings the parser is going to read as references, and only * those. It walks data the way the parser does: through every array, and * into an object only when that object is marked `__parse`. Anywhere else a * string comes back as it was written, so escaping it would leave a stray * `##` in the data. */ private _escapeParsed; /** * Serializes an object into a plain object. * * @param source Object to serialize * @param depth Current depth * @param full Write plain objects in full, with all their keys * @param forceParse Mark plain objects with `__parse`, so the parser reads them * @return Serialized data */ serialize(source: unknown, depth?: number, full?: boolean, forceParse?: boolean): unknown; /** * A place for a subclass to add to what an entity serialized to, wherever it * was reached from. * * @ignore */ protected _afterEntity(_source: any, _res: any): void; /** * Adds the element's endless animations started in code to its `animations` * setting. The setting they animate is left out: the animation sets it. * * @param source Source object * @param res Result * @param depth Current depth */ private _processRunningAnimations; /** * Describes the endless animations running on `source` as `animations` * entries. * * @param source Source object * @param depth Current depth * @param target Whose setting the entries animate * @return Animation entries */ protected _runningAnimationEntries(source: Settings, depth: number, target?: "dataItem"): Array; /** * Writes out what was styled on an object the library built for itself. * * A background an element seeds, a part it configures - the object itself is * not configuration, so it is not written out on its own account. What * someone then styled on it is, and would otherwise be lost. It goes out * without a `type`, so parsing configures the object already there instead of * replacing it with a new one. * * @param source Source object * @param res Result * @param written Setting keys already written out in full * @param depth Current depth */ private _processComputedEntities; private _processAdapters; private _processStates; private _filterSettings; private _escapeRefs; private _escapeText; } //# sourceMappingURL=Serializer.d.ts.map