import { Options } from 'prettier'; import { BaseOptions, SingleOperationResult } from './types.cjs'; import 'node:fs'; type CreateFileOptions = { /** * Overwrite existing file or not. */ overwrite: boolean; /** * Format file with prettier or not. * * Prefer to {@link https://prettier.io/docs/en/options | Prettier options} */ prettier: Options; } & Pick; /** * Create file with content. * {@link https://kythuen.github.io/ephemeras/fs/createFile | View Details} * * @param path File path. * @param content File content. * @param options See {@link CreateFileOptions }. * @returns Created file path. * * @example * await createFile('/foo/bar.json', JSON.stringify({})) */ declare function createFile(path: string, content?: string | Buffer, options?: Partial): Promise; type CreateDirOptions = Pick; /** * Create directory. * {@link https://kythuen.github.io/ephemeras/fs/createDir | View Details} * * @param path Directory path. * @param options See {@link CreateFileOptions }. * @returns Created directory path. * * @example * await createDir('foo/bar') */ declare function createDir(path: string, options?: Partial): Promise; interface CreateFromJSONFiles { [key: string]: CreateFromJSONFiles | string | null; } type CreateFromJSONOptions = { /** * Overwrite existing file or not. */ overwrite: boolean; /** * Format file with prettier or not. * * Prefer to {@link https://prettier.io/docs/en/options | Prettier options} */ prettier: Options; } & BaseOptions; type CreateFromJSONResult = SingleOperationResult; declare function createFromJSON(files: CreateFromJSONFiles, options?: Partial): Promise; export { type CreateDirOptions, type CreateFileOptions, type CreateFromJSONFiles, type CreateFromJSONOptions, type CreateFromJSONResult, createDir, createFile, createFromJSON };