infinite-autocomplete
Advanced tools
Comparing version 2.0.0-rc2 to 2.0.0-rc3
@@ -1,3 +0,4 @@ | ||
export as namespace infAutocomplete; | ||
export as namespace Interfaces; | ||
export { InfiniteAutocomplete }; | ||
export { IInputComponent, IOptionsComponent }; | ||
@@ -12,3 +13,3 @@ /////////////////////////////////////////////////////////////////////////////// | ||
*/ | ||
interface InfiniteAutocomplete { | ||
declare class InfiniteAutocomplete { | ||
/** | ||
@@ -18,150 +19,148 @@ * Update configuration on runtime | ||
*/ | ||
setConfig(config:infAutocomplete.InfiniteAutocompleteConfig); | ||
setConfig(config:InfiniteAutocompleteConfig); | ||
} | ||
declare namespace infAutocomplete { | ||
/** | ||
* infinite-autocomplete config interface | ||
* @author Islam Attrash | ||
*/ | ||
interface InfiniteAutocompleteConfig extends InfiniteAutocompleteConfigBase { | ||
/** | ||
* infinite-autocomplete config interface | ||
* @author Islam Attrash | ||
* Chunk fetch size | ||
*/ | ||
interface InfiniteAutocompleteConfig extends InfiniteAutocompleteConfigBase { | ||
/** | ||
* Chunk fetch size | ||
*/ | ||
fetchSize:number; | ||
/** | ||
* Customized input class to override the default input | ||
*/ | ||
customizedInput:IInputCompoenentConstructor; | ||
/** | ||
* Customized options class to override the default input | ||
*/ | ||
customizedOptions:IOptionsComponentConstructor; | ||
} | ||
fetchSize:number; | ||
/** | ||
* Input component constructor interface | ||
* @author Islam Attrash | ||
* Customized input class to override the default input | ||
*/ | ||
interface IInputCompoenentConstructor { | ||
new():IInputComponent; | ||
} | ||
customizedInput:IInputCompoenentConstructor; | ||
/** | ||
* Input component interface | ||
* @author Islam Attrash | ||
* Customized options class to override the default input | ||
*/ | ||
interface IInputComponent { | ||
/** | ||
* Input component template string | ||
* @default `<input />` | ||
*/ | ||
render():string; | ||
/** | ||
* onInputChange event handler | ||
* @param inputElement - HTMLInputElement | ||
* @param value - input text value | ||
*/ | ||
onInputChange?(inputElement:HTMLInputElement, value:string); | ||
} | ||
customizedOptions:IOptionsComponentConstructor; | ||
} | ||
/** | ||
* Input component constructor interface | ||
* @author Islam Attrash | ||
*/ | ||
interface IInputCompoenentConstructor { | ||
new():IInputComponent; | ||
} | ||
/** | ||
* Input component interface | ||
* @author Islam Attrash | ||
*/ | ||
interface IInputComponent { | ||
/** | ||
* Options component constructor interface | ||
* @author Islam Attrash | ||
* Input component template string | ||
* @default `<input />` | ||
*/ | ||
interface IOptionsComponentConstructor { | ||
new():IOptionsComponent; | ||
} | ||
render():string; | ||
/** | ||
* onInputChange event handler | ||
* @param inputElement - HTMLInputElement | ||
* @param value - input text value | ||
*/ | ||
onInputChange?(inputElement:HTMLInputElement, value:string); | ||
} | ||
/** | ||
* Options component constructor interface | ||
* @author Islam Attrash | ||
*/ | ||
interface IOptionsComponentConstructor { | ||
new():IOptionsComponent; | ||
} | ||
/** | ||
* infinite-autocomplete config base interface | ||
* @author Islam Attrash | ||
*/ | ||
interface InfiniteAutocompleteConfigBase { | ||
/** | ||
* infinite-autocomplete config base interface | ||
* @author Islam Attrash | ||
* data static source | ||
*/ | ||
interface InfiniteAutocompleteConfigBase { | ||
/** | ||
* data static source | ||
*/ | ||
data?:Array<IOption>; | ||
/** | ||
* on-select event output handler when choosing an option | ||
*/ | ||
onSelect?:Function; | ||
/** | ||
* max height for the options | ||
*/ | ||
maxHeight?:string; | ||
/** | ||
* data dynamic api source | ||
*/ | ||
getDataFromApi?(text:string, page:number, fetchSize:number):Promise<Array<any>>; | ||
} | ||
data?:Array<IOption>; | ||
/** | ||
* on-select event output handler when choosing an option | ||
*/ | ||
onSelect?:Function; | ||
/** | ||
* max height for the options | ||
*/ | ||
maxHeight?:string; | ||
/** | ||
* data dynamic api source | ||
*/ | ||
getDataFromApi?(text:string, page:number, fetchSize:number):Promise<Array<any>>; | ||
} | ||
/** | ||
* infinite-autocomplete config params interface | ||
* @author Islam Attrash | ||
*/ | ||
interface InfiniteAutocompleteConfigParams extends InfiniteAutocompleteConfigBase { | ||
/** | ||
* infinite-autocomplete config params interface | ||
* @author Islam Attrash | ||
* Chunk fetch size | ||
*/ | ||
interface InfiniteAutocompleteConfigParams extends InfiniteAutocompleteConfigBase { | ||
/** | ||
* Chunk fetch size | ||
*/ | ||
fetchSize?:number, | ||
/** | ||
* Customized input class to override the default input | ||
*/ | ||
customizedInput?:IInputCompoenentConstructor; | ||
/** | ||
* Customized options class to override the default input | ||
*/ | ||
customizedOptions?:IOptionsComponentConstructor; | ||
} | ||
fetchSize?:number, | ||
/** | ||
* Customized input class to override the default input | ||
*/ | ||
customizedInput?:IInputCompoenentConstructor; | ||
/** | ||
* Customized options class to override the default input | ||
*/ | ||
customizedOptions?:IOptionsComponentConstructor; | ||
} | ||
/** | ||
* Option model interface | ||
* @author Islam Attrash | ||
*/ | ||
interface IOption { | ||
/** | ||
* Option model interface | ||
* @author Islam Attrash | ||
* Text for the option | ||
*/ | ||
interface IOption { | ||
/** | ||
* Text for the option | ||
*/ | ||
text: string; | ||
/** | ||
* The option value | ||
*/ | ||
value: any; | ||
/** | ||
* Any other OPTIONAL dynamic user properties | ||
*/ | ||
[key: string]: any; | ||
} | ||
text: string; | ||
/** | ||
* The option value | ||
*/ | ||
value: any; | ||
/** | ||
* Any other OPTIONAL dynamic user properties | ||
*/ | ||
[key: string]: any; | ||
} | ||
/** | ||
* Options component interface | ||
* @author Islam Attrash | ||
*/ | ||
interface IOptionsComponent { | ||
/** | ||
* Options component interface | ||
* @author Islam Attrash | ||
* The list element tag selector | ||
* This value can be a tag string `ul` `div` `ol` that indicates tag name, | ||
* or it can be a class selector (or id selector) `.myClass`/`#myId` which is | ||
* returned in @render method template | ||
* @default `ul` | ||
*/ | ||
interface IOptionsComponent { | ||
/** | ||
* The list element tag selector | ||
* This value can be a tag string `ul` `div` `ol` that indicates tag name, | ||
* or it can be a class selector (or id selector) `.myClass`/`#myId` which is | ||
* returned in @render method template | ||
* @default `ul` | ||
*/ | ||
listElementSelector:string; | ||
/** | ||
* Options component template string | ||
* @default `<ul></ul>` base list tag | ||
*/ | ||
render():string; | ||
/** | ||
* Option row template string in Options component | ||
* @param option | ||
* @default `<li> ${value} </li>` | ||
* @requires one base HTML Element | ||
*/ | ||
renderOption(option:IOption):string; | ||
} | ||
} | ||
listElementSelector:string; | ||
/** | ||
* Options component template string | ||
* @default `<ul></ul>` base list tag | ||
*/ | ||
render():string; | ||
/** | ||
* Option row template string in Options component | ||
* @param option | ||
* @default `<li> ${value} </li>` | ||
* @requires one base HTML Element | ||
*/ | ||
renderOption(option:IOption):string; | ||
} |
{ | ||
"name": "infinite-autocomplete", | ||
"version": "2.0.0-rc2", | ||
"version": "2.0.0-rc3", | ||
"description": "lightweight-infinite-autocomplete", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
169295
1932