/* oxlint-disable typescript/method-signature-style */ type Awaitable = T | PromiseLike export type ModuleMockFactoryWithHelper = ( importOriginal: () => Promise, ) => Awaitable> export type ModuleMockFactory = () => any export interface ModuleMockOptions { spy?: boolean } export interface ServerMockResolution { mockType: 'manual' | 'redirect' | 'automock' | 'autospy' resolvedId: string resolvedUrl: string needsInterop?: boolean redirectUrl?: string | null } export interface ServerIdResolution { id: string url: string optimized: boolean } export interface ModuleMockContext { /** * When mocking with a factory, this refers to the module that imported the mock. */ callstack: null | string[] } export interface TestModuleMocker { queueMock( id: string, importer: string, factoryOrOptions?: ModuleMockFactory | ModuleMockOptions, ): void queueUnmock(id: string, importer: string): void importActual(rawId: string, importer: string, callstack?: string[] | null): Promise importMock(rawId: string, importer: string): Promise mockObject( object: Record, moduleType?: 'automock' | 'autospy', ): Record mockObject( object: Record, mockExports: Record | undefined, moduleType?: 'automock' | 'autospy', ): Record getMockContext(): ModuleMockContext reset(): void }