| 1 | /** |
| 2 | * Types for changelog-lib.mjs so `lib/changelog.test.ts` can import the |
| 3 | * parser under `allowJs: false`. Keep in step with the runtime module. |
| 4 | */ |
| 5 | export interface ParsedChangelogSection { |
| 6 | heading: string; |
| 7 | items: string[]; |
| 8 | itemCount: number; |
| 9 | } |
| 10 | |
| 11 | export interface ParsedChangelogRelease { |
| 12 | version: string; |
| 13 | date: string | null; |
| 14 | unreleased: boolean; |
| 15 | compareUrl: string | null; |
| 16 | sections: ParsedChangelogSection[]; |
| 17 | } |
| 18 | |
| 19 | export interface ParsedChangelog { |
| 20 | releases: ParsedChangelogRelease[]; |
| 21 | } |
| 22 | |
| 23 | export interface ParseChangelogOptions { |
| 24 | limit?: number; |
| 25 | itemsPerSection?: number; |
| 26 | itemChars?: number; |
| 27 | } |
| 28 | |
| 29 | export function plainText(markdown: string): string; |
| 30 | export function clip(text: string, max?: number): string; |
| 31 | export function parseChangelog(markdown: string, options?: ParseChangelogOptions): ParsedChangelog; |
| 32 | export function changelogAnchor(release: { |
| 33 | version: string; |
| 34 | date: string | null; |
| 35 | unreleased: boolean; |
| 36 | }): string; |
| 37 | export function renderChangelogModule(parsed: ParsedChangelog, sourcePath?: string): string; |
| 38 |