import { type OnDestroy, type OnInit } from "@angular/core"; import { type ControlValueAccessor } from "@angular/forms"; import type { AIAutocompleteController } from "../controller/ai-autocomplete.controller"; import * as i0 from "@angular/core"; /** * Tier 2 input binder. Attach to a ` * ``` * * The directive wires the input's events (input/keydown/focus/blur) to the * controller, mirrors controller state into ARIA attributes * (`role="combobox"`, `aria-expanded`, `aria-activedescendant`, * `aria-autocomplete`, `aria-controls`), and implements * {@link ControlValueAccessor} so the host element participates in Reactive * Forms out of the box: * * ```html * * ``` * * Per the React hook's behavior, the first typed character is auto-capitalized * — typing "h" becomes "H" before being forwarded to the controller. The * cursor position is preserved across that rewrite. * * @public */ export declare class AIAutocompleteInputDirective implements OnInit, OnDestroy, ControlValueAccessor { /** * The {@link AIAutocompleteController} that owns the autocomplete state. * Required. The directive throws on init if this is missing. */ controller: AIAutocompleteController; private readonly el; private readonly renderer; private readonly destroy$; private onChangeFn; private onTouchedFn; private lastInputAt; private lastSeenParamId; private pendingWriteValue; ngOnInit(): void; ngOnDestroy(): void; /** * Auto-capitalizes the first character on the user's first keystroke so the * server receives "Create" instead of "create". Matches React's * `handleChange` in `useAIAutocomplete`. Skipped during IME composition so * we don't disrupt multi-keystroke input methods (Pinyin, Hangul, etc.). */ onInput(event: Event): void; onKeyDown(event: KeyboardEvent): void; /** * Caret moved by something other than typing — arrow keys, Home/End, or a * mouse click/drag (keyup + mouseup). Forward the new offset so the core can * re-evaluate the caret-at-end dropdown gate (and exit re-edit if the caret * left the region). We deliberately do NOT listen for the `select` event: * programmatic `setSelectionRange` calls (the text$ writeback, the post-select * caret reposition) fire it in jsdom/some browsers, which would re-enter here * and clobber `caretOffset`. `keyup`/`mouseup` only fire for real user input. * Skipped right after an `input` event, where the caret is already handled by * `handleCaretAfterInput` above. */ onCaretMove(): void; onFocus(): void; onBlur(): void; writeValue(value: string | null): void; registerOnChange(fn: (value: string) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(disabled: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } //# sourceMappingURL=ai-autocomplete-input.directive.d.ts.map