import { Meta, Canvas, ArgTypes } from '@storybook/addon-docs/blocks'
import * as NaturalLanguageSearchResultsStory from './natural-language-search-results.stories'

<Meta title="pv-form/NaturalLanguageForm/NaturalLanguageSelect/NaturalLanguageSearchResults" />

# NaturalLanguageSearchResults

The type `NaturalLanguageSearchResults` can be passed to `options` of the [NaturalLanguageSelect](/docs/pv-form-naturallanguageform-naturallanguageselect--docs).
The options parameter takes both [NaturalLanguageOption](/docs/pv-form-naturallanguageform-naturallanguageselect-naturallanguageoption--docs) and [NaturalLanguageGroup](/docs/pv-form-naturallanguageform-naturallanguageselect-naturallanguageoption--docs) objects.

This is meant to be used in tandem with `filterMode="external"`, `filterString` and `onFilterStringChange` to allow for custom filtering of the options.

### Type Definition

`NaturalLanguageSearchResults` takes a generic parameter that will define the type of the `value` of the contained `NaturalLanguageOption` and `NaturalLanguageGroup` objects. The default is `string | number`.

```tsx
type NaturalLanguageSearchResults<T> = {
  options: (NaturalLanguageOption<T> | NaturalLanguageGroup<T>)[]
  ...
}
```

<ArgTypes of={NaturalLanguageSearchResultsStory} />
