import IODocument from '../core/document.js'; import { StringifyOptions } from './stringify.js'; export { loadDocument as documentFromObject } from './load-document.js'; import '../core/header.js'; import '../schema/schema.js'; import '../schema/types/memberdef.js'; import '../schema/schema-types.js'; import '../core/definitions.js'; import '../core/section-collection.js'; import '../core/section.js'; import '../core/collection.js'; import '../core/internet-object.js'; /** * Options for stringifying documents */ interface StringifyDocumentOptions extends StringifyOptions { /** * Include header section with definitions * Default: true (includes if header has definitions) */ includeHeader?: boolean; /** * Include section names after '---' (e.g., '--- users') * Default: true */ includeSectionNames?: boolean; /** * Include only specific sections (by name) * If not provided, includes all sections */ sectionsFilter?: string[]; /** * Format for definitions in header * - 'io': Internet Object format (~ key: value) * Default: 'io' */ definitionsFormat?: 'io'; } /** * Stringify a complete IODocument to Internet Object text format. * * This function serializes the entire document structure including: * - Header with definitions and schema * - All data sections * - Section separators and names * * @param doc - IODocument to stringify * @param options - Formatting and filtering options * @returns Internet Object text representation * * @example * ```typescript * // Stringify document with default options * const text = stringifyDocument(doc); * // Output: * // ~ appName: MyApp, ~ version: 1.0 * // --- * // Alice, 28 * // Bob, 35 * * // Stringify with pretty printing * const text = stringifyDocument(doc, { indent: 2 }); * * // Stringify specific sections only * const text = stringifyDocument(doc, { * sectionsFilter: ['users', 'products'] * }); * * // Stringify without header * const text = stringifyDocument(doc, { includeHeader: false }); * ``` */ declare function stringifyDocument(doc: IODocument, options?: StringifyDocumentOptions): string; export { type StringifyDocumentOptions, stringifyDocument };