import "@-xun/symbiote/assets/conventional.config.js"; import { ThisPackageGlobalScope as ChangelogBuilderScope } from "../../configure.js"; import type { AsStrictExecutionContext, ChildConfiguration } from '@-xun/cli'; import type { Promisable } from 'type-fest'; import type { GlobalCliArguments, GlobalExecutionContext } from "../../configure.js"; /** * A changelog patch that will be applied to the changelog file. * * It mirrors the parameters of {@link String.prototype.replace} in form and * function. That is: each `ChangelogPatch` `searchValue` will be replaced by * `replaceValue` in the changelog file. * * Note that replacements are made in-place, meaning order does matter. */ export type ChangelogPatch = [searchValue: string | RegExp, replaceValue: string]; /** * An array of zero or more {@link ChangelogPatch}es. * * `changelog.patch.mjs` can export via default either `ChangelogPatches` or a * {@link ChangelogPatcherFunction}. */ export type ChangelogPatches = ChangelogPatch[]; /** * A function that receives the current contents of the changelog file and a * `patcher` function. `ChangelogPatcherFunction` must return a string that will * become the new contents of the changelog file. * * `patcher` is the optional second parameter of `ChangelogPatcherFunction` that * accepts a `changelog` string and `patches`, which is an array of * {@link ChangelogPatches}. `patcher` can be used to quickly apply an array of * `patches` to the given `changelog` string. Its use is entirely optional. * * `changelog.patch.mjs` can export via default either * `ChangelogPatcherFunction` or a {@link ChangelogPatches} array. */ export type ChangelogPatcherFunction = (changelog: string, patcher: (changelog: string, patches: ChangelogPatches) => string) => Promisable; /** * Represents the result of importing a `changelog.patch.mjs` file. * `changelog.patch.mjs` can export via default either * {@link ChangelogPatcherFunction} or a {@link ChangelogPatches} array. */ export type ImportedChangelogPatcher = ChangelogPatches | ChangelogPatcherFunction; /** * Determines the output format of the changelog file. */ export declare enum OutputOrder { /** * Sections (heading level 2) are comprised of major and minor releases with * patch changes becoming subsections (heading level 3) of their nearest * major/minor release section. * * Such changelogs read as a "storybook". */ Storybook = "storybook", /** * The default changelog formatting where sections are listed in chronological * release order. */ Descending = "descending", } /** * @see {@link OutputOrder} */ export declare const availableOutputOrders: OutputOrder[]; /** * @see {@link ChangelogBuilderScope} */ export declare const changelogBuilderScopes: ChangelogBuilderScope.ThisPackage[]; export type CustomCliArguments = GlobalCliArguments & { skipTopmatter: boolean; patchChangelog: boolean; formatChangelog: boolean; onlyPatchChangelog: boolean; outputUnreleased: boolean; outputOrder: OutputOrder; importSectionFile?: string; changelogFile: string; }; export default function command(globalExecutionContext: AsStrictExecutionContext): ChildConfiguration;