type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun'; /** * Which manager the *project* uses. * * Order matters. `npm_config_user_agent` describes how the CLI was invoked * (`npx` always says npm), not what the project uses — trusting it first gave a * bun project `packageManager: "npm"` in its components.json and a * package-lock.json next to its bun.lock. The project answers for itself: the * package.json `packageManager` field first, then the lockfiles. */ export declare function detectPackageManager(cwd?: string): Promise; /** * How to suggest running the CLI again. * * A different question: not which manager the project installs dependencies * with, but how the CLI was just invoked. Someone who ran `npx zard-cli init` * in a bun project does not expect to finish reading `bunx` — and the `npx` * they already used works. Only when that cannot be known does the project's * manager answer. */ export declare function suggestedRunner(packageManager: PackageManager): string; export declare function getPackageManager(cwd?: string): Promise<'npm' | 'yarn' | 'pnpm' | 'bun'>; export declare function getInstallCommand(packageManager: string, isDev?: boolean): Promise; export declare function installPackages(packages: string[], cwd: string, packageManager: 'npm' | 'yarn' | 'pnpm' | 'bun', isDev?: boolean, legacyPeerDeps?: boolean): Promise; /** * Installs the batch and, if the manager rejects the tree over a peer conflict, * retries with the check relaxed. * * The fallback is remembered for the rest of the run: once the first batch * needed it, the following ones will need it for the same reason, and an * attempt already known to be doomed costs a full tree resolution. */ export declare function installPackagesWithRetry(packages: string[], cwd: string, packageManager: PackageManager, isDev?: boolean): Promise; /** * Drops from the batch the packages the project already declares and resolves. * * The manager charges a lot per invocation — it revalidates the whole tree even * when there is nothing to do — so the win is not in making the install faster * but in not calling it. An `add` in an already-initialized project asks for * exactly the dependencies `init` put there. * * The filter is deliberately conservative: when in doubt the package stays in * the batch and the manager decides. Comparing only the major is enough because * the versions the CLI asks for are always of the form `^N`. */ export declare function filterInstalledPackages(packages: string[], cwd: string): Promise; export {}; //# sourceMappingURL=package-manager.d.ts.map