import type { Done, Context as MochaContext, Suite as MochaSuite, Test as MochaTest } from 'mocha'; import type { AllowableAdditionalContext, CheckedAdditionalContext, EmptyContext, MergeContext } from 'test-chain-core'; export type ValidDoneReturnTypes = 0 | 0n | '' | false | null | undefined | void; export interface GenericContextualHook { (fn: (this: MochaContext, ctx: object, done: Done) => AdditionalContext & CheckedAdditionalContext): object; (name: string, fn: (this: MochaContext, ctx: object, done: Done) => AdditionalContext & CheckedAdditionalContext): object; } export interface GenericContextualTest { (name: string, fn: (this: MochaContext, ctx: object, done: Done) => ValidDoneReturnTypes): MochaTest; (name: string, fn: (this: MochaContext, ctx: object) => Promise | void): MochaTest; } export interface ExclusiveContextualTest extends GenericContextualTest { (name: string, fn: (this: MochaContext, ctx: ExistingContext, done: Done) => ValidDoneReturnTypes): MochaTest; (name: string, fn: (this: MochaContext, ctx: ExistingContext) => Promise): MochaTest; } export interface ContextualTest extends ExclusiveContextualTest { skip: ExclusiveContextualTest; only: ExclusiveContextualTest; } export interface ExclusiveEntrypointTest { (name: string, fn: (this: MochaContext, done: Done) => ValidDoneReturnTypes): MochaTest; (name: string, fn: (this: MochaContext) => Promise | void): MochaTest; } export interface EntrypointTest extends ExclusiveEntrypointTest { skip: ExclusiveEntrypointTest; only: ExclusiveEntrypointTest; } export interface ContextualAfterEachHook extends GenericContextualHook { (fn: (this: MochaContext, ctx: ExistingContext, done: Done) => AdditionalContext & CheckedAdditionalContext): AfterEachChain; (name: string, fn: (this: MochaContext, ctx: ExistingContext, done: Done) => AdditionalContext & CheckedAdditionalContext): AfterEachChain; } export interface AfterEachChain { afterEach: ContextualAfterEachHook>>; teardown: ContextualAfterEachHook>>; } export interface EntrypointAfterEachHook { (fn: (this: MochaContext, done: Done) => AdditionalContext & CheckedAdditionalContext): AfterEachChain; (name: string, fn: (this: MochaContext, done: Done) => AdditionalContext & CheckedAdditionalContext): AfterEachChain; } export interface ContextualAfterHook extends GenericContextualHook { (fn: (this: MochaContext, ctx: ExistingContext, done: Done) => AdditionalContext & CheckedAdditionalContext): AfterChain; (name: string, fn: (this: MochaContext, ctx: ExistingContext, done: Done) => AdditionalContext & CheckedAdditionalContext): AfterChain; } export interface AfterChain { after: ContextualAfterHook>>; suiteTeardown: ContextualAfterHook>>; } export interface EntrypointAfterHook { (fn: (this: MochaContext, done: Done) => AdditionalContext & CheckedAdditionalContext): AfterChain; (name: string, fn: (this: MochaContext, done: Done) => AdditionalContext & CheckedAdditionalContext): AfterChain; } export interface ContextualBeforeEachHook extends GenericContextualHook { (fn: (this: MochaContext, ctx: ExistingContext, done: Done) => AdditionalContext & CheckedAdditionalContext): BeforeEachChain; (name: string, fn: (this: MochaContext, ctx: ExistingContext, done: Done) => AdditionalContext & CheckedAdditionalContext): BeforeEachChain; } export interface BeforeEachChain extends AfterEachChain { beforeEach: ContextualBeforeEachHook>>; setup: ContextualBeforeEachHook>>; it: ContextualTest>>; xit: ExclusiveContextualTest>>; specify: ContextualTest>>; test: ContextualTest>>; } export interface EntrypointBeforeEachHook { (fn: (this: MochaContext, done: Done) => AdditionalContext & CheckedAdditionalContext): BeforeEachChain; (name: string, fn: (this: MochaContext, done: Done) => AdditionalContext & CheckedAdditionalContext): BeforeEachChain; } export interface ContextualBeforeHook extends GenericContextualHook { (fn: (this: MochaContext, ctx: ExistingContext, done: Done) => AdditionalContext & CheckedAdditionalContext): BeforeChain; (name: string, fn: (this: MochaContext, ctx: ExistingContext, done: Done) => AdditionalContext & CheckedAdditionalContext): BeforeChain; } export interface BeforeChain extends AfterChain, BeforeEachChain { before: ContextualBeforeHook>>; suiteSetup: ContextualBeforeHook>>; } export interface EntrypointBeforeHook { (fn: (this: MochaContext, done: Done) => AdditionalContext & CheckedAdditionalContext): BeforeChain; (name: string, fn: (this: MochaContext, done: Done) => AdditionalContext & CheckedAdditionalContext): BeforeChain; } declare const invalidInput: unique symbol; interface InvalidInput { name: string; [invalidInput]: Title; } export interface ExclusiveContextualSuite { (title: string, fn: (this: MochaSuite) => Promise<unknown>, illegalArgs: InvalidInput<'NoAsyncSuite'>): MochaSuite; (title: string, fn: (this: MochaSuite) => null | undefined | void): MochaSuite; } export interface ContextualSuite extends ExclusiveContextualSuite { skip: ExclusiveContextualSuite; only: ExclusiveContextualSuite; } export {}; //# sourceMappingURL=types.d.ts.map