thaizip 0.7.3 → 0.7.5
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/README.md +11 -1
- package/dist/data.cjs +40 -62
- package/dist/data.d.cts +14 -1
- package/dist/data.d.ts +14 -1
- package/dist/data.js +40 -63
- package/dist/defaultData.js +6 -0
- package/dist/index.cjs +17 -16
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +17 -16
- package/dist/react.cjs +17 -16
- package/dist/react.js +17 -16
- package/package.json +7 -4
package/dist/data.d.cts
CHANGED
|
@@ -42,6 +42,19 @@ type TrigramIndex = {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
declare function clearDefaultIndex(): void;
|
|
45
|
+
/**
|
|
46
|
+
* The already-built default index, or `null` if it has not finished building.
|
|
47
|
+
*
|
|
48
|
+
* Purely synchronous: it never starts a build and never touches the in-flight
|
|
49
|
+
* promise. It exists so a consumer can seed its initial state without waiting a
|
|
50
|
+
* microtask — `loadDefaultIndex()` is async even on a cache hit, which otherwise
|
|
51
|
+
* forces a one-frame loading state on every remount of an already-warm page.
|
|
52
|
+
*
|
|
53
|
+
* Returns `null` on a cold start and after `clearDefaultIndex()`, so callers must
|
|
54
|
+
* still call `loadDefaultIndex()` — this only lets them skip the visible flash
|
|
55
|
+
* when the answer is already known.
|
|
56
|
+
*/
|
|
57
|
+
declare function getDefaultIndexIfLoaded(): TrigramIndex | null;
|
|
45
58
|
declare function loadDefaultIndex(): Promise<TrigramIndex>;
|
|
46
59
|
|
|
47
|
-
export { clearDefaultIndex, loadDefaultIndex };
|
|
60
|
+
export { clearDefaultIndex, getDefaultIndexIfLoaded, loadDefaultIndex };
|
package/dist/data.d.ts
CHANGED
|
@@ -42,6 +42,19 @@ type TrigramIndex = {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
declare function clearDefaultIndex(): void;
|
|
45
|
+
/**
|
|
46
|
+
* The already-built default index, or `null` if it has not finished building.
|
|
47
|
+
*
|
|
48
|
+
* Purely synchronous: it never starts a build and never touches the in-flight
|
|
49
|
+
* promise. It exists so a consumer can seed its initial state without waiting a
|
|
50
|
+
* microtask — `loadDefaultIndex()` is async even on a cache hit, which otherwise
|
|
51
|
+
* forces a one-frame loading state on every remount of an already-warm page.
|
|
52
|
+
*
|
|
53
|
+
* Returns `null` on a cold start and after `clearDefaultIndex()`, so callers must
|
|
54
|
+
* still call `loadDefaultIndex()` — this only lets them skip the visible flash
|
|
55
|
+
* when the answer is already known.
|
|
56
|
+
*/
|
|
57
|
+
declare function getDefaultIndexIfLoaded(): TrigramIndex | null;
|
|
45
58
|
declare function loadDefaultIndex(): Promise<TrigramIndex>;
|
|
46
59
|
|
|
47
|
-
export { clearDefaultIndex, loadDefaultIndex };
|
|
60
|
+
export { clearDefaultIndex, getDefaultIndexIfLoaded, loadDefaultIndex };
|