File tree Expand file tree Collapse file tree 5 files changed +15
-13
lines changed Expand file tree Collapse file tree 5 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Some WXT APIs can be used without importing them:
12
12
13
13
- [ ` browser ` ] ( /api/wxt-browser#browser ) from ` wxt/browser ` , a small wrapper around ` webextension-polyfill `
14
14
- [ ` defineContentScript ` ] ( /api/wxt-client#defiencontentscript ) from ` wxt/client `
15
- - [ ` defineBackground ` ] ( /api/wxt-client#definebackgroundscript ) from ` wxt/client `
15
+ - [ ` defineBackground ` ] ( /api/wxt-client#definebackground ) from ` wxt/client `
16
16
- [ ` createContentScriptUi ` ] ( /api/wxt-client#createcontentscriptui ) from ` wxt/client `
17
17
18
18
And more. All [ ` wxt/client ` ] ( /api/wxt-client ) APIs can be used without imports.
Original file line number Diff line number Diff line change 1
- import { BackgroundScriptDefintition } from '..' ;
1
+ import { BackgroundDefinition } from '..' ;
2
2
3
- export function defineBackground ( main : ( ) => void ) : BackgroundScriptDefintition ;
3
+ export function defineBackground ( main : ( ) => void ) : BackgroundDefinition ;
4
4
export function defineBackground (
5
- definition : BackgroundScriptDefintition ,
6
- ) : BackgroundScriptDefintition ;
5
+ definition : BackgroundDefinition ,
6
+ ) : BackgroundDefinition ;
7
7
export function defineBackground (
8
- arg : ( ( ) => void ) | BackgroundScriptDefintition ,
9
- ) : BackgroundScriptDefintition {
8
+ arg : ( ( ) => void ) | BackgroundDefinition ,
9
+ ) : BackgroundDefinition {
10
10
if ( typeof arg === 'function' ) return { main : arg } ;
11
11
return arg ;
12
12
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ declare module '*?raw' {
6
6
}
7
7
8
8
declare module 'virtual:user-background' {
9
- const definition : import ( '../../' ) . BackgroundScriptDefintition ;
9
+ const definition : import ( '../../' ) . BackgroundDefinition ;
10
10
export default definition ;
11
11
}
12
12
Original file line number Diff line number Diff line change 1
1
import { relative , resolve } from 'path' ;
2
2
import {
3
3
BackgroundEntrypoint ,
4
- BackgroundScriptDefintition ,
4
+ BackgroundDefinition ,
5
5
BaseEntrypointOptions ,
6
6
ContentScriptDefinition ,
7
7
ContentScriptEntrypoint ,
@@ -295,10 +295,12 @@ async function getBackgroundEntrypoint(
295
295
config : InternalConfig ,
296
296
path : string ,
297
297
) : Promise < BackgroundEntrypoint > {
298
- let options : Omit < BackgroundScriptDefintition , 'main' > = { } ;
298
+ let options : Omit < BackgroundDefinition , 'main' > = { } ;
299
299
if ( path !== VIRTUAL_NOOP_BACKGROUND_MODULE_ID ) {
300
- const defaultExport =
301
- await importEntrypointFile < BackgroundScriptDefintition > ( path , config ) ;
300
+ const defaultExport = await importEntrypointFile < BackgroundDefinition > (
301
+ path ,
302
+ config ,
303
+ ) ;
302
304
if ( defaultExport == null ) {
303
305
throw Error ( 'Background script does not have a default export' ) ;
304
306
}
Original file line number Diff line number Diff line change @@ -429,7 +429,7 @@ export interface ContentScriptDefinition extends ExcludableEntrypoint {
429
429
main ( ctx : ContentScriptContext ) : void | Promise < void > ;
430
430
}
431
431
432
- export interface BackgroundScriptDefintition extends ExcludableEntrypoint {
432
+ export interface BackgroundDefinition extends ExcludableEntrypoint {
433
433
type ?: PerBrowserOption < 'module' > ;
434
434
persistent ?: PerBrowserOption < boolean > ;
435
435
main ( ) : void ;
You can’t perform that action at this time.
0 commit comments