Home Reference Source Repository

src/typedef/index.js

/**
 * Roc builder object.
 *
 * @typedef {Object} rocBuilder
 * @property {object} buildConfig - Webpack config object, can be used to extend the configuration.
 * @property {object} builder - Webpack instance.
 * @see https://webpack.github.io/
 */

 /**
 * Roc server options.
 *
 * Used in {@link useReact}.
 *
 * For example of createRoutes see {@link createRoutes}.
 *
 * For example of createStore {@link createReduxStore}.
 *
 * The __stats__ property can also be set in `roc.config.js` however the value here will override it if provided.
 *
 * @typedef {Object} rocServerOptions
 * @property {!function} createRoutes - A function that will return a valid route object, is given the store instance
 * in the case that there is on that can be used.
 * @property {!function} [createStore] - A function that return a Redux store instance. The interface for it is:
 * `(reduxRouter, createRoutes, history) => reduxStoreInstance`. If it's not defined the application will not use
 * Redux.
 * @property {!string} stats - A path to a stats JSON file. Should match the following pattern
 * `{script: string[], css: string[]}`
 */

 /**
 * Roc client options.
 *
 * Used in {@link createClient}.
 *
 * For example of createRoutes see {@link createRoutes}.
 *
 * For example of createStore {@link createReduxStore}.
 * *
 * @typedef {Object} rocClientOptions
 * @property {!function} createRoutes - A function that will return a valid route object, is given the store instance
 * in the case that there is on that can be used.
 * @property {!function} [createStore] - A function that return a Redux store instance. The interface for it is:
 * `(reduxRouter, createRoutes, history) => reduxStoreInstance`. If it's not defined the application will not use
 * Redux.
 * @property {!string} mountNode - The id for the DOM node to mount the React application inside of.
 */