import { ID, MaybeArray } from "../../types/index.mjs"; import { ContextTrinity } from "../createTrinity/index.mjs"; import { SelectionContext, SelectionTicket, SelectionTicketInput } from "../createSelection/index.mjs"; import { MaybeElementRef } from "../toElement/index.mjs"; import { PopoverAdapter } from "../usePopover/adapters/adapter.mjs"; import { PopoverReturn } from "../usePopover/index.mjs"; import { VirtualFocusReturn } from "../useVirtualFocus/index.mjs"; import { ComboboxAdapter, ComboboxAdapterContext, ComboboxAdapterResult } from "./adapters/adapter.mjs"; import { ClientComboboxAdapter, ClientComboboxAdapterOptions } from "./adapters/client.mjs"; import { ServerComboboxAdapter } from "./adapters/server.mjs"; import "./adapters/index.mjs"; import { MaybeRefOrGetter, Ref, ShallowRef } from "vue"; //#region src/composables/createCombobox/index.d.ts interface ComboboxTicketInput extends SelectionTicketInput { /** Rendered option element. Virtual focus reads this instead of querying the document. */ el?: MaybeElementRef; } type ComboboxTicket = SelectionTicket; interface ComboboxOptions { multiple?: MaybeRefOrGetter; mandatory?: MaybeRefOrGetter; disabled?: MaybeRefOrGetter; strict?: MaybeRefOrGetter; error?: MaybeRefOrGetter; errorMessages?: MaybeRefOrGetter | undefined>; adapter?: ComboboxAdapter; /** Positioning engine for the dropdown. @default CSS anchor positioning (`V0PopoverAdapter`) */ positionAdapter?: PopoverAdapter; displayValue?: (value: unknown) => string; id?: string; name?: string; form?: string; } interface ComboboxContext { selection: SelectionContext; popover: PopoverReturn; cursor: VirtualFocusReturn; query: ShallowRef; display: Readonly>; pristine: ShallowRef; filtered: Ref>; isEmpty: Ref; isLoading: ShallowRef; isOpen: ShallowRef; id: string; inputId: string; listboxId: string; descriptionId: string; errorId: string; hasDescription: ShallowRef; hasError: ShallowRef; errors: Readonly>; isValid: Readonly>; inputEl: ShallowRef; multiple: Readonly>; strict: MaybeRefOrGetter; disabled: MaybeRefOrGetter; name: string | undefined; form: string | undefined; open: () => void; close: () => void; toggle: () => void; commit: () => void; select: (id: ID) => void; clear: () => void; } /** * Creates a combobox context that orchestrates selection, popover, virtual * focus, and adapter-based filtering into a single coordinated state. * * @param options - Configuration for selection mode, filtering adapter, and behavior. * @returns A combobox context with all composed systems and action methods. * * @see https://0.vuetifyjs.com/composables/forms/create-combobox * * @example * ```ts * import { createCombobox } from '@vuetify/v0' * * const combobox = createCombobox({ strict: true }) * * combobox.selection.register({ id: 'a', value: 'Apple' }) * combobox.selection.register({ id: 'b', value: 'Banana' }) * * combobox.open() * combobox.select('a') // display → 'Apple', dropdown closes * ``` */ declare function createCombobox(options?: ComboboxOptions): ComboboxContext; /** * Creates a combobox context with dependency injection support. * * @param options - Combobox options plus an optional namespace for DI. * @returns A context trinity: `[useCombobox, provideCombobox, defaultCombobox]`. * * @see https://0.vuetifyjs.com/composables/forms/create-combobox * * @example * ```ts * import { createComboboxContext } from '@vuetify/v0' * * const [useCombobox, provideCombobox, combobox] = createComboboxContext({ * namespace: 'my-combobox', * strict: true, * }) * ``` */ declare function createComboboxContext(_options?: ComboboxOptions & { namespace?: string; }): ContextTrinity; /** * Injects the current combobox context from a parent provider. * * @param namespace - DI namespace. Defaults to `'v0:combobox'`. * @returns The combobox context from the nearest provider. * * @see https://0.vuetifyjs.com/composables/forms/create-combobox * * @example * ```ts * import { useCombobox } from '@vuetify/v0' * * const combobox = useCombobox() * combobox.query.value = 'search term' * ``` */ declare function useCombobox(namespace?: string): ComboboxContext; //#endregion export { ClientComboboxAdapter, type ClientComboboxAdapterOptions, ComboboxAdapter, type ComboboxAdapterContext, type ComboboxAdapterResult, ComboboxContext, ComboboxOptions, ComboboxTicket, ComboboxTicketInput, ServerComboboxAdapter, createCombobox, createComboboxContext, useCombobox };