Skip to content

Commit

Permalink
Allow passing a boolean to the sort field of Options
Browse files Browse the repository at this point in the history
Options.sort can be `false` to disallow sorting (see: LeaVerou/awesomplete#17043)
  • Loading branch information
not-mike-smith authored May 18, 2018
1 parent 680d7ed commit 5bc9242
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions types/awesomplete/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ declare class Awesomplete {
}

declare namespace Awesomplete {
type Suggestion = string | {label: string | any, value: string | any} | [string, string];
type Suggestion = string | { label: string | any, value: string | any } | [string, string];
type SortFunction = (left: number | any[], right: number | any[]) => number;

interface Options {
list?: string | string[] | Element | Array<{ label: string, value: any }> | Array<[string, string]>;
Expand All @@ -51,7 +52,7 @@ declare namespace Awesomplete {
autoFirst?: boolean;
data?(item: Suggestion, input: string): string;
filter?(text: string, input: string): boolean;
sort?(left: number | any[], right: number | any[]): number;
sort?: boolean | SortFunction;
item?(text: string, input: string): HTMLElement;
replace?(text: string): void;
}
Expand Down

0 comments on commit 5bc9242

Please sign in to comment.