From 3d1bf269c02a7e35b100dda0b1d148805731a3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= <20689156+shortcuts@users.noreply.github.com> Date: Tue, 27 Apr 2021 13:02:21 +0200 Subject: [PATCH] feat(js): expose `GetSources` type (#551) --- packages/autocomplete-js/src/types/AutocompleteOptions.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/autocomplete-js/src/types/AutocompleteOptions.ts b/packages/autocomplete-js/src/types/AutocompleteOptions.ts index b76abbc89..f25e10699 100644 --- a/packages/autocomplete-js/src/types/AutocompleteOptions.ts +++ b/packages/autocomplete-js/src/types/AutocompleteOptions.ts @@ -27,6 +27,10 @@ export interface OnStateChangeProps prevState: AutocompleteState; } +export type GetSources = ( + params: GetSourcesParams +) => MaybePromise | boolean | undefined>>; + export interface AutocompleteOptions extends AutocompleteCoreOptions, Partial> { @@ -55,9 +59,7 @@ export interface AutocompleteOptions * @link https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries */ detachedMediaQuery?: string; - getSources?: ( - params: GetSourcesParams - ) => MaybePromise | boolean | undefined>>; + getSources?: GetSources; /** * The panel's horizontal position. *