import * as _angular_core from '@angular/core'; import { TemplateRef, OnInit, OnDestroy } from '@angular/core'; import * as i1 from '@angular/common'; import * as i2 from '@angular/forms'; import * as i3 from 'ngx-tethys/popover'; import { ThyPopoverRef, ThyPopoverConfig } from 'ngx-tethys/popover'; import * as i4 from 'ngx-tethys/list'; import { ThySelectionListChange } from 'ngx-tethys/list'; import * as i5 from 'ngx-tethys/loading'; import { Observable, Subject } from 'rxjs'; interface MentionDefaultDataItem { name?: string; } /** * @public * @order 20 */ interface Mention { /** * Mention 触发字符,比如 @ # */ trigger: string; /** * Mention 选择数据源 * @type T[] */ data: T[]; /** * Mention 列表自定义模板 * @type TemplateRef<{ data: T[] }> */ suggestionsTemplateRef?: TemplateRef<{ data: T[]; }>; /** * 限制最大显示多少条数据 */ limit?: number; /** * 设置未匹配到数据时是否自动关闭 * @description.en-us content not found closed auto */ autoClose?: boolean; /** * 设置弹出Popover Class */ popoverClass?: string; /** * 显示选择项的模板,默认只显示 name */ displayTemplateRef?: TemplateRef; /** * 未匹配到数据的内容 */ emptyText?: string; /** * 插入字符转换器,默认插入 ${trigger}${name} */ insertTransform?: (item: T) => string; /** * 搜索函数,支持返回异步Observable数据 * @type (term: string, items?: T[]) => T[] | Observable */ search?: (term: string, items?: T[]) => T[] | Observable; } interface MentionSuggestionSelectEvent { event: Event; item: T; } interface SeekQueryResult { term: string; start: number; end: number; } /** * @private */ declare class ThyMentionSuggestions implements OnInit, OnDestroy { readonly mention: _angular_core.InputSignal | undefined>; data: _angular_core.WritableSignal; suggestionSelect$: Subject>; debounce: number; loadingDone: _angular_core.WritableSignal; private search$; private elementRef; private injector; private popoverRef; constructor(); ngOnInit(): void; search(query: SeekQueryResult): void; select(item: TItem, event: Event): void; selectionChange(event: ThySelectionListChange): void; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration, "thy-mention-suggestions", never, { "mention": { "alias": "mention"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } /** * @name thyMention * @order 10 */ declare class ThyMentionDirective implements OnInit, OnDestroy { private elementRef; private thyPopover; private ngControl; private adapter; openedSuggestionsRef?: ThyPopoverRef | null; /** * 提及输入配置参数,同时支持多个提及规则 * @type Mention[] */ readonly thyMention: _angular_core.InputSignal[]>; /** * Popover 弹出层参数配置 */ readonly thyPopoverConfig: _angular_core.InputSignal | undefined>; /** * 选择后的回调函数 */ readonly thySelectSuggestion: _angular_core.OutputEmitterRef>; get isOpened(): boolean; mentions: _angular_core.Signal<(Partial> & Mention)[]>; private destroy$; private openedSuggestionsRef$; constructor(); ngOnInit(): void; ngOnDestroy(): void; onClick(event: Event): void; onInput(event: Event): void; private lookup; private openSuggestions; private closeSuggestions; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class ThyMentionModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } export { ThyMentionDirective, ThyMentionModule, ThyMentionSuggestions }; export type { Mention, MentionDefaultDataItem, MentionSuggestionSelectEvent };