import type { IdfDocument } from '../document.js'; import type { AnyTypeMap } from '../typemap.js'; import type { EpJson } from '../parse/epjson.js'; export interface WriteEpJsonOptions { /** * Indent width. `0` emits compact JSON. * @defaultValue 2 */ indent?: number; /** * Reproduce the text the document was read from, on this format's own terms. * * **All or nothing, which is not what the text format does.** The object notation has no * statements, so there is nothing to anchor an object's own characters to and no way to * reproduce one object while reformatting another. The retained text is therefore reproduced * only while nothing has been touched, nothing added and nothing removed, and any change at all * falls the whole document back to the ordinary writer. * * Both languages preserve this format on these terms. The difference is a property of the * format, not of either library, and it is stated here because a reader who knows the text * format's per-object terms would otherwise assume them. * * Tri-state as it is on the text writer: absent decides, `true` preserves and is a quiet * fallback when there is nothing to preserve, `false` formats. * * @defaultValue undefined, meaning decide */ preserveFormatting?: boolean; } /** * Serialize a document to epJSON text. * * Choice values are emitted in the casing the schema declares, whatever casing the field was * written or set in, because the epJSON reader matches the schema's `enum` exactly and fatals on * anything else. `IdfObject.toJSON` carries the rule and the reasoning; `writeIdf` keeps the * author's casing, which is right for a format that reads a choice case-insensitively. * * The preserving path below is the one exception, and it is the ordinary meaning of preserving: * text reproduced from an epJSON source comes back as it was read, a value the schema spells * differently included. */ export declare function writeEpJson(document: IdfDocument, options?: WriteEpJsonOptions): string; /** * Serialize a document to a plain epJSON object. * * Canonicalises choice values exactly as `writeEpJson` does: the two differ in what they hand * back, never in what they say. */ export declare function toEpJson(document: IdfDocument): EpJson; //# sourceMappingURL=epjson.d.ts.map