export default mosaic; export type FileObject = { /** * - the location of the file on disk */ filepath: string; /** * - the file content */ content: string; }; export type Server = { /** * - the port to serve on */ port?: string; /** * - An optional static path */ staticPath?: string; /** * - A dictionary of key value pairs, where each key is the name of a route path, and the value is the string content that should be served for that route */ routes: { [x: string]: string; }; }; export type OutputMapFn = any; /** * - Mosaic configuration */ export type Config = { /** * - a dictionary of key value pairs where key is the name of a set of files and value is a glob pattern describing the location of those files on disk */ input: { [x: string]: string; }; /** * - an array of functions to be called in series in order to transform the input */ transform: Function[]; /** * - a function that takes the output of the transform pipeline and then returns an FileObject array representing the files to be saved to disk */ output: any; /** * - optionally serve files using an express server */ serve?: Server; }; /** * @typedef {object} FileObject * @property {string} filepath - the location of the file on disk * @property {string} content - the file content */ /** * * @typedef {object} Server * @property {string} [port=3000] - the port to serve on * @property {string} [staticPath] - An optional static path * @property {Object.} routes - A dictionary of key value pairs, where each key is the name of a route path, and the value is the string content that should be served for that route * */ /** * @typedef OutputMapFn * * @returns {FileObject[]} */ /** * * @typedef {Object} Config - Mosaic configuration * @property {Object.} input - a dictionary of key value pairs where key is the name of a set of files and value is a glob pattern describing the location of those files on disk * @property {function[]} transform - an array of functions to be called in series in order to transform the input * @property {OutputMapFn} output - a function that takes the output of the transform pipeline and then returns an FileObject array representing the files to be saved to disk * @property {Server} [serve] - optionally serve files using an express server * */ /** * * @param {Config} config * * @returns {Promise} */ declare function mosaic(config: Config): Promise;