# Composite.typeahead

Returns the first enabled item id in DOM order whose textValue starts with the query.

## Signatures

```ts
export declare function typeahead<Item extends Collection.Item<unknown, object>>(items: readonly Item[], search: string, text?: (item: Item) => string, includeDisabled?: boolean): string | null;
```

## Why

Separating this deterministic policy from event wiring lets applications test it directly and
reuse it in custom composites.

## Ownership and lifetime

This is a synchronous calculation. It acquires no resources and does not mutate the input array,
state, event, or DOM.

## Examples

```ts
import * as Composite from "@typed/ui/Composite";

const id = Composite.typeahead([{ id: "alpha", textValue: "Alpha" }], "al");
```
