Skip to content

Commit

Permalink
feat(js): expose GetSources type (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Apr 27, 2021
1 parent 6b4bc12 commit 3d1bf26
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/autocomplete-js/src/types/AutocompleteOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export interface OnStateChangeProps<TItem extends BaseItem>
prevState: AutocompleteState<TItem>;
}

export type GetSources<TItem extends BaseItem> = (
params: GetSourcesParams<TItem>
) => MaybePromise<Array<AutocompleteSource<TItem> | boolean | undefined>>;

export interface AutocompleteOptions<TItem extends BaseItem>
extends AutocompleteCoreOptions<TItem>,
Partial<AutocompletePropGetters<TItem>> {
Expand Down Expand Up @@ -55,9 +59,7 @@ export interface AutocompleteOptions<TItem extends BaseItem>
* @link https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries
*/
detachedMediaQuery?: string;
getSources?: (
params: GetSourcesParams<TItem>
) => MaybePromise<Array<AutocompleteSource<TItem> | boolean | undefined>>;
getSources?: GetSources<TItem>;
/**
* The panel's horizontal position.
*
Expand Down

0 comments on commit 3d1bf26

Please sign in to comment.