UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

62 lines (61 loc) 2.08 kB
/** * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ import { type Locale } from 'ckeditor5/src/utils.js'; import { ButtonView, IconView, type InputTextView, LabeledFieldView } from 'ckeditor5/src/ui.js'; /** * A specialized search input view for AI context resources. * * This view extends the standard labeled field view to provide search functionality * with an icon, reset button, and proper event handling for resource filtering. * It maintains the current search query and provides immediate search feedback. */ export declare class AIChatContextResourcesSearchInputView extends LabeledFieldView<InputTextView> { /** * The loupe icon displayed next to the search input field. * Only present when the view is configured to show the search icon. */ iconView?: IconView; /** * The button that clears the search input and refocuses the field. * Only present when the view is configured to show the reset button. */ resetButtonView?: ButtonView; /** * Creates a new AI context resources search input view. * * @param locale The locale instance for internationalization */ constructor(locale: Locale); /** * Resets the search field to its default state and triggers an empty search. */ reset(): void; /** * Triggers a search with the given query string. * * @param query The search query string */ search(query: string): void; /** * Gets the current search query value. * * @returns The current search query string, or empty string if no query */ getQuery(): string; } /** * Event fired when the search input is reset. */ export type AIChatContextResourcesSearchInputViewResetEvent = { name: 'reset'; args: []; }; /** * Event fired when a search is triggered. */ export type AIChatContextResourcesSearchInputViewSearchEvent = { name: 'search'; args: [query: string]; };