Skip to content

Commit

Permalink
Conditionally type WPCompleter.options
Browse files Browse the repository at this point in the history
  • Loading branch information
chad1008 committed Feb 13, 2023
1 parent 1bd1cfc commit 4bb27ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/components/src/autocomplete/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export type WPCompleter< TCompleterOption = any > = {
* Options may be of any type or shape. The completer declares how those
* options are rendered and what their completions should be when selected.
*/
options: Array< TCompleterOption > | GetOptions;
options: TCompleterOption extends Function
? GetOptions< TCompleterOption >
: Array< TCompleterOption >;
/**
* A function that returns the keywords for the specified option.
*/
Expand Down

0 comments on commit 4bb27ee

Please sign in to comment.