/*!
 * KoliBri - The accessible HTML-Standard
 */
import { altProp, loadingProp, sizesProp, srcProp, srcsetProp } from "../../props";
import { BaseController } from "../base-controller";
import { imagePropsConfig } from "./api";
export class ImageController extends BaseController {
    constructor(stateAccess) {
        super(stateAccess, imagePropsConfig);
    }
    componentWillLoad(props) {
        const { alt, loading, sizes, src, srcset } = props;
        this.watchAlt(alt);
        this.watchLoading(loading);
        this.watchSizes(sizes);
        this.watchSrc(src);
        this.watchSrcset(srcset);
    }
    watchAlt(value) {
        altProp.apply(value, (v) => {
            this.setRenderProp('alt', v);
        });
    }
    watchLoading(value) {
        loadingProp.apply(value, (v) => {
            this.setRenderProp('loading', v);
        });
    }
    watchSizes(value) {
        sizesProp.apply(value, (v) => {
            this.setRenderProp('sizes', v);
        });
    }
    watchSrc(value) {
        srcProp.apply(value, (v) => {
            this.setRenderProp('src', v);
        });
    }
    watchSrcset(value) {
        srcsetProp.apply(value, (v) => {
            this.setRenderProp('srcset', v);
        });
    }
}
//# sourceMappingURL=controller.js.map
