/*!
 * KoliBri - The accessible HTML-Standard
 */
function buildDefaultPropsFromConfig(config) {
    var _a, _b;
    const defaults = {};
    for (const def of [...((_a = config.required) !== null && _a !== void 0 ? _a : []), ...((_b = config.optional) !== null && _b !== void 0 ? _b : [])]) {
        defaults[def.propName] = def.getDefaultValue();
    }
    return defaults;
}
class BaseController {
    constructor(stateAccess, propsConfig) {
        this.rawProps = {};
        this.setState = stateAccess.setState;
        this.getState = stateAccess.getState;
        this.renderProps = buildDefaultPropsFromConfig(propsConfig);
    }
    setRawProp(key, value) {
        this.rawProps[key] = value;
    }
    getRawProp(key) {
        return this.rawProps[key];
    }
    setRenderProp(key, value) {
        this.renderProps[key] = value;
    }
    getRenderProp(key) {
        return this.renderProps[key];
    }
}

export { BaseController as B };
//# sourceMappingURL=base-controller.js.map

//# sourceMappingURL=base-controller.js.map