import { InjectionToken, ChangeDetectorRef } from '@angular/core';

const NATIVE_TOKEN = new InjectionToken('native token');

function detectChangesDecorator(target, propertyName, propertyDescriptor) {
    const method = propertyDescriptor.value;
    propertyDescriptor.value = function (...args) {
        const injector = this.injector;
        if (!injector) {
            throw new Error('You must provide Injector as injector in component constructor');
        }
        const result = method.apply(this, args);
        if (injector.get(NATIVE_TOKEN, null)) {
            injector.get(ChangeDetectorRef).detectChanges();
        }
        return result;
    };
    return propertyDescriptor;
}

/**
 * Generated bundle index. Do not edit.
 */

export { NATIVE_TOKEN, detectChangesDecorator };
//# sourceMappingURL=ironsource-fusion-ui-decorators.mjs.map
