dictionary-typeahead
Advanced tools
Comparing version 3.0.2 to 3.0.3
{ | ||
"name": "dictionary-typeahead", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "typeahead that utilizes a custom dictionary", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -15,3 +15,3 @@ #dictionary-typeahead | ||
####ES6 | ||
####ES2016 | ||
@@ -24,7 +24,11 @@ ``` | ||
const dictionary = [ | ||
"Super cool", | ||
"Super", | ||
"Typeahead", | ||
"Type Ahead", | ||
"Auto Complete is cool" | ||
"Yellowstone", | ||
"Yellowstone National Park", | ||
"Grand Canyon", | ||
"Arches", | ||
"Arches National Park", | ||
"Yosemite National Park", | ||
"Yosemite", | ||
"INYO National Park", | ||
"INYO" | ||
]; | ||
@@ -47,7 +51,11 @@ | ||
var dictionary = [ | ||
"Super cool", | ||
"Super", | ||
"Typeahead", | ||
"Type Ahead", | ||
"Auto Complete is cool" | ||
"Yellowstone", | ||
"Yellowstone National Park", | ||
"Grand Canyon", | ||
"Arches", | ||
"Arches National Park", | ||
"Yosemite National Park", | ||
"Yosemite", | ||
"INYO National Park", | ||
"INYO" | ||
]; | ||
@@ -86,6 +94,6 @@ | ||
|---|---|---|---|---| | ||
|typeAhead.suggest(dictionary, text, caretPosition) | Given a dictionary of keywords, the user input text, and the user's caret position, find the set of matching suggestions | returns an array of suggestions e.g. `["Super", "Super cool!"]` | | ||
|typeAhead.suggest(dictionary, text, caretPosition) | Given a dictionary of keywords, the user input text, and the user's caret position, find the set of matching suggestions | returns a `Promise` that resolves with an array of suggestions e.g. `["Super", "Super cool!"]` | | ||
|typeAhead.complete(suggestion, text, caretPosition) | Given the the selected suggestion, the input text, and the user's caret position, complete the user's input with the selected suggestion | returns an object containing the text and the suggested 'replace until' position `{"text": "This is Super Cool", "pos": 18}` | | ||
##Examples | ||
##Example | ||
The example code can be found in the examples folder. | ||
@@ -92,0 +100,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
179629
179