import ts from 'typescript';
import type { DeplintPackageConfig, DeplintPackagePlacement } from '../package/index.ts';
/** Config filenames cosmiconfig resolves for module name `xy`, in preference order. */
export declare const XY_CONFIG_FILE_NAMES: readonly ["xy.config.ts", "xy.config.mts", "xy.config.cts", "xy.config.js", "xy.config.mjs", "xy.config.cjs", ".xyrc.json", ".xyrc"];
export type DeplintPickPlacement = Extract<DeplintPackagePlacement, 'dep' | 'dev' | 'peer'>;
export interface PackageConfigEdit {
    /** Desired package entry, or `undefined` to remove the package key. */
    config: DeplintPackageConfig | undefined;
    dependency: string;
}
export declare function findXyConfigFile(dir: string): string | undefined;
/**
 * Find `deplint.packages` (whether under `commands.deplint` or a deprecated
 * top-level `deplint`) as a property assignment whose value is an object.
 */
export declare function findDeplintPackagesAssignment(sourceFile: ts.SourceFile): ts.PropertyAssignment | undefined;
/**
 * Apply package placement edits to TypeScript/JS xy.config source text.
 * Edits are applied last-to-first so offsets remain valid.
 */
export declare function applyPackageEditsToTsSource(text: string, edits: readonly PackageConfigEdit[]): string;
/**
 * Apply package placement edits to a JSON xy config (e.g. `.xyrc.json`).
 */
export declare function applyPackageEditsToJsonSource(text: string, edits: readonly PackageConfigEdit[]): string;
/** Read `commands.deplint.packages` (or top-level `deplint.packages`) from a config file. */
export declare function readPackagesFromConfigFile(configPath: string): Map<string, DeplintPackageConfig>;
export declare function createMinimalXyConfigSource(dependency: string, config: DeplintPackageConfig): string;
/**
 * Apply package config edits to the xy config for a directory.
 * Creates `xy.config.ts` when the directory has no config and there are adds.
 * Returns the path written, or `undefined` when no file changed.
 */
export declare function applyPackageEditsToConfigDir(dir: string, edits: readonly PackageConfigEdit[]): string | undefined;
export declare function placementFromConfig(config: DeplintPackageConfig | undefined): DeplintPickPlacement | undefined;
//# sourceMappingURL=editXyConfigPackages.d.ts.map