Skip to content

Commit c347363

Browse files
committed
chore: update types
1 parent b9bed1b commit c347363

File tree

1 file changed

+33
-40
lines changed

1 file changed

+33
-40
lines changed

index.d.ts

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,49 @@
1-
import { Application, AppConstructorOptions } from 'spectron'
1+
import { ElectronApplication } from 'playwright-core'
22
import { Configuration as ElectronBuilderOptions } from 'electron-builder'
33
import * as ChainableWebpackConfig from 'webpack-chain'
44

55
interface Options {
66
/**
7-
Do not launch spectron.
8-
You will have to launch it on your own.
9-
*/
10-
noSpectron: boolean
11-
/** Launch server in dev mode, not in production. */
12-
forceDev: boolean
13-
/** Custom spectron options.These will be merged with default options. */
14-
spectronOptions: AppConstructorOptions
15-
/** Do not start app or wait for it to load.
16-
You will have to run app.start() and app.client.waitUntilWindowLoaded() yourself.
17-
*/
18-
noStart: boolean
19-
/** Set custom Vue env mode. Defaults to 'test' */
20-
mode: string
7+
Do not launch Playwright.
8+
You will have to launch it on your own.
9+
*/
10+
noPlaywright?: boolean
11+
/** Custom Playwright launch options. These will be merged with default options. */
12+
launchOptions?: Object
13+
/** Set custom Vue env mode. Defaults to 'production' */
14+
mode?: string
2115
}
22-
interface Server {
23-
/** Spectron instance. */
24-
app: Application
16+
interface ElectronInstance {
17+
/** Playwright application instance. */
18+
app: ElectronApplication
19+
/** Close app instance and stop dev server (must be called to prevent continued async operations). */
20+
stop: () => Promise<ElectronApplication>
2521
/** URL of dev server. */
26-
url: string
27-
/** Close spectron and stop dev server (must be called to prevent continued async operations). */
28-
stopServe: () => Promise<Application>
22+
serverUrl: string
2923
/** Log of dev server. */
30-
stdout: string
24+
serverStdout: string
3125
}
3226

3327
/**
34-
Run electron:serve, but instead of launching Electron it returns a Spectron Application instance.
35-
Used for e2e testing with Spectron.
28+
Run electron:serve, but instead of launching Electron it returns a Playwright Application instance.
29+
Used for e2e testing with Playwright.
3630
*/
37-
export function testWithSpectron(spectron: any, options?: Partial<Options>): Promise<Server>
31+
export function testWithPlaywright(options?: Options): Promise<ElectronInstance>
3832

39-
4033
export type PluginOptions = {
41-
builderOptions?: ElectronBuilderOptions,
42-
chainWebpackMainProcess?: (config?: ChainableWebpackConfig) => void,
43-
chainWebpackRendererProcess?: (config?: ChainableWebpackConfig) => void,
44-
mainProcessFile?: string,
45-
rendererProcessFile?: string,
46-
mainProcessWatch?: string[],
47-
mainProcessArgs?: string[],
48-
outputDir?: string,
49-
disableMainProcessTypescript?: boolean,
50-
mainProcessTypeChecking?: boolean,
51-
customFileProtocol?: string,
52-
removeElectronJunk?: boolean,
53-
externals?: string[],
54-
nodeModulesPath?: string[],
34+
builderOptions?: ElectronBuilderOptions
35+
chainWebpackMainProcess?: (config?: ChainableWebpackConfig) => void
36+
chainWebpackRendererProcess?: (config?: ChainableWebpackConfig) => void
37+
mainProcessFile?: string
38+
rendererProcessFile?: string
39+
mainProcessWatch?: string[]
40+
mainProcessArgs?: string[]
41+
outputDir?: string
42+
disableMainProcessTypescript?: boolean
43+
mainProcessTypeChecking?: boolean
44+
customFileProtocol?: string
45+
externals?: string[]
46+
nodeModulesPath?: string[]
5547
preload?: string | Record<string, string>
48+
nodeIntegration?: boolean
5649
}

0 commit comments

Comments
 (0)