/**
 * Describes a step in the variables overriding chain.
 */ export interface Reducer { /**
     * Name of the reducer.
     */ name : string ; /**
     * Overrides variables for the specified component.
     * If component name is not specified then overrides only
     * global variables.
     */ reduce ( target , componentName ? ) : Record < string , any > ; } export function reduce ( reducers , componentName ? ) { return reducers . reduce ( ( target , reducer ) => reducer . reduce ( target , componentName ) , { } ) ; } export async function reduceAsync ( reducers , componentName ? ) { let target = { } ; for ( const reducer of reducers ) { target = await reducer . reduce ( target , componentName ) ; } return target ; }