/** * Matches directories (relative to the workspace root, `/`-separated) against * workspace globs the way pnpm 10 finds projects: each glob is matched as * `/package.json` with any leading `./` dropped, `!` excludes unless it * opens a negated extglob `!(…)`, node_modules and bower_components never * count, and a hidden directory counts only when a glob names it. With * `rules: "npm"`, package.json workspace patterns apply in order, so a later * positive pattern can re-include a path; only node_modules is skipped. * `bases` are the directories a walk starts from (each glob's leading literal * segments), and `mayContain` tells it whether a directory can hold a match. */ export declare function workspaceMemberMatcher(patterns: string[], rules?: "pnpm" | "npm"): { bases: string[]; lists: (dir: string) => boolean; mayContain: (dir: string) => boolean; }; /** * Whether a pnpm workspace lists the project at `projectDir` (relative to the * workspace root, `/`-separated), by the rule in `workspaceMemberMatcher`. A * workspace without a `packages` list holds only its root. Throws when the * YAML or its `packages` list is invalid. */ export declare function pnpmWorkspaceListsProject(yaml: string, projectDir: string): boolean; /** Return pnpm workspace package globs from either block- or flow-style YAML. */ export declare function pnpmWorkspacePackagePatterns(yaml: string): string[]; /** * Merge key-value entries into named sections of a pnpm-workspace.yaml string * without creating duplicate section headers. For each section: * - If the section already exists, new entries are injected after its header. * - If the section is absent, a new block is appended at the end. * Entries already present (by key) are skipped. */ export declare function mergeWorkspaceYamlSections(yaml: string, sections: Record>): string; export declare function mergeWorkspaceYamlListItems(yaml: string, section: string, items: string[]): string; /** * Add `item` to `minimumReleaseAgeExclude` when the workspace turns on pnpm's * `minimumReleaseAge` gate. Returns the input unchanged when the gate is off * or the item is already listed; throws when the YAML cannot be parsed, the * section is not a list, or the edited text would not parse to a list that * holds the item. */ export declare function addMinimumReleaseAgeExclude(yaml: string, item: string): string;