Skip to content

Commit 17d8c93

Browse files
Copilotkobenguyent
andcommitted
Add named exports to codeceptjs module declaration for TypeScript support
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
1 parent 767c413 commit 17d8c93

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

typings/index.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,27 @@ declare namespace Mocha {
637637

638638
declare module 'codeceptjs' {
639639
export default codeceptjs
640+
export const codecept: typeof CodeceptJS.Codecept
641+
export const Codecept: typeof CodeceptJS.Codecept
642+
export const output: typeof CodeceptJS.output
643+
export const container: typeof CodeceptJS.Container
644+
export const event: typeof CodeceptJS.event
645+
export const recorder: CodeceptJS.recorder
646+
export const config: typeof CodeceptJS.Config
647+
export const actor: CodeceptJS.actor
648+
export const helper: typeof CodeceptJS.Helper
649+
export const Helper: typeof CodeceptJS.Helper
650+
export const pause: typeof CodeceptJS.pause
651+
export const within: typeof CodeceptJS.within
652+
export const dataTable: typeof CodeceptJS.DataTable
653+
export const dataTableArgument: typeof CodeceptJS.DataTableArgument
654+
export const store: typeof CodeceptJS.store
655+
export const locator: typeof CodeceptJS.Locator
656+
export const heal: any
657+
export const ai: any
658+
export const Workers: any
659+
export const Secret: typeof CodeceptJS.Secret
660+
export const secret: typeof CodeceptJS.secret
640661
}
641662

642663
declare module '@codeceptjs/helper' {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { expectType } from 'tsd'
2+
import { container, codecept, output, event, recorder, config, actor, helper, pause, within, dataTable, dataTableArgument, store, locator, heal, ai, Workers, Secret, secret } from 'codeceptjs'
3+
import defaultExport from 'codeceptjs'
4+
5+
expectType<typeof CodeceptJS.Container>(container)
6+
expectType<typeof CodeceptJS.Codecept>(codecept)
7+
expectType<typeof CodeceptJS.output>(output)
8+
expectType<typeof CodeceptJS.event>(event)
9+
expectType<CodeceptJS.recorder>(recorder)
10+
expectType<typeof CodeceptJS.Config>(config)
11+
expectType<CodeceptJS.actor>(actor)
12+
expectType<typeof CodeceptJS.Helper>(helper)
13+
expectType<typeof CodeceptJS.pause>(pause)
14+
expectType<typeof CodeceptJS.within>(within)
15+
expectType<typeof CodeceptJS.DataTable>(dataTable)
16+
expectType<typeof CodeceptJS.DataTableArgument>(dataTableArgument)
17+
expectType<typeof CodeceptJS.store>(store)
18+
expectType<typeof CodeceptJS.Locator>(locator)
19+
expectType<typeof CodeceptJS.Secret>(Secret)
20+
expectType<typeof CodeceptJS.secret>(secret)
21+
22+
expectType<typeof defaultExport>(defaultExport)
23+
24+
const helperInstance = container.helpers('Playwright')

0 commit comments

Comments
 (0)