import { PinionContext, Callable } from '../core'; import { WriteFileOptions } from './helpers'; export declare const toFile: (...targets: Callable[]) => (ctx: T) => Promise; export declare const fromFile: (...targets: Callable[]) => (ctx: T) => Promise; export declare type JSONData = { [key: string]: any; }; /** * Recursively copy all files from a folder to a destination. * Will prompt if the to file already exists. * * @param from The (local) folder to copy files from * @param to The destination to copy the files to * @param options File copy options (e.g. `{ force: true }`) * @returns The current context */ export declare const copyFiles: (from: Callable, to: Callable, options?: Partial) => (ctx: T) => Promise; /** * Load a JSON file and merge the data into the context * * @param file The name of the JSON file * @param converter A converter that returns the data that will be merged into the context * @returns The current context */ export declare const loadJSON: (file: Callable, converter?: (data: JSONData, ctx: C) => JSONData, fallback?: Callable | undefined) => (ctx: T) => Promise; /** * Write formatted JSON to a file * * @param json The JSON data to write * @param file The filename to write to * @returns The current context */ export declare const writeJSON: (json: Callable, file: Callable, options?: Partial) => (ctx: T) => Promise; /** * Merge an existing JSON file with new data * * @param json The JSON data to add to the file * @param file The filename to write to * @returns The current context */ export declare const mergeJSON: (json: Callable, file: Callable) => (ctx: T) => Promise;