Update types for 3.0.0

This commit is contained in:
Zack Schuster 2017-08-04 14:49:29 -07:00
parent 791eb9a95b
commit 4d2caa129c

45
index.d.ts vendored
View file

@ -3,7 +3,7 @@ declare module "choices.js" {
passedElement: Element;
constructor(element?: string | HTMLElement | HTMLCollectionOf<HTMLElement> | NodeList, userConfig?: Choices.Options);
new(element?: string | HTMLElement | HTMLCollectionOf<HTMLElement> | NodeList, userConfig?: Choices.Options): this;;
new(element?: string | HTMLElement | HTMLCollectionOf<HTMLElement> | NodeList, userConfig?: Choices.Options): this;
/**
* Initialise Choices
@ -272,6 +272,14 @@ declare module "choices.js" {
*/
choices?: any[];
/**
* The amount of choices to be rendered within the dropdown list ("-1" indicates no limit). This is useful if you have a lot of choices where it is easier for a user to use the search area to find a choice.
*
* Input types affected: select-one, select-multiple
* @default -1
*/
renderChoiceLimit?: number;
/**
* The amount of items a user can input/select ("-1" indicates no limit).
*
@ -436,7 +444,15 @@ declare module "choices.js" {
/**
* Whether the input should show a placeholder. Used in conjunction with placeholderValue. If placeholder is set to true and no value is passed to placeholderValue, the passed input's placeholder attribute will be used as the placeholder value.
*
* Input types affected: text, select-one, select-multiple
* Note: For single select boxes, the recommended way of adding a placeholder is as follows:
* <select>
* <option placeholder>This is a placeholder</option>
* <option>...</option>
* <option>...</option>
* <option>...</option>
* </select>
*
* Input types affected: text, select-multiple
* @default true
*/
placeholder?: boolean;
@ -444,11 +460,19 @@ declare module "choices.js" {
/**
* The value of the inputs placeholder.
*
* Input types affected: text, select-one, select-multiple
* Input types affected: text, select-multiple
* @default null
*/
placeholderValue?: string;
/**
* The value of the search inputs placeholder.
*
* Input types affected: select-one
* @default null
*/
searchPlaceholderValue?: string;
/**
* Prepend a value to each item added/selected.
*
@ -603,6 +627,11 @@ declare module "choices.js" {
*/
groupHeading?: string;
/**
* @default 'choices__placeholder'
*/
placeholder?: string;
/**
* @default 'choices__button'
*/
@ -647,6 +676,16 @@ declare module "choices.js" {
* @default 'is-loading'
*/
loadingState?: string;
/**
* @default 'has-no-results'
*/
noResults?: string;
/**
* @default 'has-no-choices'
*/
noChoices?: string;
};
/**