import { InjectionToken } from '@angular/core'; import { LfSerializer, LfStorage } from '@lightweightform/core'; import { Schema } from '@lightweightform/storage'; import { LfXmlSerializerSchemaProperties } from '../types/schema-properties'; import { LfXmlElementAttributes, LfXmlSerializerOptions, LfXmlTransformationFn, LfXmlTransformer } from '../types/xml-serializer-options'; import * as i0 from "@angular/core"; /** * Injection token used to set the XML serialiser options. */ export declare const LF_XML_SERIALIZER_OPTIONS: InjectionToken; /** * Default name for the root (`'/'` path) XML element name. */ export declare const DEFAULT_ROOT_XML_ELEMENT_NAME = "app"; /** * Serialiser used to save/load application values as XML. Has limited support * for namespaces (defined only on the root element), if further support is * required, please open an issue. */ export declare class LfXmlSerializer extends LfSerializer { private lfStorage; charset: string; mimeType: string; accept: string; extension: string; autoBOM: boolean; encode?: (content: string) => BlobPart[]; /** * Space used when printing the value as an XML string. */ space: number | string; /** * Whether to trim whitespace characters that may exist before and after text * when deserialising. */ trim: boolean; /** * Whether to emit an XML declaration. */ emitDeclaration: boolean; /** * Version to set in the XML declaration. */ declarationVersion: string; /** * Encoding to set in the XML declaration. */ declarationEncoding: string; /** * Value for the "standalone" property in the XML declaration. */ declarationStandalone?: 'yes' | 'no'; /** * Simple transformer(s). */ simpleTransform?: LfXmlTransformer | Array>; /** * Transformer(s). */ transform?: LfXmlTransformer | Array>; /** * How to represents `null` values. */ nullValueRepresentation: 'nilAttribute' | 'emptyElement'; /** * Mapping of element names. */ elementNames?: Record; /** * Mapping of XML attributes to add to each element. */ elementAttributes?: Record; /** * Namespaces to set in the root XML element. */ namespaces?: Record; /** * Suffix used to name the XML elements that are children of a list. */ listElementSuffix: string; /** * Suffix used to name the XML elements that are children of a map. */ mapValueSuffix: string; /** * Suffix used to name the XML elements that are children of a table. */ tableRowSuffix: string; /** * Name of the XML attribute on children elements of maps used to specify the * value's key. */ mapValueKeyAttributeName: string; /** * Whether to produce XML elements without sub-elements as self-closing. */ selfCloseEmptyElements: boolean; constructor(options: LfXmlSerializerOptions | null, lfStorage: LfStorage); /** * Sets the serialiser's options. * @param options Options to set. */ setOptions(options: LfXmlSerializerOptions): void; serialize(js: any, schema: Schema & LfXmlSerializerSchemaProperties, path: string): string; deserialize(xml: string, schema: Schema & LfXmlSerializerSchemaProperties, path: string): any; /** * Path with all collection element ids replaced by the path id placeholder * (to be able to correctly access the path in the * `elementNames`/`elementProperties` maps). * @param path Path to transform. * @returns Provided path with all collection element ids replaced by the path * id placeholder. */ protected pathWithPlaceholders(path: string): string; /** * Name of the XML element associated with the given schema and path. * @param schema Schema of the value. * @param pathP Path of the value with collection element ids replaced by path * id placeholders. * @returns XML element name. */ protected elementName(schema: Schema & LfXmlSerializerSchemaProperties, pathP: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }