/** Options accepted by {@link parseChangelog}. Provide either `filePath` or `text`. */ export interface ChangelogOptions { /** Path to a changelog file. */ filePath?: string; /** Raw changelog text (alternative to `filePath`). */ text?: string; /** Strip markdown from parsed entries. Defaults to `true`. */ removeMarkdown?: boolean; } /** A single version entry in the parsed changelog. */ export interface ChangelogVersion { /** Semver string if the heading is semver-compliant, otherwise `null`. */ version: string | null; /** The raw heading text. */ title: string | null; /** Date parsed from the heading if present, otherwise `null`. */ date: string | null; /** All content under the heading, as a single string. */ body: string; /** * List items grouped by subheading. The `_` key holds every list item; * each `### Subheading` adds a key with the items beneath it. */ parsed: Record; } /** The parsed changelog. */ export interface Changelog { /** The document title (first H1), if present. */ title?: string; /** Free text between the title and the first version, if any. */ description?: string; /** Version entries in document order. */ versions: ChangelogVersion[]; } /** Node-style callback invoked with the parsed changelog. */ export type ChangelogCallback = (error: Error | null, changelog?: Changelog) => void; /** * Parse a changelog from a file path or text string. * * Accepts a file path string, or an options object with `filePath` or `text`, * plus an optional `removeMarkdown` flag (default `true`). Returns a Promise; * if a callback is supplied it is invoked with `(error, changelog)` as well. */ declare function parseChangelog(options: string | ChangelogOptions, callback?: ChangelogCallback): Promise; export default parseChangelog; export { parseChangelog };