@stryke/fs
Version:
A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.
39 lines (38 loc) • 1.66 kB
text/typescript
import * as _$smol_toml0 from "smol-toml";
import TOML from "smol-toml";
//#region src/toml.d.ts
/**
* Reads a TOML file and returns the object the TOML content represents.
*
* @param path - A path to a file.
* @param options - TOML parse options
* @returns Object the TOML content of the file represents
*/
declare function readTomlFileSync(path: string, options?: Parameters<typeof TOML.parse>[1]): _$smol_toml0.TomlTableWithoutBigInt;
/**
* Reads a TOML file and returns the object the TOML content represents.
*
* @param path - A path to a file.
* @param options - TOML parse options
* @returns Object the TOML content of the file represents
*/
declare function readTomlFile(path: string, options?: Parameters<typeof TOML.parse>[1]): Promise<_$smol_toml0.TomlTableWithoutBigInt>;
/**
* Reads a TOML file and returns the object the TOML content represents.
*
* @param path - A path to a file.
* @param data - data which should be serialized/formatted to TOML and written to the file
* @param options - TOML parse options
*/
declare function writeTomlFileSync(path: string, data: object, options?: Parameters<typeof TOML.stringify>[1]): void;
/**
* Reads a TOML file and returns the object the TOML content represents.
*
* @param path - A path to a file.
* @param data - data which should be serialized/formatted to TOML and written to the file
* @param options - TOML parse options
*/
declare function writeTomlFile(path: string, data: object, options?: Parameters<typeof TOML.stringify>[1]): Promise<void>;
//#endregion
export { readTomlFile, readTomlFileSync, writeTomlFile, writeTomlFileSync };
//# sourceMappingURL=toml.d.mts.map