diff --git a/CHANGELOG.md b/CHANGELOG.md index 023f0f5b9f8..30fda8c0b68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Added `markdownFormatProps` prop to `EuiMarkdownEditor` to extend the props passed to the rendered `EuiMarkdownFormat` ([#4663](https://github.com/elastic/eui/pull/4663)) - Added optional virtualized line rendering to `EuiCodeBlock` ([#4952](https://github.com/elastic/eui/pull/4952)) - Added `current` as a `status` of `EuiHorizontalStep` ([#4911](https://github.com/elastic/eui/pull/4911)) +- Exported `onChange` type for `EuiSearchBar` ([#4968](https://github.com/elastic/eui/pull/4968)) **Bug fixes** diff --git a/src/components/search_bar/index.ts b/src/components/search_bar/index.ts index 89925c6e7a7..79e8be52f84 100644 --- a/src/components/search_bar/index.ts +++ b/src/components/search_bar/index.ts @@ -9,6 +9,7 @@ export { EuiSearchBar, EuiSearchBarProps, + EuiSearchBarOnChangeArgs, QueryType, Query, Ast, diff --git a/src/components/search_bar/search_bar.tsx b/src/components/search_bar/search_bar.tsx index 3658b654049..81971d2c942 100644 --- a/src/components/search_bar/search_bar.tsx +++ b/src/components/search_bar/search_bar.tsx @@ -33,8 +33,10 @@ interface ArgsWithError { error: Error; } +export type EuiSearchBarOnChangeArgs = ArgsWithQuery | ArgsWithError; + export interface EuiSearchBarProps extends CommonProps { - onChange?: (args: ArgsWithQuery | ArgsWithError) => void | boolean; + onChange?: (args: EuiSearchBarOnChangeArgs) => void | boolean; /** The initial query the bar will hold when first mounted