Skip to content

Commit

Permalink
Simplify/inline getOptionCompletion type declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
chad1008 committed Feb 9, 2023
1 parent 9138dd2 commit 1435169
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/components/src/autocomplete/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ export type OptionCompletion = {
value: string | WPElement;
};

type getOptionCompletion< TCompleterOption = any > = (
option: TCompleterOption,
query: string
) => OptionCompletion | OptionCompletion[ 'value' ];

type OptionLabel = string | WPElement | Array< string | WPElement >;
export type KeyedOption = {
key: string;
Expand Down Expand Up @@ -79,7 +74,10 @@ export type WPCompleter< TCompleterOption = any > = {
* treated by returning an object with `action` and `value` properties. The
* `action` declares what should be done with the `value`.
*/
getOptionCompletion?: getOptionCompletion;
getOptionCompletion?: (
option: TCompleterOption,
query: string
) => OptionCompletion | OptionCompletion[ 'value' ];
/**
* A function that returns an array of items to be displayed in the
* Autocomplete UI. These items have uniform shape and have been filtered by
Expand Down

0 comments on commit 1435169

Please sign in to comment.