import IOSchema from '../schema/schema.js'; import IODefinitions from './definitions.js'; import '../schema/types/memberdef.js'; import '../schema/schema-types.js'; /** * IOHeader contains the header section of an Internet Object document. * * The header stores: * - Schema definitions (prefixed with $) * - Variables (prefixed with @) * - Regular key-value metadata * - The default schema for the document's data sections * * Features: * - Schema resolution and merging from multiple sources * - Definition inheritance via merge() for document composition * - JSON serialization of non-schema, non-variable definitions * * @example * ```typescript * // Header from: * // ~ @yes: T * // ~ $person: {name: string, age: int} * // ~ $schema: {items: [$person]} * * const header = new IOHeader(); * header.definitions.set('@yes', true); * header.definitions.set('$person', personSchema); * header.schema = itemsSchema; * ``` */ declare class IOHeader { private _schema; private _definitions; constructor(); /** * Gets the active default schema for the document. * If a specific schema is set, it is returned. * Otherwise, returns the default schema ($schema) from definitions. */ get schema(): IOSchema | null; /** * Explicitly sets the default schema for the document. * This overrides the default schema found in definitions. * @param value - The Schema instance to set. */ set schema(value: IOSchema | null); /** * Gets the Definitions object managed by this header. */ get definitions(): IODefinitions; /** * Merges another IOHeader into this one. * * @param other - The other IOHeader to merge from. * @param override - If true, definitions and schema from 'other' overwrite existing ones. */ merge(other: IOHeader, override?: boolean): void; /** * Converts the header definitions to a plain JavaScript object. * Note: Variables (@) and schemas ($) are conceptually metadata/definitions * and are typically included in the output object structure. * * @returns A plain JavaScript object representing the header definitions. */ toObject(): any; /** * Alias for `toObject()`. * Provides compatibility with `JSON.stringify()`. */ toJSON(): any; } export { IOHeader as default };