import { C as CompressionType, i as ReadTomlOptions, j as WriteTomlOptions } from "./packem_shared/types.d-B-T1rDxl.js"; import 'node:fs'; import 'fdir'; /** * Asynchronously reads a TOML file and parses it into an object. * @template R The expected type of the parsed TOML object. Defaults to `Record<string, unknown>`. * @param path The path to the TOML file to read. Can be a file URL or a string path. * @param options Optional configuration for reading the file. See {@link ReadTomlOptions}. * @returns A promise that resolves with the parsed TOML object of type `R`. * @example * ```javascript * import { readToml } from "@visulima/fs/toml"; * import { join } from "node:path"; * * const config = await readToml(join("path", "to", "config.toml")); * ``` */ declare const readToml: >(path: URL | string, options?: ReadTomlOptions) => Promise; /** * Synchronously reads a TOML file and parses it into an object. * @template R The expected type of the parsed TOML object. Defaults to `Record<string, unknown>`. * @param path The path to the TOML file to read. Can be a file URL or a string path. * @param options Optional configuration for reading the file. See {@link ReadTomlOptions}. * @returns The parsed TOML object of type `R`. * @example * ```javascript * import { readTomlSync } from "@visulima/fs/toml"; * import { join } from "node:path"; * * const config = readTomlSync(join("path", "to", "config.toml")); * ``` */ declare const readTomlSync: (path: URL | string, options?: ReadTomlOptions) => Record; /** * Asynchronously writes an object to a TOML file. * @param path The path to the TOML file to write. Can be a file URL or a string path. * @param data The data to serialize. Must be a plain object compatible with `smol-toml.stringify`. * @param options Optional configuration for writing the TOML file. See {@link WriteTomlOptions}. * @returns A promise that resolves when the TOML file has been written. * @example * ```javascript * import { writeToml } from "@visulima/fs/toml"; * import { join } from "node:path"; * * await writeToml(join("/tmp", "config.toml"), { name: "app", version: 1 }); * ``` */ declare const writeToml: (path: URL | string, data: Record, options?: WriteTomlOptions) => Promise; /** * Synchronously writes an object to a TOML file. * @param path The path to the TOML file to write. Can be a file URL or a string path. * @param data The data to serialize. Must be a plain object compatible with `smol-toml.stringify`. * @param options Optional configuration for writing the TOML file. See {@link WriteTomlOptions}. * @example * ```javascript * import { writeTomlSync } from "@visulima/fs/toml"; * import { join } from "node:path"; * * writeTomlSync(join("/tmp", "config.toml"), { name: "app", version: 1 }); * ``` */ declare const writeTomlSync: (path: URL | string, data: Record, options?: WriteTomlOptions) => void; export { type ReadTomlOptions, type WriteTomlOptions, readToml, readTomlSync, writeToml, writeTomlSync };