import { type AutocompleteResult, type CompletedParamState, type CustomFieldsReport, type IdentifiedParamState, type Product, type Segment, type SkippedParamState, type Suggestion, type SuggestionOption } from "@magicx-eng/ai-autocomplete-vanilla"; import { type Observable } from "rxjs"; import type { AIAutocompleteControllerOptions, AIAutocompleteControllerState, AIAutocompleteControllerUpdate, AIAutocompleteDropdownState } from "../shared/types"; /** * Tier 2 logic surface for `@magicx-eng/ai-autocomplete-angular` — the Angular * equivalent of React's `useAIAutocomplete()` hook. Wraps a headless * `@magicx-eng/ai-autocomplete-vanilla` core and exposes its state as RxJS * observables plus thin action methods. * * The controller is consumer-managed — the consumer creates it * with `new`, holds the reference, and **must call `destroy()`** in their * own `ngOnDestroy`. The Tier 1 `` component does this * automatically; Tier 2 consumers do not get auto-cleanup. * * @public */ export declare class AIAutocompleteController { private readonly core; private readonly rawState$; private readonly optionsPosition$; private readonly unsubscribeCore; private isDestroyed; /** Plain-text content of the editor. */ readonly text$: Observable; /** Completed (bold) params currently in the editor. */ readonly completedParams$: Observable; /** * Suggestions the user dismissed with the skip key (→). Nothing renders * them; they exist so a hand-rolled submit can pass them to * `buildSubmitResult` and carry the same `text: "skipped"` entries the * SDK's own requests do. */ readonly skippedParams$: Observable; /** * Params the server identified in the user's own words. Already rendered * through `segments$`; exposed so a hand-rolled submit can pass them to * `buildSubmitResult` and report the same `identified_params` the SDK's * own results carry. */ readonly identifiedParams$: Observable; /** Actionable suggestion pills (first one is the active pill). */ readonly suggestionPills$: Observable; /** Text + completed-param segments for rendering the editor body. */ readonly segments$: Observable; /** ID of the most-recently-promoted param (drives shimmer animation). */ readonly newParamId$: Observable; /** All suggestions from the server (including non-actionable ones). */ readonly suggestions$: Observable; /** * What the product strip shows: the items the latest `/suggest` response * reported as matching the query, or — with `products` configured on the * controller — the results of that custom search. */ readonly products$: Observable; /** * The catalog grounding report the latest response carried, or null when it * carried none: which of the query's constraints the catalog applied, which * it dropped, and how many items (and which) the applied ones left * standing. Null is "no news", not an empty catalog. */ readonly customFields$: Observable; /** Currently highlighted dropdown option index. -1 = none. */ readonly activeIndex$: Observable; /** * UI-visible loading flag — suppressed during the post-select press * animation and during re-edit (cached options stay visible there). Use * this instead of the raw core state for any loading-skeleton binding. */ readonly isLoading$: Observable; /** Server-reported "query is complete" flag. */ readonly isReady$: Observable; /** Whether the editor currently has focus. */ readonly isFocused$: Observable; /** Whether the dropdown should currently be visible. */ readonly isDropdownOpen$: Observable; /** * Whether the active (leading) pill should render selected (full opacity) * rather than the de-emphasized `first` tier. Auto trigger ⇒ true only while * a dropdown option is highlighted; manual ⇒ true once the pill is tapped. */ readonly isActivePillSelected$: Observable; /** Server-suggested placeholder text for the editor. */ readonly placeholderText$: Observable; /** Last fetch error, or null. */ readonly error$: Observable; /** Param currently being re-edited, or null. */ readonly editingParam$: Observable; /** Plain-text offset where the edit region starts, or null. */ readonly editingAnchor$: Observable; /** Live caret offset within the editor. */ readonly caretOffset$: Observable; /** * Snapshot of every public field in one object. Convenient for * `*ngIf="ctrl.state$ | async as state"` templating — aliases all fields * under a single subscription instead of multiple `| async` pipes. */ readonly state$: Observable; /** * Composite state for the dropdown view. Tier 2 consumers spread this into * ``; Tier 1 uses the same shape internally. */ readonly dropdown$: Observable; /** * Throws if invoked outside a browser environment. For SSR / Angular * Universal, gate construction with `isPlatformBrowser`. */ constructor(opts?: AIAutocompleteControllerOptions); /** Stable ARIA listbox ID for the dropdown. Pass to `