import { BaseCheck } from '../base_check.ts'; import type { HealthCheckResult } from '../types.ts'; /** * Checks the disk space and reports warning or error after a * certain threshold is exceeded * * @example * ```typescript * const diskCheck = new DiskSpaceCheck() * .as('Root disk space check') * .warnWhenExceeds(70) // Warning at 70% * .failWhenExceeds(85) // Error at 85% * .cacheFor('1 minute') * * const result = await diskCheck.run() * console.log(result.status) // 'ok' | 'warning' | 'error' * ``` */ export declare class DiskSpaceCheck extends BaseCheck { #private; /** * The name of the disk space check */ name: string; /** * The disk path to check for space usage */ diskPath: string; /** * Defines the percentage threshold after which a * warning should be created * * @param valueInPercentage - The percentage threshold for warnings (0-100) * * @example * ```typescript * const diskCheck = new DiskSpaceCheck().warnWhenExceeds(70) * ``` */ warnWhenExceeds(valueInPercentage: number): this; /** * Defines the percentage threshold after which an * error should be created * * @param valueInPercentage - The percentage threshold for errors (0-100) * * @example * ```typescript * const diskCheck = new DiskSpaceCheck().failWhenExceeds(85) * ``` */ failWhenExceeds(valueInPercentage: number): this; /** * Defines a custom callback to compute the disk space. Defaults to * using the "check-disk-space" package * * @param callback - Function that returns disk space information * * @example * ```typescript * const diskCheck = new DiskSpaceCheck() * .compute(async () => { * // Custom disk space computation * return { free: 1000000000, size: 5000000000 } // 1GB free, 5GB total * }) * ``` */ compute(callback: () => Promise<{ free: number; size: number; }>): this; /** * Executes the disk space usage check */ run(): Promise; }