Skip to content

Commit afc4374

Browse files
committed
test: add additional test for validity of types shared from runtime
1 parent 633e51c commit afc4374

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

example/playground/nuxt.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export default defineNuxtConfig({
66
api: '',
77
},
88
hooks: {
9-
'my-module:init'() {},
9+
'my-module:init'(sharedType) {
10+
// @ts-expect-error invalid assignment
11+
const b: number = sharedType
12+
},
1013
},
1114
})

example/src/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface ModuleOptions {
1010
}
1111

1212
export interface ModuleHooks {
13-
'my-module:init': () => void
13+
'my-module:init': (sharedType: SharedTypeFromRuntime) => void
1414
}
1515

1616
export interface ModuleRuntimeHooks {

0 commit comments

Comments
 (0)