import * as _angular_core from '@angular/core';
import { OnInit, OnChanges, ElementRef, AfterViewInit, TemplateRef, ViewContainerRef, OnDestroy, QueryList, EventEmitter, OutputRefSubscription, ChangeDetectorRef, Renderer2 } from '@angular/core';
import { CssClassBuilder, HasElementRef } from '@fundamental-ngx/cdk/utils';
import { ContentDensityObserver } from '@fundamental-ngx/core/content-density';
import { LiveAnnouncer } from '@angular/cdk/a11y';
import { IconFont } from '@fundamental-ngx/core/icon';
import { Subscription } from 'rxjs';

declare class TokenizerInputDirective implements OnInit, OnChanges, CssClassBuilder {
    /** user's custom classes */
    class: string;
    /** @hidden */
    readonly elementRef: ElementRef<any>;
    /** @hidden
     * CssClassBuilder interface implementation
     * function must return single string
     * function is responsible for order which css classes are applied
     */
    buildComponentCssClass(): string[];
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    ngOnChanges(): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<TokenizerInputDirective, never>;
    static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TokenizerInputDirective, "[fdTokenizerInput], [fd-tokenizer-input]", never, { "class": { "alias": "class"; "required": false; }; }, {}, never, never, true, never>;
}

/**
 * A token is used to represent contextualizing information.
 * They can be useful to show applied filters, selected values for form fields or object metadata.
 */
declare class TokenComponent implements AfterViewInit, HasElementRef {
    /** @hidden */
    readonly tokenWrapperElement: _angular_core.Signal<ElementRef<any> | undefined>;
    /** @hidden */
    readonly _content: _angular_core.Signal<TemplateRef<unknown> | undefined>;
    /** @hidden */
    readonly _viewContainer: _angular_core.Signal<ViewContainerRef | undefined>;
    /** Emitted when the *x* icon is clicked. Specifically, any pseudo-element. */
    readonly onCloseClick: _angular_core.OutputEmitterRef<MouseEvent | undefined>;
    /** Emitted when token should be removed */
    readonly onRemove: _angular_core.OutputEmitterRef<void>;
    /** Emitted when a token is clicked. */
    readonly onTokenClick: _angular_core.OutputEmitterRef<MouseEvent>;
    /** Emitted when a there's a keydown registered on the token. */
    readonly onTokenKeydown: _angular_core.OutputEmitterRef<KeyboardEvent>;
    /** Emitted when token element received or lost focus. */
    readonly elementFocused: _angular_core.OutputEmitterRef<boolean>;
    /** Whether the token is disabled. */
    readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
    /** Whether the token is selected. Supports two-way binding via [(selected)]. */
    readonly selected: _angular_core.ModelSignal<boolean>;
    /** Whether the token is read-only. */
    readonly readOnly: _angular_core.InputSignal<boolean>;
    /** @hidden Internal signal for total count (set by tokenizer) */
    readonly _totalCount: _angular_core.WritableSignal<number | undefined>;
    /** @hidden Internal signal for item position (set by tokenizer) */
    readonly _itemPosition: _angular_core.WritableSignal<number | undefined>;
    /** @hidden */
    readonly elementRef: ElementRef<any>;
    /** @hidden */
    readonly _contentDensityObserver: ContentDensityObserver;
    /** @hidden */
    private readonly _destroyRef;
    /** @hidden */
    ngAfterViewInit(): void;
    /** @hidden */
    closeClickHandler(event?: MouseEvent): void;
    /** @hidden */
    tokenClickHandler(event: MouseEvent): void;
    /** @hidden */
    tokenKeydownHandler(event: KeyboardEvent): void;
    /** @hidden */
    _setTotalCount(count: number, itemPosition: number): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<TokenComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<TokenComponent, "fd-token", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; }, { "onCloseClick": "onCloseClick"; "onRemove": "onRemove"; "onTokenClick": "onTokenClick"; "onTokenKeydown": "onTokenKeydown"; "elementFocused": "elementFocused"; "selected": "selectedChange"; }, never, ["*"], true, never>;
}

declare class TokenizerComponent implements AfterViewInit, OnDestroy, CssClassBuilder, OnInit, OnChanges {
    readonly _contentDensityObserver: ContentDensityObserver;
    readonly elementRef: ElementRef;
    private _cdRef;
    private _renderer;
    private readonly _document;
    private readonly _liveAnnouncer;
    /** user's custom classes */
    class: string;
    /** Disables possibility to remove tokens by keyboard */
    disableKeyboardDeletion: boolean;
    /** @hidden */
    tokenList: QueryList<TokenComponent>;
    /** @hidden */
    input: ElementRef<HTMLInputElement>;
    /** @hidden */
    tokenizerInnerEl: ElementRef<HTMLDivElement>;
    /** @hidden */
    moreElement: ElementRef<HTMLElement>;
    /** @hidden */
    set content(content: ElementRef<HTMLElement>);
    /** @hidden */
    readonly _viewContainer: QueryList<ViewContainerRef>;
    /** @hidden */
    get _hiddenTokens(): TokenComponent[];
    /** Whether to use cozy visuals but compact collapsing behavior. */
    compactCollapse: boolean;
    /** Whether tokenizer should have fake focus indicator, when input is focused inside*/
    tokenizerFocusable: boolean;
    /** The value for the tokenizer input */
    inputValue: string;
    /** Icon of the button on the right of the input field. */
    glyph: string;
    /** Glyph font family */
    glyphFont: IconFont;
    /** Word to use for when there are extra tokens. */
    moreTerm: string;
    /** @hidden */
    open: boolean;
    /** @Hidden */
    showOverflowPopover: boolean;
    /** Event emitted when the search term changes. Use *$event* to access the new term. */
    readonly moreClickedEvent: EventEmitter<any>;
    /** Number of tokens the consumer chose not to render (e.g., from count-based virtualization).
     *  When > 0, the tokenizer adds this to its own width-hidden count in the "+N more" label,
     *  and suppresses its internal overflow popover (consumer should handle "show me" via moreClickedEvent). */
    readonly externalHiddenCount: _angular_core.InputSignal<number>;
    /** @hidden */
    inputGroupAddonEl: ElementRef;
    /** @hidden */
    previousElementWidth: number;
    /** @hidden */
    moreTokensLeft: Array<TokenComponent>;
    /** @hidden */
    moreTokensRight: Array<TokenComponent>;
    /** @hidden */
    previousTokenCount: number;
    /** @hidden */
    tokenListChangesSubscription: Subscription;
    /** @hidden */
    tokenListClickSubscriptions: OutputRefSubscription[];
    /** @hidden */
    hiddenCozyTokenCount: number;
    /** @hidden Used to add focus to tokenizer element */
    _tokenizerHasFocus: boolean;
    /** @hidden */
    readonly _showMoreElement: _angular_core.WritableSignal<boolean>;
    /** Whether tokenizer's own width-collapse "+N more" span is currently rendered. */
    readonly hasInternalOverflowIndicator: _angular_core.Signal<boolean>;
    /** @hidden */
    _tokensContainerWidth: string;
    /** @hidden */
    private _tokenOutputSubscriptions;
    /** @hidden */
    private _translationResolver;
    /** @hidden
     * Variable which will keep the index of the first token pressed in the tokenizer
     */
    private _firstElementInSelection;
    /** @hidden
     * Variable which will keep the index of the last token pressed in the tokenizer
     */
    private _lastElementInSelection;
    /** @hidden
     * Flag which will say if the last keyboard and click operation they used was using control
     */
    private _ctrlPrevious;
    /** @hidden
     * Flag which will say if they held shift and clicked highlighting elements before or
     */
    private _directionShiftIsRight;
    /** An RxJS Subject that will kill the data stream upon destruction (for unsubscribing)  */
    private readonly _destroyRef;
    /** @hidden */
    private readonly _rtlService;
    /** @hidden */
    private readonly _eventListeners;
    /** @hidden */
    private _forceAllTokensToDisplay;
    /** @hidden */
    private _tokenElementFocused;
    /** @hidden */
    private _inputElementFocused;
    /** @hidden */
    private _tokenElementFocusedSub;
    /** @hidden */
    private readonly _langSignal;
    /** @hidden */
    constructor(_contentDensityObserver: ContentDensityObserver, elementRef: ElementRef, _cdRef: ChangeDetectorRef, _renderer: Renderer2, _document: Document, _liveAnnouncer: LiveAnnouncer);
    /** @hidden
     * CssClassBuilder interface implementation
     * function must return single string
     * function is responsible for order which css classes are applied
     */
    buildComponentCssClass(): string[];
    /** @hidden */
    keyDown(keyboardEvent: KeyboardEvent): void;
    /** @hidden */
    ngAfterViewInit(): void;
    /** @hidden */
    ngOnDestroy(): void;
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    ngOnChanges(): void;
    /** @hidden */
    handleTokenClickSubscriptions(): void;
    /** @hidden */
    focusTokenElement(newIndex: number): HTMLElement | undefined;
    /** @hidden */
    onResize(): void;
    /** @hidden */
    handleKeyDown(event: KeyboardEvent, fromIndex: number): void;
    /** @hidden */
    getCombinedTokenWidth(): number;
    /** @hidden */
    moreClicked(): void;
    /** Removes all selected tokens */
    removeSelectedTokens(): void;
    /** @hidden */
    _showAllTokens(): void;
    /** @hidden */
    _hideTokens(): void;
    /**
     * @hidden
     * Check whether user intends to go back to the previous token
     **/
    private _goBackRequested;
    /**
     * @hidden
     * Check whether user intends to go forward to the next token
     **/
    private _goForwardRequested;
    /** @hidden */
    private _getTokensAreaWidthWithoutTokens;
    /** @hidden */
    private _handleArrowLeft;
    /** @hidden */
    private _waitForFocusToDisappear;
    /** @hidden */
    private _handleArrowRight;
    /** @hidden */
    private _collapseTokens;
    /** @hidden */
    private _resetTokens;
    /** @hidden */
    private _getHiddenCozyTokenCount;
    /** @hidden */
    private _handleCozyTokenCount;
    /** @hidden */
    private _makeElementVisible;
    /** @hidden */
    private _unsubscribeClicks;
    /** @hidden */
    private _unsubscribeTokenOutputs;
    /** @hidden */
    private _setupInputKeydownEvent;
    /** @hidden */
    private _setupInputFocusEvent;
    /** @hidden */
    private _makeTokenizerFocusCountAnnouncement;
    /** @hidden Method which handles what happens to token when it is clicked and no key is being held down.*/
    private _basicSelected;
    /** @hidden Restart first and last elements for shift selection.*/
    private resetFirstAndLastElement;
    /** @hidden Method which handles what happens to token when it is clicked and the shift key is being held down.*/
    private _shiftSelected;
    /** @hidden Method which handles what happens to token when it is clicked and the control or meta key is being held down.*/
    private _ctrlSelected;
    /** Get selected and focused tokens */
    private _getActiveTokens;
    /** @hidden */
    private _getFocusedTokenIndex;
    /** @hidden */
    private _isTokenFocused;
    /** @hidden */
    private _isInputFocused;
    /** @hidden */
    private _tokensSelected;
    /** @hidden */
    private _getInputValue;
    /** @hidden */
    private _focusInput;
    /** @hidden */
    private _isControlKey;
    /** @hidden */
    private _listenElementEvents;
    /** @hidden Listen window resize and distribute cards on column change */
    private _listenOnResize;
    /** @hidden */
    private _checkMoreElementVisibility;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<TokenizerComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<TokenizerComponent, "fd-tokenizer", never, { "class": { "alias": "class"; "required": false; }; "disableKeyboardDeletion": { "alias": "disableKeyboardDeletion"; "required": false; }; "compactCollapse": { "alias": "compactCollapse"; "required": false; }; "tokenizerFocusable": { "alias": "tokenizerFocusable"; "required": false; }; "inputValue": { "alias": "inputValue"; "required": false; }; "glyph": { "alias": "glyph"; "required": false; }; "glyphFont": { "alias": "glyphFont"; "required": false; }; "moreTerm": { "alias": "moreTerm"; "required": false; }; "open": { "alias": "open"; "required": false; }; "showOverflowPopover": { "alias": "showOverflowPopover"; "required": false; }; "externalHiddenCount": { "alias": "externalHiddenCount"; "required": false; "isSignal": true; }; }, { "moreClickedEvent": "moreClickedEvent"; }, ["input", "tokenList"], ["fd-token", "[fd-tokenizer-extra]", "[fd-form-control]"], true, never>;
}

/**
 * @deprecated
 * Use direct imports of `TokenComponent`, `TokenizerComponent`, `TokenizerInputDirective` instead
 */
declare class TokenModule {
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<TokenModule, never>;
    static ɵmod: _angular_core.ɵɵNgModuleDeclaration<TokenModule, never, [typeof TokenComponent, typeof TokenizerComponent, typeof TokenizerInputDirective], [typeof TokenComponent, typeof TokenizerComponent, typeof TokenizerInputDirective]>;
    static ɵinj: _angular_core.ɵɵInjectorDeclaration<TokenModule>;
}

export { TokenComponent, TokenModule, TokenizerComponent, TokenizerInputDirective };
