/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
import { Directive, ElementRef, Input, NgModule } from '@angular/core';
export class IgxFocusDirective {
    /**
     * @param {?} element
     */
    constructor(element) {
        this.element = element;
        this.focusState = true;
    }
    /**
     * @return {?}
     */
    get focused() {
        return this.focusState;
    }
    /**
     * @param {?} val
     * @return {?}
     */
    set focused(val) {
        this.focusState = val;
        this.trigger();
    }
    /**
     * @return {?}
     */
    get nativeElement() {
        return this.element.nativeElement;
    }
    /**
     * @return {?}
     */
    trigger() {
        if (this.focusState) {
            requestAnimationFrame(() => this.nativeElement.focus());
        }
    }
}
IgxFocusDirective.decorators = [
    { type: Directive, args: [{
                exportAs: 'igxFocus',
                selector: '[igxFocus]'
            },] },
];
/** @nocollapse */
IgxFocusDirective.ctorParameters = () => [
    { type: ElementRef, },
];
IgxFocusDirective.propDecorators = {
    "focused": [{ type: Input, args: ['igxFocus',] },],
};
function IgxFocusDirective_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    IgxFocusDirective.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    IgxFocusDirective.ctorParameters;
    /** @type {!Object<string,!Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
    IgxFocusDirective.propDecorators;
    /** @type {?} */
    IgxFocusDirective.prototype.focusState;
    /** @type {?} */
    IgxFocusDirective.prototype.element;
}
export class IgxFocusModule {
}
IgxFocusModule.decorators = [
    { type: NgModule, args: [{
                declarations: [IgxFocusDirective],
                exports: [IgxFocusDirective]
            },] },
];
function IgxFocusModule_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    IgxFocusModule.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    IgxFocusModule.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