# Search

TypeScript source: `hooks/search.ts`

## Types

### UseFlatSearchArgs

Source: `hooks/search.ts:6`

Options for reading and mutating flat URL search parameters.

#### Members

| Name | Type | Description |
| --- | --- | --- |
| `arrayFields?` | `string[]` | Search keys that should be parsed as comma-separated arrays. |
| `defaultInit?` | `Record<string, string | string[]>` | Default search values returned when the URL does not contain a key. |

## Functions

### useFlatSearch

Source: `hooks/search.ts:32`

```ts
(__namedParameters: UseFlatSearchArgs) => { search: { [key: string]: string | string[] }; updateSearch: (key: string, value: string | number | string[] | number[] | null) => void }
```

Reads URL search params into a flat object and exposes a helper for updating one key at a time.

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `__namedParameters` | `UseFlatSearchArgs` |  |
