@crxjs/vite-plugin 2.0.0-beta.3 → 2.0.0-beta.30

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.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' | (string & {});
23
+ }
24
+ interface FirefoxManifestBackground {
25
+ scripts: string[];
26
+ persistent?: false;
27
+ }
20
28
  interface ManifestV3 {
21
29
  manifest_version: number;
22
30
  name: string;
@@ -25,11 +33,13 @@ interface ManifestV3 {
25
33
  description?: string | undefined;
26
34
  icons?: chrome.runtime.ManifestIcons | undefined;
27
35
  action?: chrome.runtime.ManifestAction | undefined;
28
- author?: string | undefined;
29
- background?: {
30
- service_worker: string;
31
- type?: 'module';
36
+ /**
37
+ * @see https://developer.chrome.com/docs/extensions/reference/manifest/author
38
+ */
39
+ author?: {
40
+ email: string;
32
41
  } | undefined;
42
+ background?: ChromeManifestBackground | FirefoxManifestBackground | undefined;
33
43
  chrome_settings_overrides?: {
34
44
  homepage?: string | undefined;
35
45
  search_provider?: chrome.runtime.SearchProvider | undefined;
@@ -118,12 +128,12 @@ interface ManifestV3 {
118
128
  } | undefined;
119
129
  incognito?: string | undefined;
120
130
  input_components?: {
121
- name?: string | undefined;
122
- type?: string | undefined;
131
+ name: string;
123
132
  id?: string | undefined;
124
- description?: string | undefined;
125
- language?: string | undefined;
126
- layouts?: string[] | undefined;
133
+ language?: string | string[] | undefined;
134
+ layouts?: string | string[] | undefined;
135
+ input_view?: string | undefined;
136
+ options_page?: string | undefined;
127
137
  }[] | undefined;
128
138
  key?: string | undefined;
129
139
  minimum_chrome_version?: string | undefined;
@@ -166,6 +176,9 @@ interface ManifestV3 {
166
176
  pages: string[];
167
177
  content_security_policy?: string | undefined;
168
178
  } | undefined;
179
+ side_panel?: {
180
+ default_path?: string | undefined;
181
+ } | undefined;
169
182
  short_name?: string | undefined;
170
183
  spellcheck?: {
171
184
  dictionary_language?: string | undefined;
@@ -202,7 +215,8 @@ declare const defineManifest: (manifest: ManifestV3Export) => ManifestV3Export;
202
215
  *
203
216
  * You don't need to define a match pattern for dynamic content script
204
217
  * resources, but if you want to do so, you can use the helper function
205
- * `defineDynamicResource` to define your web accessible resources in a TypeScript file:
218
+ * `defineDynamicResource` to define your web accessible resources in a
219
+ * TypeScript file:
206
220
  *
207
221
  * ```typescript
208
222
  * import { crx, defineManifest, defineDynamicResource }
@@ -228,9 +242,15 @@ declare type CrxDevScriptId = {
228
242
  type: 'module' | 'iife';
229
243
  };
230
244
  interface CrxPlugin extends Plugin {
231
- /** Runs during the transform hook for the manifest. Filenames use input filenames. */
245
+ /**
246
+ * Runs during the transform hook for the manifest. Filenames use input
247
+ * filenames.
248
+ */
232
249
  transformCrxManifest?: (this: PluginContext, manifest: ManifestV3) => Promise<ManifestV3 | null | undefined> | ManifestV3 | null | undefined;
233
- /** Runs during generateBundle, before manifest output. Filenames use output filenames. */
250
+ /**
251
+ * Runs during generateBundle, before manifest output. Filenames use output
252
+ * filenames.
253
+ */
234
254
  renderCrxManifest?: (this: PluginContext, manifest: ManifestV3, bundle: OutputBundle) => Promise<ManifestV3 | null | undefined> | ManifestV3 | null | undefined;
235
255
  /**
236
256
  * Runs in the file writer on content scripts during development. `script.id`
@@ -245,7 +265,13 @@ interface CrxOptions {
245
265
  injectCss?: boolean;
246
266
  };
247
267
  fastGlobOptions?: Options;
268
+ /**
269
+ * The browser that this extension is targeting, can be "firefox" or "chrome".
270
+ * Default is "chrome".
271
+ */
272
+ browser?: Browser;
248
273
  }
274
+ declare type Browser = 'firefox' | 'chrome';
249
275
 
250
276
  /** Resolves when all existing files in scriptFiles are written. */
251
277
  declare function allFilesReady(): Promise<void>;