/** * Copyright 2017 Yahoo Holdings Inc. * Licensed under the terms of the MIT license. See LICENSE file in project root for terms. */ import type { ICerebroConfig, ICerebroConfigEntry, ICerebroConfigOptions, ICerebroContext, ICerebroOptions } from './interfaces'; /** * Cerebro is the main class that creates the configuration. * It takes a configuration object and returns a CerebroConfig object * that represents the settings store. * * @class Cerebro * @constructor * @param {Array} config List of configuration objects * @param {Object} [options] * @param {Object} [options.customEvaluators] - contains the list of custom evaluators {evaluator: function} * @param {Object} [options.poller] - contains the poller instance */ export declare class Cerebro = Record> { _config: any; _customEvaluators: any; constructor(config: ICerebroConfigEntry[], options?: ICerebroOptions); /** * Builds a config based on provided context * @param {Object} context * @param {Object} [options] * @param {Object} [options.overrides] - contains the list of overrides {setting: 'value'} * @return {CerebroConfig} */ resolveConfig(context: ICerebroContext, options?: ICerebroConfigOptions): ICerebroConfig; /** * Parses the dehydrated object for use on the client. * Intended to be used on the client. * The input of this function is expected to be the output of dehydrate(). * * @param {JSON} dehydratedObject The output of #dehydrate() * @return {CerebroConfig} A usable instance of CerebroConfig */ static rehydrate = Record>(dehydratedObject: string): ICerebroConfig; private _handleConfigUpdate; private _preprocess; private _build; /** * Verifies that custom evalutors are functions and come wrapped in an object. * Throws an error if the custom evaluator is not in the right format. * * @private * @param {Object} customEvaluators The object to be evaluated */ private _validateCustomEvaluators; }