@jkcfg/std
Version:
jk standard library
27 lines (26 loc) • 842 B
TypeScript
import * as std from '../index';
import { WriteOptions } from '../write';
import { ValidateFn } from './validate';
/**
* File is the basic unit of input for generate; it represents a
* configuration item to output to a file.
*/
export interface File {
path: string;
value: any | Promise<any>;
format?: std.Format;
validate?: ValidateFn;
}
export interface GenerateParams {
stdout?: boolean;
overwrite?: std.Overwrite;
writeFile?: (v: any, p: string, o?: WriteOptions) => void;
}
declare type GenerateArg = File[] | Promise<File[]> | (() => File[]);
/**
* generate is the entry point for the module; it accepts the input
* configuration, and outputs validated values to the files as
* specified.
*/
export declare function generate(definition: GenerateArg, params: GenerateParams): Promise<void>;
export {};