/** * @typedef {Object} Component * A component function, that can be composed with other compatible functions into one. * Compatible functions take the same arguments; return values are ignored. * * @property {function} fn the component function; * @property {number} priority determines the order in which this function will run when composed with others. */ /** * * @param {Object.} components - An object where keys are component names and values are components to compose. * @param {Object.} overrides - A map from component names to functions that should override those components. * Override functions are replacements, except that they get the original function they are overriding as their first argument. If the override * is `false`, the component is disabled. * * @return {function} - A function that will run all components in order of priority, with functions from `overrides` taking * precedence over components that match names. */ export function compose(components: { [x: string]: Component; }, overrides?: { [x: string]: boolean | Function; }): Function; /** * A component function, that can be composed with other compatible functions into one. * Compatible functions take the same arguments; return values are ignored. */ export type Component = { /** * the component function; */ fn: Function; /** * determines the order in which this function will run when composed with others. */ priority: number; };