import type { GitConfig } from './types'; declare const HOOK_NAMES: readonly ["pre-commit", "pre-push", "post-tag"]; /** * Installs VersionGuard-managed Git hooks in a repository. * * @public * @since 0.1.0 * @remarks * When a hook file already exists from another tool (Husky, lefthook, etc.), * VersionGuard **appends** its validation block instead of overwriting. * The block is delimited by markers so it can be cleanly removed later. * * If the hook already contains a VersionGuard block, it is replaced in-place * (idempotent). * * @param config - Git configuration that selects which hooks to install. * @param cwd - Repository directory where hooks should be installed. * @example * ```ts * import { getDefaultConfig, installHooks } from 'versionguard'; * * installHooks(getDefaultConfig().git, process.cwd()); * ``` */ export declare function installHooks(config: GitConfig, cwd?: string): void; /** * Removes VersionGuard-managed Git hooks from a repository. * * @public * @since 0.1.0 * @remarks * Only the VersionGuard block (delimited by markers) is removed. * Other hook content from Husky, lefthook, etc. is preserved. * If the hook becomes empty after removal, the file is deleted. * * @param cwd - Repository directory whose hooks should be cleaned up. * @example * ```ts * import { uninstallHooks } from 'versionguard'; * * uninstallHooks(process.cwd()); * ``` */ export declare function uninstallHooks(cwd?: string): void; /** * Finds the nearest `.git` directory by walking up from a starting directory. * * @public * @since 0.1.0 * @remarks * This only resolves `.git` directories and returns `null` when the search * reaches the filesystem root without finding a repository. * * @param cwd - Directory to start searching from. * @returns The resolved `.git` directory path, or `null` when none is found. * @example * ```ts * import { findGitDir } from 'versionguard'; * * const gitDir = findGitDir(process.cwd()); * ``` */ export declare function findGitDir(cwd: string): string | null; /** * Checks whether all VersionGuard-managed hooks are installed. * * @public * @since 0.1.0 * @remarks * A hook counts as installed when the file exists and contains the * `versionguard` invocation — either as a standalone hook or appended * to an existing hook from another tool. * * @param cwd - Repository directory to inspect. * @returns `true` when every managed hook is installed. * @example * ```ts * import { areHooksInstalled } from 'versionguard'; * * const installed = areHooksInstalled(process.cwd()); * ``` */ export declare function areHooksInstalled(cwd?: string): boolean; /** * Generates the shell script content for a Git hook. * * @public * @since 0.1.0 * @remarks * The generated script delegates to `npx versionguard validate` and exits with * the validation status code. Uses delimited block markers for cooperative * installation with other hook tools. * * @param hookName - Name of the Git hook to generate. * @returns Executable shell script contents for the hook. * @example * ```ts * import { generateHookScript } from 'versionguard'; * * const script = generateHookScript('pre-commit'); * ``` */ export declare function generateHookScript(hookName: (typeof HOOK_NAMES)[number]): string; export {}; //# sourceMappingURL=hooks.d.ts.map