Perhaps add JSDocs to the main autoComplete function?
See original GitHub issueI’m not sure if this is useful for anyone else. I do not wish to have it added just for me. I think maybe the whole API should change instead, but for the time being maybe this is helpful?
Below I just added a few of the config options for testing. You can see how it works.
=xxx
is a default value.[]
means it’s optional.
/**
* @desc This is autoComplete.js
* @version 10.0.0
* @example const autoCompleteJS = new autoComplete({config});
*
* @param {Object} config - Configuration options
* @param {string} [config.name=autoComplete] - Prepended to all created DOM element class names.
* @param {(string|Function)} [config.selector=#autoComplete] - Must point to or return the relevant input field or element that autoComplete.js should act upon.
* @param {Object} config.data - Data source.
* @param {(Array|Function} config.data.src - An array of values to search or a async or immediate function that returns an array of values to search.
* @param {string[]} [config.data.keys] - Only used if config.data.src is an array of objects. Specifies which keys in the objects autoComplete.js should search.
* @param {boolean} [config.data.cache=false] - Whether or not autoComplete.js should cache results from config.data.src or not.
* @param {Function} [config.data.filter] - A function used to filter the returns from config.data.src before showing them to the user. Function signature: (Array), is given the results from config.data.src.
*/
export default function autoComplete(config) {
...
}
If you want, I can write it all.
Do you think it would be useful to anyone, or is it a waste of time?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Up your JavaScript autocomplete game using JSDocs
In the most basic form, JSDocs tags are: @author - Developer's name; @constructor - Marks a function as a constructor; @deprecated - Marks...
Read more >Is there a way to generate JSDoc comments in Visual Studio ...
Visual Studio 1.10 is now able to generate JSDoc comments. Just type /** above the function. enter image description here. See Also:.
Read more >TypeScript JSDoc auto complete snippet doesn't work in ...
Open a TypeScript file and create a function. Position cursor above function definition and hit /**. Expected result: A JSDoc auto complete ......
Read more >Up your JavaScript autocomplete game using ... - Kenton Vizdos
In the most basic form, JSDocs tags are: @author - Developer's name; @constructor - Marks a function as a constructor; @deprecated - Marks...
Read more >Confident JS series: Part 2 — Types, JSDocs, and declaration ...
JSDoc function autocompletion in VSCode ... How to add type checking to JavaScript files using TypeScript. www.typescriptlang.org.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here we go 😄 Probably lots of mistakes in it, feel free to edit 👍
Updated with
config.wrapper
.