1 | /**
|
2 | * @typedef {object} FileObject
|
3 | * @property {string} filepath - the location of the file on disk
|
4 | * @property {string} content - the file content
|
5 | */
|
6 |
|
7 | /**
|
8 | *
|
9 | * @typedef {object} Server
|
10 | * @property {string} [port=3000] - the port to serve on
|
11 | * @property {string} [staticPath] - An optional static path
|
12 | * @property {Object.<string, string>} 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
|
13 | *
|
14 | */
|
15 |
|
16 | /**
|
17 | * @typedef OutputMapFn
|
18 | *
|
19 | * @returns {FileObject[]}
|
20 | */
|
21 |
|
22 | /**
|
23 | *
|
24 | * @typedef {Object} Config - Mosaic configuration
|
25 | * @property {Object.<string,string>} 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
|
26 | * @property {function[]} transform - an array of functions to be called in series in order to transform the input
|
27 | * @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
|
28 | * @property {Server} [serve] - optionally serve files using an express server
|
29 | *
|
30 | */
|
31 |
|
32 | /**
|
33 | *
|
34 | * @param {Config} config
|
35 | *
|
36 | * @returns {Promise<void>}
|
37 | */
|