wxt 0.6.2 → 0.6.3
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/cli.cjs +2 -2
- package/dist/client.d.ts +24 -0
- package/dist/client.js +33 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/virtual-modules/content-script-entrypoint.js +32 -0
- package/dist/virtual-modules/content-script-entrypoint.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -32,6 +32,18 @@ declare class ContentScriptContext extends AbortController {
|
|
|
32
32
|
* removeInvalidatedListener();
|
|
33
33
|
*/
|
|
34
34
|
onInvalidated(cb: () => void): () => void;
|
|
35
|
+
/**
|
|
36
|
+
* Return a promise that never resolves. Useful if you have an async function that shouldn't run
|
|
37
|
+
* after the context is expired.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* const getValueFromStorage = async () => {
|
|
41
|
+
* if (ctx.isInvalid) return ctx.block();
|
|
42
|
+
*
|
|
43
|
+
* // ...
|
|
44
|
+
* }
|
|
45
|
+
*/
|
|
46
|
+
block<T>(): Promise<T>;
|
|
35
47
|
/**
|
|
36
48
|
* Wrapper around `window.setInterval` that automatically clears the interval when invalidated.
|
|
37
49
|
*/
|
|
@@ -50,6 +62,18 @@ declare class ContentScriptContext extends AbortController {
|
|
|
50
62
|
* invalidated.
|
|
51
63
|
*/
|
|
52
64
|
requestIdleCallback(callback: IdleRequestCallback, options?: IdleRequestOptions): number;
|
|
65
|
+
/**
|
|
66
|
+
* Call `target.addEventListener` and remove the event listener when the context is invalidated.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ctx.addEventListener(window, "mousemove", () => {
|
|
70
|
+
* // ...
|
|
71
|
+
* });
|
|
72
|
+
* ctx.addEventListener(document, "visibilitychange", () => {
|
|
73
|
+
* // ...
|
|
74
|
+
* });
|
|
75
|
+
*/
|
|
76
|
+
addEventListener(target: any, type: string, handler: (event: Event) => void, options?: AddEventListenerOptions): void;
|
|
53
77
|
/**
|
|
54
78
|
* Abort the abort controller and execute all `onInvalidated` listeners.
|
|
55
79
|
*/
|
|
@@ -514,7 +538,7 @@ type EntrypointGroup = Entrypoint | Entrypoint[];
|
|
|
514
538
|
*/
|
|
515
539
|
declare function clean(root?: string): Promise<void>;
|
|
516
540
|
|
|
517
|
-
var version = "0.6.
|
|
541
|
+
var version = "0.6.3";
|
|
518
542
|
|
|
519
543
|
declare function defineConfig(config: UserConfig): UserConfig;
|
|
520
544
|
|
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,18 @@ declare class ContentScriptContext extends AbortController {
|
|
|
32
32
|
* removeInvalidatedListener();
|
|
33
33
|
*/
|
|
34
34
|
onInvalidated(cb: () => void): () => void;
|
|
35
|
+
/**
|
|
36
|
+
* Return a promise that never resolves. Useful if you have an async function that shouldn't run
|
|
37
|
+
* after the context is expired.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* const getValueFromStorage = async () => {
|
|
41
|
+
* if (ctx.isInvalid) return ctx.block();
|
|
42
|
+
*
|
|
43
|
+
* // ...
|
|
44
|
+
* }
|
|
45
|
+
*/
|
|
46
|
+
block<T>(): Promise<T>;
|
|
35
47
|
/**
|
|
36
48
|
* Wrapper around `window.setInterval` that automatically clears the interval when invalidated.
|
|
37
49
|
*/
|
|
@@ -50,6 +62,18 @@ declare class ContentScriptContext extends AbortController {
|
|
|
50
62
|
* invalidated.
|
|
51
63
|
*/
|
|
52
64
|
requestIdleCallback(callback: IdleRequestCallback, options?: IdleRequestOptions): number;
|
|
65
|
+
/**
|
|
66
|
+
* Call `target.addEventListener` and remove the event listener when the context is invalidated.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ctx.addEventListener(window, "mousemove", () => {
|
|
70
|
+
* // ...
|
|
71
|
+
* });
|
|
72
|
+
* ctx.addEventListener(document, "visibilitychange", () => {
|
|
73
|
+
* // ...
|
|
74
|
+
* });
|
|
75
|
+
*/
|
|
76
|
+
addEventListener(target: any, type: string, handler: (event: Event) => void, options?: AddEventListenerOptions): void;
|
|
53
77
|
/**
|
|
54
78
|
* Abort the abort controller and execute all `onInvalidated` listeners.
|
|
55
79
|
*/
|
|
@@ -514,7 +538,7 @@ type EntrypointGroup = Entrypoint | Entrypoint[];
|
|
|
514
538
|
*/
|
|
515
539
|
declare function clean(root?: string): Promise<void>;
|
|
516
540
|
|
|
517
|
-
var version = "0.6.
|
|
541
|
+
var version = "0.6.3";
|
|
518
542
|
|
|
519
543
|
declare function defineConfig(config: UserConfig): UserConfig;
|
|
520
544
|
|
package/dist/index.js
CHANGED