@crxjs/vite-plugin 2.0.0-beta.2 → 2.0.0-beta.22
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/client.d.ts +15 -0
- package/dist/index.cjs +0 -1848
- package/dist/index.d.ts +33 -12
- package/dist/index.mjs +249 -76
- package/package.json +22 -20
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,14 @@ interface WebAccessibleResourceById {
|
|
|
17
17
|
resources: string[];
|
|
18
18
|
use_dynamic_url?: boolean;
|
|
19
19
|
}
|
|
20
|
+
interface ChromeManifestBackground {
|
|
21
|
+
service_worker: string;
|
|
22
|
+
type?: 'module';
|
|
23
|
+
}
|
|
24
|
+
interface FirefoxManifestBackground {
|
|
25
|
+
scripts: string[];
|
|
26
|
+
persistent?: false;
|
|
27
|
+
}
|
|
20
28
|
interface ManifestV3 {
|
|
21
29
|
manifest_version: number;
|
|
22
30
|
name: string;
|
|
@@ -26,10 +34,7 @@ interface ManifestV3 {
|
|
|
26
34
|
icons?: chrome.runtime.ManifestIcons | undefined;
|
|
27
35
|
action?: chrome.runtime.ManifestAction | undefined;
|
|
28
36
|
author?: string | undefined;
|
|
29
|
-
background?:
|
|
30
|
-
service_worker: string;
|
|
31
|
-
type?: 'module';
|
|
32
|
-
} | undefined;
|
|
37
|
+
background?: ChromeManifestBackground | FirefoxManifestBackground | undefined;
|
|
33
38
|
chrome_settings_overrides?: {
|
|
34
39
|
homepage?: string | undefined;
|
|
35
40
|
search_provider?: chrome.runtime.SearchProvider | undefined;
|
|
@@ -118,12 +123,12 @@ interface ManifestV3 {
|
|
|
118
123
|
} | undefined;
|
|
119
124
|
incognito?: string | undefined;
|
|
120
125
|
input_components?: {
|
|
121
|
-
name
|
|
122
|
-
type?: string | undefined;
|
|
126
|
+
name: string;
|
|
123
127
|
id?: string | undefined;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
128
|
+
language?: string | string[] | undefined;
|
|
129
|
+
layouts?: string | string[] | undefined;
|
|
130
|
+
input_view?: string | undefined;
|
|
131
|
+
options_page?: string | undefined;
|
|
127
132
|
}[] | undefined;
|
|
128
133
|
key?: string | undefined;
|
|
129
134
|
minimum_chrome_version?: string | undefined;
|
|
@@ -166,6 +171,9 @@ interface ManifestV3 {
|
|
|
166
171
|
pages: string[];
|
|
167
172
|
content_security_policy?: string | undefined;
|
|
168
173
|
} | undefined;
|
|
174
|
+
side_panel?: {
|
|
175
|
+
default_path?: string | undefined;
|
|
176
|
+
} | undefined;
|
|
169
177
|
short_name?: string | undefined;
|
|
170
178
|
spellcheck?: {
|
|
171
179
|
dictionary_language?: string | undefined;
|
|
@@ -202,7 +210,8 @@ declare const defineManifest: (manifest: ManifestV3Export) => ManifestV3Export;
|
|
|
202
210
|
*
|
|
203
211
|
* You don't need to define a match pattern for dynamic content script
|
|
204
212
|
* resources, but if you want to do so, you can use the helper function
|
|
205
|
-
* `defineDynamicResource` to define your web accessible resources in a
|
|
213
|
+
* `defineDynamicResource` to define your web accessible resources in a
|
|
214
|
+
* TypeScript file:
|
|
206
215
|
*
|
|
207
216
|
* ```typescript
|
|
208
217
|
* import { crx, defineManifest, defineDynamicResource }
|
|
@@ -228,9 +237,15 @@ declare type CrxDevScriptId = {
|
|
|
228
237
|
type: 'module' | 'iife';
|
|
229
238
|
};
|
|
230
239
|
interface CrxPlugin extends Plugin {
|
|
231
|
-
/**
|
|
240
|
+
/**
|
|
241
|
+
* Runs during the transform hook for the manifest. Filenames use input
|
|
242
|
+
* filenames.
|
|
243
|
+
*/
|
|
232
244
|
transformCrxManifest?: (this: PluginContext, manifest: ManifestV3) => Promise<ManifestV3 | null | undefined> | ManifestV3 | null | undefined;
|
|
233
|
-
/**
|
|
245
|
+
/**
|
|
246
|
+
* Runs during generateBundle, before manifest output. Filenames use output
|
|
247
|
+
* filenames.
|
|
248
|
+
*/
|
|
234
249
|
renderCrxManifest?: (this: PluginContext, manifest: ManifestV3, bundle: OutputBundle) => Promise<ManifestV3 | null | undefined> | ManifestV3 | null | undefined;
|
|
235
250
|
/**
|
|
236
251
|
* Runs in the file writer on content scripts during development. `script.id`
|
|
@@ -245,7 +260,13 @@ interface CrxOptions {
|
|
|
245
260
|
injectCss?: boolean;
|
|
246
261
|
};
|
|
247
262
|
fastGlobOptions?: Options;
|
|
263
|
+
/**
|
|
264
|
+
* The browser that this extension is targeting, can be "firefox" or "chrome".
|
|
265
|
+
* Default is "chrome".
|
|
266
|
+
*/
|
|
267
|
+
browser?: Browser;
|
|
248
268
|
}
|
|
269
|
+
declare type Browser = 'firefox' | 'chrome';
|
|
249
270
|
|
|
250
271
|
/** Resolves when all existing files in scriptFiles are written. */
|
|
251
272
|
declare function allFilesReady(): Promise<void>;
|