import { ChangelogSectionType, Changelog } from '../models'; /** * Serialization options for controlling output format. */ interface SerializeOptions { /** Include preamble description in header */ readonly includeDescription?: boolean; /** Include links section */ readonly includeLinks?: boolean; /** Include compare URLs for entries */ readonly includeCompareUrls?: boolean; /** Include commit references */ readonly includeCommits?: boolean; /** Include issue/PR references */ readonly includeReferences?: boolean; /** Include scope in items */ readonly includeScope?: boolean; /** Include raw content fallback */ readonly includeRawContent?: boolean; /** Section ordering (defaults to standard order) */ readonly sectionOrder?: readonly ChangelogSectionType[]; /** Custom section headings (overrides defaults) */ readonly sectionHeadings?: Partial>; /** Line ending style */ readonly lineEnding?: '\n' | '\r\n'; /** Number of blank lines between entries */ readonly entrySpacing?: number; /** Number of blank lines between sections */ readonly sectionSpacing?: number; /** Use asterisks (*) instead of dashes (-) for list items */ readonly useAsterisks?: boolean; } /** * Default serialization options. */ declare const DEFAULT_SERIALIZE_OPTIONS: Required; /** * Merges user options with defaults. * * @param options - User-provided options * @returns Complete options with defaults applied * * @example Resolving serialize options with defaults * ```typescript * const opts = resolveOptions({ includeCommits: true }) * // => { includeCommits: true, includeScope: true, lineEnding: '\n', ... } * ``` */ declare function resolveOptions(options?: SerializeOptions): Required; /** * Gets the heading for a section type, respecting custom headings. * * @param type - The changelog section type to get the heading for * @param customHeadings - Optional map of custom section type to heading overrides * @returns The heading string to use * * @example Getting section headings * ```typescript * getSectionHeading('features') * // => 'Added' * * getSectionHeading('features', { features: 'New Features' }) * // => 'New Features' * ``` */ declare function getSectionHeading(type: ChangelogSectionType, customHeadings?: Partial>): string; /** * Creates a markdown link. * * @param text - The display text for the link * @param url - The destination URL for the link * @returns Formatted markdown link * * @example Formatting a markdown link * ```typescript * formatLink('1.0.0', 'https://github.com/org/repo/releases/tag/v1.0.0') * // => '[1.0.0](https://github.com/org/repo/releases/tag/v1.0.0)' * ``` */ declare function formatLink(text: string, url: string): string; /** * Creates a list item marker. * * @param useAsterisks - Whether to use * instead of - * @returns The list item marker ('- ' or '* ') * * @example Getting list markers * ```typescript * getListMarker(false) // => '- ' * getListMarker(true) // => '* ' * ``` */ declare function getListMarker(useAsterisks: boolean): string; /** * Creates blank lines for spacing. * * @param count - Number of blank lines * @param lineEnding - Line ending style * @returns String with specified number of blank lines * * @example Creating blank line spacing * ```typescript * createSpacing(2, '\n') * // => '\n\n' * ``` */ declare function createSpacing(count: number, lineEnding: string): string; /** * JSON serialization options. */ interface JsonSerializeOptions { /** Pretty print with indentation */ readonly pretty?: boolean; /** Indentation size (for pretty printing) */ readonly indent?: number; /** Include source path in output */ readonly includeSource?: boolean; /** Include metadata in output */ readonly includeMetadata?: boolean; /** Include empty arrays */ readonly includeEmptyArrays?: boolean; } /** * Serializes a Changelog object to JSON string. * * @param changelog - The changelog object to convert to JSON * @param options - Optional JSON serialization options * @returns The JSON string representation * * @example Basic JSON serialization * ```ts * const json = serializeChangelogToJson(changelog) * ``` * * @example Pretty-printing with custom indentation * ```ts * const json = serializeChangelogToJson(changelog, { * pretty: true, * indent: 4, * }) * ``` */ declare function serializeChangelogToJson(changelog: Changelog, options?: JsonSerializeOptions): string; /** * Converts a Changelog to a plain JSON-serializable object. * Useful when you need the object itself rather than a string. * * @param changelog - The changelog to convert * @param options - Optional JSON serialization options * @returns A plain object suitable for JSON serialization * * @example Converting changelog to plain object * ```typescript * const obj = toJsonObject(changelog, { includeSource: true }) * // => { source: 'CHANGELOG.md', header: { title: '...', ... }, entries: [...] } * * // Send as API response * res.json(obj) * ``` */ declare function toJsonObject(changelog: Changelog, options?: JsonSerializeOptions): Record; /** * Serializes a Changelog object to markdown string. * * @param changelog - The changelog to serialize * @param options - Optional serialization options * @returns The markdown string representation * * @example Basic serialization * ```ts * const markdown = serializeChangelog(changelog) * ``` * * @example Serializing with custom options * ```ts * const markdown = serializeChangelog(changelog, { * includeCommits: false, * useAsterisks: true, * }) * ``` */ declare function serializeChangelog(changelog: Changelog, options?: SerializeOptions): string; export { DEFAULT_SERIALIZE_OPTIONS, createSpacing, formatLink, getListMarker, getSectionHeading, resolveOptions, serializeChangelog, serializeChangelogToJson, toJsonObject }; export type { JsonSerializeOptions, SerializeOptions };