UNPKG

hdd-space

Version:

This module provides getting information about free space and size of hdds

38 lines (37 loc) 1.13 kB
import { Format } from './format'; export interface Part { size: number; free: number; letter?: string; mountOn?: string; place?: string; } export interface HddInfo { parts: Part[]; total: Part; } export interface FormatedPart { size: string | number; free: string | number; letter?: string | number; mountOn?: string; place?: string; } export interface FormatedHddInfo { parts: FormatedPart[]; total: FormatedPart; } export declare type OutputFetcher = (cb: Callback<string>) => void; export interface Opts { format: Format; output?: string; platform?: 'posix' | 'win32'; fetchOutput?: OutputFetcher; } export interface Callback<T> { (err: Error | null, data?: T): void; } export declare function getHddInfo(opts: Opts, callback: Callback<FormatedHddInfo>): void; export declare function fetchHddInfo(opts?: Opts): Promise<FormatedHddInfo>; export declare type InfoCallback = (res: FormatedHddInfo) => void; export default function getCrossPlatformInfo(opts: Opts | InfoCallback, callback?: InfoCallback): void;