declare module "bun:test" { interface MockMetadata { calls: TArgs[] } interface MockFunction { (...args: TArgs): TReturn mock: MockMetadata mockReset(): void mockReturnValue(value: TReturn): void mockResolvedValue(value: Awaited): void } export function describe(name: string, fn: () => void): void export function test(name: string, fn: () => void | Promise): void export function it(name: string, fn: () => void | Promise): void export function beforeEach(fn: () => void | Promise): void export function afterEach(fn: () => void | Promise): void export function beforeAll(fn: () => void | Promise): void export function afterAll(fn: () => void | Promise): void export function mock( fn: (...args: TArgs) => TReturn, ): MockFunction export namespace mock { function module(modulePath: string, factory: () => Record): void function restore(): void } interface Matchers { toBe(expected: unknown): void toBeDefined(): void toBeUndefined(): void toBeNull(): void toEqual(expected: unknown): void toContain(expected: unknown): void toMatch(expected: RegExp | string): void toHaveLength(expected: number): void toHaveBeenCalled(): void toHaveBeenCalledTimes(expected: number): void toHaveBeenCalledWith(...expected: unknown[]): void toBeGreaterThan(expected: number): void toThrow(expected?: RegExp | string): void toStartWith(expected: string): void not: Matchers } export function expect(received: unknown): Matchers }