/**
 * Dynamic item extension base class
 */
export class DynamicItemExtensionBase {
    //######################### constructor #########################
    constructor(metadata) {
        this.metadata = metadata;
        /**
         * Indication whether was extension initialized
         */
        this.initialized = false;
    }
    //######################### public methods - implementation of DynamicItemExtension #########################
    /**
     * @inheritdoc
     */
    async initialize(injector, element, instance) {
        this.initialized = true;
        this.injector = injector;
        this.element = element;
        this.instance = instance;
        await this.onInit();
    }
    /**
     * @inheritdoc
     */
    async optionsChange(options) {
        this.options = options;
        if (!this.initialized) {
            return;
        }
        await this.onOptionsChange();
    }
    /**
     * @inheritdoc
     */
    destroy() {
        this.onDestroy();
    }
    //######################### protected methods #########################
    /**
     * Called on initialization of component
     */
    onInit() {
    }
    /**
     * Called on change of options of component
     */
    onOptionsChange() {
    }
    /**
     * Called on destruction of component
     */
    onDestroy() {
    }
}
//# sourceMappingURL=dynamicItemExtensionBase.js.map