# TypeaheadOptionSource documentation

## TypeScript declaration

### [TypeaheadOptionSource](<https://github.com/siemens/element/blob/main/projects/element-ng/typeahead/si-typeahead.model.ts#L32-L32>)

**Kind:** type alias

```
import type { TypeaheadOptionSource } from '@siemens/element-ng/typeahead';
```

Defines a source of options for the [SiTypeaheadDirective](<../../directives/SiTypeaheadDirective/index.html#SiTypeaheadDirective>). Use it for server-side pre-filtering.

This function will be called, whenever the search value is updated by the user.

A loading indicator is shown when this function was called until the Observable completes.

```
type TypeaheadOptionSource = (search: string) => Observable<TypeaheadArray>
```

### Types Documentation

### [TypeaheadArray](<https://github.com/siemens/element/blob/main/projects/element-ng/typeahead/si-typeahead.model.ts#L15-L15>)

**Kind:** type alias

```
import type { TypeaheadArray } from '@siemens/element-ng/typeahead';
```

An array of [TypeaheadOption](<index.html#t:TypeaheadOption>).

```
type TypeaheadArray = TypeaheadOption[]
```

### [TypeaheadOption](<https://github.com/siemens/element/blob/main/projects/element-ng/typeahead/si-typeahead.model.ts#L11-L11>)

**Kind:** type alias

```
import type { TypeaheadOption } from '@siemens/element-ng/typeahead';
```

A singular item to be used in the typeahead. Can be either a string or an object.

```
type TypeaheadOption = string | { [key in string | number]: any }
```
