import { FocusOrigin } from '@angular/cdk/a11y';
import { AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, QueryList } from '@angular/core';
import { IFocusableOption } from '@koobiq/cdk/a11y';
import { KbqColorDirective, KbqTitleTextRef } from '@koobiq/components/core';
import { KbqIcon } from '@koobiq/components/icon';
import { Subject } from 'rxjs';
import * as i0 from "@angular/core";
import * as i1 from "@koobiq/components/core";
import * as i2 from "@angular/cdk/drag-drop";
/**
 * Event object emitted by KbqTag.
 */
export type KbqTagEvent = {
    tag: KbqTag;
};
/**
 * Event object emitted by KbqTag when the tag is edited.
 */
export declare class KbqTagEditChange {
    readonly tag: KbqTag;
    readonly type: 'start' | 'submit' | 'cancel';
    readonly reason: string;
    constructor(tag: KbqTag, type: 'start' | 'submit' | 'cancel', reason: string);
}
/** Event object emitted by KbqTag when selected or deselected. */
export declare class KbqTagSelectionChange {
    source: KbqTag;
    selected: boolean;
    isUserInput: boolean;
    constructor(source: KbqTag, selected: boolean, isUserInput?: boolean);
}
/**
 * Event object emitted when the KbqTag is focused.
 */
export type KbqTagFocusEvent = KbqTagEvent & {
    origin: FocusOrigin;
};
/**
 * Object passed to the drag data event when a tag is being dragged.
 *
 * @docs-private
 */
export type KbqTagDragData = KbqTagEvent;
/**
 * Dummy directive to add CSS class to tag avatar.
 * @docs-private
 */
export declare class KbqTagAvatar {
    static ɵfac: i0.ɵɵFactoryDeclaration<KbqTagAvatar, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<KbqTagAvatar, "kbq-tag-avatar, [kbqTagAvatar]", never, {}, {}, never, never, false, never>;
}
/**
 * Dummy directive to add CSS class to tag trailing icon.
 * @docs-private
 */
export declare class KbqTagTrailingIcon {
    static ɵfac: i0.ɵɵFactoryDeclaration<KbqTagTrailingIcon, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<KbqTagTrailingIcon, "kbq-tag-trailing-icon, [kbqTagTrailingIcon]", never, {}, {}, never, never, false, never>;
}
/**
 * Directive to add submit behavior for the editable tag.
 */
export declare class KbqTagEditSubmit {
    /** @docs-private */
    protected readonly tag: KbqTag;
    static ɵfac: i0.ɵɵFactoryDeclaration<KbqTagEditSubmit, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<KbqTagEditSubmit, "[kbqTagEditSubmit]", ["kbqTagEditSubmit"], {}, {}, never, never, true, never>;
}
/**
 * Directive to add input behavior for the editable tag.
 */
export declare class KbqTagEditInput {
    private readonly tag;
    /** @docs-private */
    protected handleKeydown(event: KeyboardEvent): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<KbqTagEditInput, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<KbqTagEditInput, "[kbqTagEditInput]", ["kbqTagEditInput"], {}, {}, never, never, true, [{ directive: typeof i1.KbqFieldSizingContent; inputs: {}; outputs: {}; }]>;
}
export declare class KbqTag extends KbqColorDirective implements IFocusableOption, OnDestroy, KbqTitleTextRef, AfterContentInit, AfterViewInit {
    changeDetectorRef: ChangeDetectorRef;
    private readonly focusMonitor;
    private readonly tagList;
    private readonly drag;
    private readonly destroyRef;
    /** @docs-private */
    readonly elementRef: ElementRef<HTMLElement>;
    /**
     * Emits when the tag is focused.
     *
     * @docs-private
     */
    readonly onFocus: Subject<KbqTagFocusEvent>;
    /**
     * Emits when the tag is blurred.
     *
     * @docs-private
     */
    readonly onBlur: Subject<KbqTagEvent>;
    /** @docs-private */
    readonly nativeElement: HTMLElement;
    /**
     * Whether the tag has focus.
     *
     * @docs-private
     */
    hasFocus: boolean;
    /** Whether the tag is editable. */
    get editable(): boolean;
    set editable(value: boolean);
    private _editable;
    /** Whether the tag edits can't be submitted. */
    preventEditSubmit: boolean;
    private readonly editInputElementRef;
    /**
     * Emits event when the tag is edited.
     */
    readonly editChange: EventEmitter<KbqTagEditChange>;
    /**
     * @docs-private
     */
    protected readonly editing: import("@angular/core").WritableSignal<boolean>;
    /**
     * @docs-private
     */
    readonly textElement: ElementRef<HTMLSpanElement>;
    contentChildren: QueryList<KbqIcon>;
    /** The tag avatar */
    avatar: KbqTagAvatar;
    /** The tag's trailing icon. */
    trailingIcon: KbqTagTrailingIcon;
    /** The tag's remove toggler. */
    removeIcon: KbqTagRemove;
    /** Emitted when the tag is selected or deselected. */
    readonly selectionChange: EventEmitter<KbqTagSelectionChange>;
    /** Emitted when the tag is destroyed. */
    readonly destroyed: EventEmitter<KbqTagEvent>;
    /** Emitted when a tag is to be removed. */
    readonly removed: EventEmitter<KbqTagEvent>;
    /** Whether the tag is selected. */
    get selected(): boolean;
    set selected(value: boolean);
    private _selected;
    /** The value of the tag. Defaults to the content inside `<kbq-tag>` tags. */
    get value(): any;
    set value(value: any);
    private _value;
    /**
     * Whether the tag is selectable.
     */
    get selectable(): boolean;
    set selectable(value: boolean);
    private _selectable;
    /**
     * Determines whether the tag is removable.
     */
    get removable(): boolean;
    set removable(value: boolean);
    private _removable;
    get tabindex(): any;
    set tabindex(value: any);
    private _tabindex;
    /**
     * Whether the tag is disabled.
     */
    get disabled(): boolean;
    set disabled(value: boolean);
    private _disabled;
    /**
     * Whether the tag is draggable.
     *
     * @docs-private
     */
    protected get draggable(): boolean;
    constructor(changeDetectorRef: ChangeDetectorRef);
    ngAfterContentInit(): void;
    ngAfterViewInit(): void;
    ngOnDestroy(): void;
    /** @docs-private */
    addClassModificatorForIcons(): void;
    /** @docs-private */
    addHostClassName(): void;
    /**
     * Selects the tag.
     */
    select(): void;
    /**
     * Deselects the tag.
     */
    deselect(): void;
    /**
     * Selects the tag and emits event with isUserInput flag.
     *
     * @docs-private
     */
    selectViaInteraction(): void;
    /**
     * Toggles the current selected state of the tag.
     */
    toggleSelected(isUserInput?: boolean): boolean;
    /** Focuses the tag. */
    focus(): void;
    /**
     * Allows for programmatic removal of the tag. Called by the KbqTagList when the DELETE or
     * BACKSPACE keys are pressed.
     *
     * Informs any listeners of the removal request. Does not remove the tag from the DOM.
     */
    remove(): void;
    /** @docs-private */
    handleClick(event: MouseEvent): void;
    /** @docs-private */
    handleKeydown(event: KeyboardEvent): void;
    /** @docs-private */
    blur(): void;
    /** @docs-private */
    protected handleDblClick(event: MouseEvent): void;
    private startEditing;
    /** @docs-private */
    cancelEditing(reason: string): void;
    /** @docs-private */
    submitEditing(reason: string): void;
    /**
     * Sets the selected state of the tag.
     *
     * @docs-private
     */
    setSelectedState(selected: boolean, options?: Partial<{
        isUserInput: boolean;
        emitEvent: boolean;
    }>): void;
    private setupDragInitialProperties;
    private syncDragDisabledState;
    private setupFocusMonitor;
    static ɵfac: i0.ɵɵFactoryDeclaration<KbqTag, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<KbqTag, "kbq-tag, [kbq-tag], kbq-basic-tag, [kbq-basic-tag]", ["kbqTag"], { "editable": { "alias": "editable"; "required": false; }; "preventEditSubmit": { "alias": "preventEditSubmit"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "value": { "alias": "value"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "editChange": "editChange"; "selectionChange": "selectionChange"; "destroyed": "destroyed"; "removed": "removed"; }, ["editInputElementRef", "avatar", "trailingIcon", "removeIcon", "contentChildren"], ["[kbq-icon]:not([kbqTagRemove]):not([kbqTagEditSubmit])", "[kbqTagEditInput]", "*", "[kbqTagEditSubmit]", "[kbqTagRemove]"], false, [{ directive: typeof i2.CdkDrag; inputs: {}; outputs: {}; }]>;
    static ngAcceptInputType_editable: unknown;
    static ngAcceptInputType_preventEditSubmit: unknown;
    static ngAcceptInputType_selected: unknown;
    static ngAcceptInputType_selectable: unknown;
    static ngAcceptInputType_removable: unknown;
    static ngAcceptInputType_disabled: unknown;
}
/**
 *
 * Example:
 *
 *     `<kbq-tag>
 *       <kbq-icon kbqTagRemove>cancel</kbq-icon>
 *     </kbq-tag>`
 *
 * You *may* use a custom icon, but you may need to override the `kbq-tag-remove` positioning
 * styles to properly center the icon within the tag.
 */
export declare class KbqTagRemove {
    protected parentTag: KbqTag;
    constructor(parentTag: KbqTag);
    /** @docs-private */
    focus(event: FocusEvent): void;
    /**
     * Calls the parent tag's public `remove()` method if applicable.
     *
     * @docs-private
     */
    handleClick(event: Event): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<KbqTagRemove, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<KbqTagRemove, "[kbqTagRemove]", never, {}, {}, never, never, false, never>;
}
