declare type voidCallback = () => void; declare type stringCallback = (arg0: string) => void; declare type objectCallback = (arg0: T) => void; declare type booleanCallback = (arg0: boolean) => void; declare interface JsonT { /** * loads JSON from file sync. * @param {string} path path to load from. * @param {boolean} hasComments file to load has comments in json. * @return {T} */ loadS: (path: string, hasComments?: boolean) => T; /** * saves JSON data to file sync. * @param {string} path path to save to. * @param {T} data data to save. * @return {void} */ saveS: (path: string, data: T) => void; /** * loads JSON from file. * @param {string} path path to load from. * @param {objectCallback} callback callback to call. * @param {boolean} hasComments file to load has comments in json. * @return {Promise} */ load: (path: string, callback?: objectCallback | undefined, hasComments?: boolean) => Promise; /** * saves JSON data to file. * @param {string} path path to save to. * @param {T} data data to save. * @param {voidCallback} callback callback to call. * @return {Promise} */ save: (path: string, data: T, callback?: voidCallback | undefined) => Promise; /** * loads JSON from file. * @param {string} path path to load from. * @param {objectCallback} callback callback to call. * @param {boolean} hasComments file to load has comments in json. */ loadW: (path: string, callback?: objectCallback | undefined, hasComments?: boolean) => Promise; /** * saves JSON data to file. * @param {string} path path to save to. * @param {T} data data to save. * @param {voidCallback} callback callback to call. */ saveW: (path: string, data: T, callback?: voidCallback | undefined) => Promise; } declare interface StringSave { /** * saves string to file sync. * @param {string} path path to save to. * @return {void} */ saveS: (path: string) => void; /** * saves string to file async. * @param {string} path path to save to. * @param {voidCallback} callback callback to call. * @return {Promise} */ save: (path: string, callback?: voidCallback | undefined) => Promise; /** * saves string to file with worker. * @param {string} path path to save to. * @param {voidCallback} callback callback to call. */ saveW: (path: string, callback?: voidCallback | undefined) => Promise; } declare interface FileT { /** * loads string data from file sync. * @param {string} path path to load from. * @return {string} */ loadS: (path: string) => string; /** * loads string data from file async. * @param {string} path path to load from. * @param {stringCallback} callback callback to call. * @return {Promise} */ load: (path: string, callback?: stringCallback | undefined) => Promise; /** * loads string data from file with worker. * @param {string} path path to load from. * @param {stringCallback} callback callback to call. */ loadW: (path: string, callback?: stringCallback | undefined) => Promise; /** * saves string to file sync. * @param {string} path path to save to. * @param {string} data data to save. * @return {void} */ saveS: (path: string, data: string) => void; /** * saves string to file async. * @param {string} path path to save to. * @param {string} data data to save. * @param {voidCallback} callback callback to call. * @return {Promise} */ save: (path: string, data: string, callback?: voidCallback | undefined) => Promise; /** * saves string to file with worker. * @param {string} path path to save to. * @param {string} data data to save. * @param {voidCallback} callback callback to call. */ saveW: (path: string, data: string, callback?: voidCallback | undefined) => Promise; } declare interface DirT { /** * Creates directory on filesystem synchronous. * @param {string} path path to dir * @return {void} */ mkS: (path: string) => void; /** * Removes directory on filesystem synchronous. * @param {string} path path to dir * @return {void} */ rmS: (path: string) => void; /** * Checks if directory exists on filesystem synchronous. * @param {string} path path to dir. * @return {boolean} */ checkS: (path: string) => boolean; /** * Creates directory on filesystem asynchronous. * @param {string} path path to dir * @param {voidCallback} callback callback to call. * @return {Promise} */ mk: (path: string, callback?: voidCallback | undefined) => Promise; /** * Removes directory on filesystem asynchronous. * @param {string} path path to dir * @param {voidCallback} callback callback to call. * @return {Promise} */ rm: (path: string, callback?: voidCallback | undefined) => Promise; /** * Checks if directory exists on filesystem asynchronous. * @param {string} path path to dir. * @param {booleanCallback} callback callback to call. * @return {Promise} */ check: (path: string, callback?: booleanCallback | undefined) => Promise; /** * NodeModules finds where the node_modules directories are. * @param {{ cwd?: string; relative?: boolean; } | string} input optional cwd input. * @returns an array of locations where node_modules is found. */ nodeModules: (input?: { cwd?: string; relative?: boolean; } | string) => string[]; } declare interface BufT { /** * loads buffer data from file. * @param {string} path path to load from. * @param {objectCallback} callback callback to call. * @return {Promise} */ load: (path: string, callback?: objectCallback | undefined) => Promise; /** * saves buffer to file. * @param {string} path path to save to. * @param {Buffer} data data to save. * @param {voidCallback} callback callback to call. * @return {Promise} */ save: (path: string, data: Buffer, callback?: voidCallback | undefined) => Promise; /** * loads buffer data from file. * @param {string} path path to load from. * @param {objectCallback} callback callback to call. */ loadW: (path: string, callback?: objectCallback | undefined) => Promise; /** * saves buffer to file. * @param {string} path path to save to. * @param {Buffer} data data to save. * @param {voidCallback} callback callback to call. */ saveW: (path: string, data: Buffer, callback?: voidCallback | undefined) => Promise; } export { FileT, JsonT, StringSave, BufT, DirT, };