@unocss/autocomplete 0.31.14 → 0.31.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -151,8 +151,21 @@ function createAutocomplete(uno) {
151
151
  suggestInFile,
152
152
  templates,
153
153
  cache,
154
- reset
154
+ reset,
155
+ enumerate
155
156
  };
157
+ async function enumerate() {
158
+ const matched = /* @__PURE__ */ new Set();
159
+ const a2z = "abcdefghijklmnopqrstuvwxyz";
160
+ const p = [];
161
+ for (const a of a2z) {
162
+ for (const b of a2z) {
163
+ p.push(suggest(`${a}${b}`).then((i) => i.forEach((j) => matched.add(j))));
164
+ }
165
+ }
166
+ await Promise.all(p);
167
+ return matched;
168
+ }
156
169
  function getParsed(template) {
157
170
  if (!templateCache.has(template))
158
171
  templateCache.set(template, parseAutocomplete(template, uno.config.theme));
package/dist/index.d.ts CHANGED
@@ -7,6 +7,10 @@ declare function createAutocomplete(uno: UnoGenerator): {
7
7
  templates: (string | AutoCompleteFunction)[];
8
8
  cache: LRU<string, string[]>;
9
9
  reset: () => void;
10
+ /**
11
+ * Enumerate possible suggestions from 'aa' - 'zz'
12
+ */
13
+ enumerate: () => Promise<Set<string>>;
10
14
  };
11
15
 
12
16
  declare type AutocompleteTemplatePart = AutocompleteTemplateStatic | AutocompleteTemplateGroup | AutocompleteTemplateTheme;
package/dist/index.mjs CHANGED
@@ -143,8 +143,21 @@ function createAutocomplete(uno) {
143
143
  suggestInFile,
144
144
  templates,
145
145
  cache,
146
- reset
146
+ reset,
147
+ enumerate
147
148
  };
149
+ async function enumerate() {
150
+ const matched = /* @__PURE__ */ new Set();
151
+ const a2z = "abcdefghijklmnopqrstuvwxyz";
152
+ const p = [];
153
+ for (const a of a2z) {
154
+ for (const b of a2z) {
155
+ p.push(suggest(`${a}${b}`).then((i) => i.forEach((j) => matched.add(j))));
156
+ }
157
+ }
158
+ await Promise.all(p);
159
+ return matched;
160
+ }
148
161
  function getParsed(template) {
149
162
  if (!templateCache.has(template))
150
163
  templateCache.set(template, parseAutocomplete(template, uno.config.theme));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/autocomplete",
3
- "version": "0.31.14",
3
+ "version": "0.31.17",
4
4
  "description": "Autocomplete utils for UnoCSS",
5
5
  "keywords": [
6
6
  "unocss",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/lru-cache": "^7.6.1",
39
- "@unocss/core": "0.31.14"
39
+ "@unocss/core": "0.31.17"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "unbuild",