You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to use the library in browser, just include the `autocomplete.js` and `autocomplete.css`into your HTML file.
7
+
If you want to use the library in a browser, just include `autocomplete.js` and `autocomplete.css`in your HTML file.
8
8
9
9
For `node.js`:
10
10
11
11
```console
12
12
npm install autocompleter
13
13
```
14
14
15
-
Then import it into your javascript code:
15
+
Then import it into your JavaScript code:
16
16
17
17
```javascript
18
18
importautocompletefrom"autocompleter";
@@ -50,13 +50,13 @@ autocomplete({
50
50
51
51
## Use with Typescript and Webpack
52
52
53
-
Simply import the autocompleter in your typescript file:
53
+
Simply import the autocompleter in your TypeScript file:
54
54
55
55
```javascript
56
56
importautocompletefrom"autocompleter";
57
57
```
58
58
59
-
and call the `autocomplete` function as showed below:
59
+
Then call the `autocomplete` function as shown below:
60
60
61
61
```javascript
62
62
// replace the `MyInterface` interface with the interface you want to use with autocomplete
@@ -73,7 +73,7 @@ autocomplete<MyInterface>({
73
73
});
74
74
```
75
75
76
-
If your custom interface doesn't have the `label` property, you might get a compilation error from typescript. In this case just add an additional type to your code and pass it to the autocompleter:
76
+
If your custom interface lacks the `label` property, TypeScript may produce a compilation error. To avoid this, use an additional type:
## Using the Library in a Pure JavaScript Environment
274
+
275
+
If you're using this library in a pure JavaScript environment, note that TypeScript enums are transpiled into numeric values. As a result, named enum values are replaced with their corresponding numbers. When calling functions that expect enum values, make sure to pass the correct numeric value instead of the enum name.
0 commit comments