Skip to content

Commit 5e44def

Browse files
committed
chore(types): improve typing of config.global.stubs, fixes #1023
* config.global.stubs is always an object
1 parent 99b2696 commit 5e44def

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import { GlobalMountOptions } from './types'
1+
import { GlobalMountOptions, Stub } from './types'
22
import { VueWrapper } from './vueWrapper'
33
import { DOMWrapper } from './domWrapper'
44
import { CustomCreateStub } from './stubs'
55

66
export interface GlobalConfigOptions {
7-
global: Required<GlobalMountOptions>
7+
global: Required<Omit<GlobalMountOptions, 'stubs'>> & {
8+
stubs?: Record<string, Stub>
9+
}
810
plugins: {
911
VueWrapper: Pluggable<VueWrapper>
1012
DOMWrapper: Pluggable<DOMWrapper<Node>>

test-dts/global.d-test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { config } from '../src'
2+
3+
config.global.stubs.RouterLink = true

0 commit comments

Comments
 (0)