Skip to content

Commit c25427f

Browse files
committed
Fix: (index.d.ts) remove globals, add missing exports
1 parent d18924b commit c25427f

2 files changed

Lines changed: 7 additions & 41 deletions

File tree

typings/index.d.ts

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -524,24 +524,11 @@ type RetryTo = (fn: (tries: number) => Promise<void> | void, maxTries: number, p
524524
// Globals
525525
declare const codecept_dir: string
526526
declare const output_dir: string
527-
declare const tryTo: TryTo
528-
declare const retryTo: RetryTo
529-
declare const hopeThat: HopeThat
530-
531-
declare const actor: CodeceptJS.actor
532-
declare const codecept_actor: CodeceptJS.actor
533-
declare const Helper: typeof CodeceptJS.Helper
534-
declare const codecept_helper: typeof CodeceptJS.Helper
527+
535528
declare const pause: typeof CodeceptJS.pause
536-
declare const within: typeof CodeceptJS.within
537-
declare const session: typeof CodeceptJS.session
538-
declare const DataTable: typeof CodeceptJS.DataTable
539-
declare const DataTableArgument: typeof CodeceptJS.DataTableArgument
540529
declare const codeceptjs: typeof CodeceptJS
541-
declare const locate: typeof CodeceptJS.Locator.build
542530
declare function inject(): CodeceptJS.SupportObject
543531
declare function inject<T extends keyof CodeceptJS.SupportObject>(name: T): CodeceptJS.SupportObject[T]
544-
declare const secret: typeof CodeceptJS.Secret.secret
545532

546533
// BDD
547534
declare const Given: typeof CodeceptJS.addStep
@@ -579,21 +566,8 @@ declare namespace NodeJS {
579566
codecept_dir: typeof codecept_dir
580567
output_dir: typeof output_dir
581568

582-
actor: typeof actor
583-
codecept_actor: typeof codecept_actor
584-
Helper: typeof Helper
585-
codecept_helper: typeof codecept_helper
586569
pause: typeof pause
587-
within: typeof within
588-
session: typeof session
589-
DataTable: typeof DataTable
590-
DataTableArgument: typeof DataTableArgument
591-
locate: typeof locate
592570
inject: typeof inject
593-
secret: typeof secret
594-
// plugins
595-
tryTo: typeof tryTo
596-
retryTo: typeof retryTo
597571

598572
// BDD
599573
Given: typeof Given
@@ -729,6 +703,12 @@ declare module 'codeceptjs' {
729703
* Create a secret value
730704
*/
731705
export const secret: typeof CodeceptJS.Secret.secret
706+
707+
export const session: typeof CodeceptJS.session
708+
709+
export const inject: typeof globalThis.inject
710+
711+
export const locate: typeof CodeceptJS.Locator.build
732712
}
733713

734714
declare module '@codeceptjs/helper' {

typings/tests/global-variables.types.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,3 @@ expectType<CodeceptJS.HookConfig>(
107107
expectType<CodeceptJS.I>(args.I)
108108
}),
109109
)
110-
111-
// @ts-ignore
112-
expectType<Promise<boolean>>(
113-
tryTo(() => {
114-
return true
115-
}),
116-
)
117-
118-
// @ts-ignore
119-
expectType<Promise<boolean>>(
120-
tryTo(async () => {
121-
return false
122-
}),
123-
)

0 commit comments

Comments
 (0)