declare global {
  namespace jest {
    interface Matchers<R, T = {}> {}
  }
}
import type { assert as assert_2 } from 'chai';
import type { config } from 'chai';
import { LoadConfigOptions } from '@rsbuild/core';
import type { RsbuildConfig } from '@rsbuild/core';
import type { RsbuildPlugin } from '@rsbuild/core';
import { Rspack } from '@rsbuild/core';
import type { Writable } from 'node:stream';

/**
 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

declare function addSerializer(plugin: Plugin_2): void;

export declare const afterAll: Rstest['afterAll'];

declare type AfterAllListener = (ctx: SuiteContext) => MaybePromise<void>;

export declare const afterEach: Rstest['afterEach'];

declare type AfterEachListener<ExtraContext = object> = (ctx: TestContext & ExtraContext) => MaybePromise<void>;

declare type AnimationFrameCallback = (timestamp: number) => any;

export declare const assert: Rstest['assert'];

export declare interface Assertion<T = any> extends Assertion_2<T> {
    not: Assertion<T>;
    // Vitest types these against @vitest/spy, but Rstest matchers accept rs.fn()
    // and rs.spyOn() mocks without requiring structural compatibility.
    toHaveBeenCalledBefore: (mock: CallOrderMock, failIfNoFirstInvocation?: boolean) => void;
    toHaveBeenCalledAfter: (mock: CallOrderMock, failIfNoFirstInvocation?: boolean) => void;
    // Snapshots are extended in @vitest/snapshot and are not part of @vitest/expect
    matchSnapshot: SnapshotMatcher<T>;
    toMatchSnapshot: SnapshotMatcher<T>;
    toMatchInlineSnapshot: InlineSnapshotMatcher<T>;
    /**
     * Checks that an error thrown by a function matches a previously recorded snapshot.
     *
     * @param message - Optional custom error message.
     *
     * @example
     * expect(functionWithError).toThrowErrorMatchingSnapshot();
     */ toThrowErrorMatchingSnapshot: (message?: string) => void;
    /**
     * Checks that an error thrown by a function matches an inline snapshot within the test file.
     * Useful for keeping snapshots close to the test code.
     *
     * @param snapshot - Optional inline snapshot string to match.
     * @param message - Optional custom error message.
     *
     * @example
     * const throwError = () => { throw new Error('Error occurred') };
     * expect(throwError).toThrowErrorMatchingInlineSnapshot(`"Error occurred"`);
     */ toThrowErrorMatchingInlineSnapshot: (snapshot?: string, message?: string) => void;
    /**
     * Compares the received value to a snapshot saved in a specified file.
     * Useful for cases where snapshot content is large or needs to be shared across tests.
     *
     * @param filepath - Path to the snapshot file.
     * @param message - Optional custom error message.
     *
     * @example
     * await expect(largeData).toMatchFileSnapshot('path/to/snapshot.json');
     */ toMatchFileSnapshot: (filepath: string, message?: string) => Promise<void>;
    /**
     * Verifies that a promise resolves.
     *
     * @example
     * await expect(someAsyncFunc).resolves.toBe(42);
     */ resolves: PromisifyAssertion_2<T>;
    /**
     * Verifies that a promise rejects.
     *
     * @example
     * await expect(someAsyncFunc).rejects.toThrow('error');
     */ rejects: PromisifyAssertion_2<T>;
}

declare interface Assertion_2<T = any> extends VitestAssertion<Chai.Assertion, T>, JestAssertion<T>, ChaiMockAssertion, Matchers<T> {
    	/**
     	* Ensures a value is of a specific type.
     	*
     	* @example
     	* expect(value).toBeTypeOf('string');
     	* expect(number).toBeTypeOf('number');
     	*/
    	toBeTypeOf: (expected: "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined") => void;
    	/**
     	* Asserts that a mock function was called exactly once.
     	*
     	* @example
     	* expect(mockFunc).toHaveBeenCalledOnce();
     	*/
    	toHaveBeenCalledOnce: () => void;
    	/**
     	* Ensure that a mock function is called with specific arguments and called
     	* exactly once.
     	*
     	* @example
     	* expect(mockFunc).toHaveBeenCalledExactlyOnceWith('arg1', 42);
     	*/
    	toHaveBeenCalledExactlyOnceWith: <E extends any[]>(...args: E) => void;
    	/**
     	* This assertion checks if a `Mock` was called before another `Mock`.
     	* @param mock - A mock function created by `vi.spyOn` or `vi.fn`
     	* @param failIfNoFirstInvocation - Fail if the first mock was never called
     	* @example
     	* const mock1 = vi.fn()
     	* const mock2 = vi.fn()
     	*
     	* mock1()
     	* mock2()
     	* mock1()
     	*
     	* expect(mock1).toHaveBeenCalledBefore(mock2)
     	*/
    	toHaveBeenCalledBefore: (mock: MockInstance_2, failIfNoFirstInvocation?: boolean) => void;
    	/**
     	* This assertion checks if a `Mock` was called after another `Mock`.
     	* @param mock - A mock function created by `vi.spyOn` or `vi.fn`
     	* @param failIfNoFirstInvocation - Fail if the first mock was never called
     	* @example
     	* const mock1 = vi.fn()
     	* const mock2 = vi.fn()
     	*
     	* mock2()
     	* mock1()
     	* mock2()
     	*
     	* expect(mock1).toHaveBeenCalledAfter(mock2)
     	*/
    	toHaveBeenCalledAfter: (mock: MockInstance_2, failIfNoFirstInvocation?: boolean) => void;
    	/**
     	* Checks that a promise resolves successfully at least once.
     	*
     	* @example
     	* await expect(promise).toHaveResolved();
     	*/
    	toHaveResolved: () => void;
    	/**
     	* Checks that a promise resolves to a specific value.
     	*
     	* @example
     	* await expect(promise).toHaveResolvedWith('success');
     	*/
    	toHaveResolvedWith: <E>(value: E) => void;
    	/**
     	* Ensures a promise resolves a specific number of times.
     	*
     	* @example
     	* expect(mockAsyncFunc).toHaveResolvedTimes(3);
     	*/
    	toHaveResolvedTimes: (times: number) => void;
    	/**
     	* Asserts that the last resolved value of a promise matches an expected value.
     	*
     	* @example
     	* await expect(mockAsyncFunc).toHaveLastResolvedWith('finalResult');
     	*/
    	toHaveLastResolvedWith: <E>(value: E) => void;
    	/**
     	* Ensures a specific value was returned by a promise on the nth resolution.
     	*
     	* @example
     	* await expect(mockAsyncFunc).toHaveNthResolvedWith(2, 'secondResult');
     	*/
    	toHaveNthResolvedWith: <E>(nthCall: number, value: E) => void;
    	/**
     	* Verifies that a promise resolves.
     	*
     	* @example
     	* await expect(someAsyncFunc).resolves.toBe(42);
     	*/
    	resolves: PromisifyAssertion<T>;
    	/**
     	* Verifies that a promise rejects.
     	*
     	* @example
     	* await expect(someAsyncFunc).rejects.toThrow('error');
     	*/
    	rejects: PromisifyAssertion<T>;
}

declare abstract class AsymmetricMatcher<
	T,
	State extends MatcherState = MatcherState
> implements AsymmetricMatcherInterface {
    	protected sample: T;
    	protected inverse: boolean;
    	$$typeof: symbol;
    	constructor(sample: T, inverse?: boolean);
    	protected getMatcherContext(expect?: Chai.ExpectStatic): State;
    	abstract asymmetricMatch(other: unknown, customTesters?: Array<Tester>): boolean;
    	abstract toString(): string;
    	getExpectedType?(): string;
    	toAsymmetricMatcher?(): string;
}

declare interface AsymmetricMatcherInterface {
    	asymmetricMatch: (other: unknown, customTesters?: Array<Tester>) => boolean;
    	toString: () => string;
    	getExpectedType?: () => string;
    	toAsymmetricMatcher?: () => string;
}

export declare interface AsymmetricMatchersContaining extends CustomMatcher {
    	/**
     	* Matches if the received string contains the expected substring.
     	*
     	* @example
     	* expect('I have an apple').toEqual(expect.stringContaining('apple'));
     	* expect({ a: 'test string' }).toEqual({ a: expect.stringContaining('test') });
     	*/
    	stringContaining: (expected: string) => any;
    	/**
     	* Matches if the received object contains all properties of the expected object.
     	*
     	* @example
     	* expect({ a: '1', b: 2 }).toEqual(expect.objectContaining({ a: '1' }))
     	*/
    	objectContaining: <T = any>(expected: DeeplyAllowMatchers<T>) => any;
    	/**
     	* Matches if the received array contains all elements in the expected array.
     	*
     	* @example
     	* expect(['a', 'b', 'c']).toEqual(expect.arrayContaining(['b', 'a']));
     	*/
    	arrayContaining: <T = unknown>(expected: Array<DeeplyAllowMatchers<T>>) => any;
    	/**
     	* Matches if the received string or regex matches the expected pattern.
     	*
     	* @example
     	* expect('hello world').toEqual(expect.stringMatching(/^hello/));
     	* expect('hello world').toEqual(expect.stringMatching('hello'));
     	*/
    	stringMatching: (expected: string | RegExp) => any;
    	/**
     	* Matches if the received number is within a certain precision of the expected number.
     	*
     	* @example
     	* expect(10.45).toEqual(expect.closeTo(10.5, 1));
     	* expect(5.11).toEqual(expect.closeTo(5.12)); // with default precision
     	*/
    	closeTo: (expected: number, precision?: number) => any;
    	/**
     	* Matches if the received value validates against a Standard Schema.
     	*
     	* @param schema - A Standard Schema V1 compatible schema object
     	*
     	* @example
     	* expect(user).toEqual(expect.schemaMatching(z.object({ name: z.string() })))
     	* expect(['hello', 'world']).toEqual([expect.schemaMatching(z.string()), expect.schemaMatching(z.string())])
     	*/
    	schemaMatching: (schema: unknown) => any;
}

declare type AsyncExpectationResult = Promise<SyncExpectationResult>;

export declare const beforeAll: Rstest['beforeAll'];

declare type BeforeAllListener = (ctx: SuiteContext) => MaybePromise<void | AfterAllListener>;

export declare const beforeEach: Rstest['beforeEach'];

declare type BeforeEachListener<ExtraContext = object> = (ctx: TestContext & ExtraContext) => MaybePromise<void | AfterEachListener<ExtraContext>>;

declare type BlobReporterOptions = {
    /**
     * Directory to store blob report files.
     * @default '.rstest-reports'
     */ outputDir?: string;
};

declare interface BranchMapping {
    loc: Range_2;
    type: string;
    locations: Range_2[];
    line: number;
}

/**
 * Single source of truth for the built-in browser provider identifiers.
 *
 * Core owns this list because the peer-dependency direction is one-way
 * (`@rstest/browser` depends on `@rstest/core`, never the reverse), so the CLI
 * `init` templates here cannot import the registry from `@rstest/browser`.
 * `@rstest/browser` re-exports {@link BrowserProvider} and keys its provider
 * registry by it (`Record<BrowserProvider, …>`), so adding a provider here
 * forces a matching implementation there — a missing key is a compile error.
 */
declare const BROWSER_PROVIDERS: readonly ['playwright'];

declare type BrowserModeConfig = {
    /**
     * Enable browser mode when running tests.
     *
     * @default false
     */ enabled?: boolean;
    /**
     * Browser provider to use for running tests.
     *
     * Currently only 'playwright' is supported.
     */ provider: BrowserProvider;
    /**
     * Which browser to use for testing.
     *
     * @default 'chromium'
     */ browser?: BrowserName;
    /**
     * Run browser in headless mode.
     *
     * @default Inferred from CI environment. `true` in CI, `false` otherwise.
     */ headless?: boolean;
    /**
     * Port for the browser mode dev server.
     *
     * If not specified, a random available port will be used.
     */ port?: number;
    /**
     * Default runner iframe viewport.
     *
     * When not specified, the browser UI fills the preview panel.
     */ viewport?: BrowserViewport;
    /**
     * Whether to exit if the specified port is already in use.
     *
     * @default false
     */ strictPort?: boolean;
    /**
     * Provider-specific config passed through to the selected browser provider.
     *
     * Use provider-owned types or helpers in user config when you want richer
     * IntelliSense for this field.
     */ providerOptions?: Record<string, unknown>;
};

/**
 * Supported browser types for browser mode testing.
 *
 * - `chromium` - Google Chrome, Microsoft Edge
 * - `firefox` - Mozilla Firefox
 * - `webkit` - Safari
 */ declare type BrowserName = 'chromium' | 'firefox' | 'webkit';

declare type BrowserProvider = (typeof BROWSER_PROVIDERS)[number];

declare type BrowserViewport = {
    width: number;
    height: number;
} | DevicePreset;

declare type BuiltInReporterNames = 'default' | 'dot' | 'verbose' | 'md' | 'github-actions' | 'junit' | 'json' | 'blob';

declare type BuiltinReporterOptions = {
    default: DefaultReporterOptions;
    dot: Pick<DefaultReporterOptions, 'logger' | 'summary'>;
    verbose: VerboseReporterOptions;
    md: MdReporterOptions;
    'github-actions': GithubActionsReporterOptions;
    junit: Record<string, unknown>;
    json: JsonReporterOptions;
    blob: BlobReporterOptions;
};

declare type BundleDependencyPattern = string | RegExp;

declare type CallOrderMock = MockInstance | Parameters<Assertion_2['toHaveBeenCalledBefore']>[0];

declare type CancelAnimationFrame = (id: TimerId) => void;

declare type CancelIdleCallback = (id: TimerId) => void;

declare type ChaiConfig = Partial<Pick<typeof config, 'showDiff' | 'truncateThreshold'>>;

/**
 * Chai-style assertions for spy/mock testing.
 * These provide sinon-chai compatible assertion names that delegate to Jest-style implementations.
 */
declare interface ChaiMockAssertion {
    	/**
     	* Checks that a spy was called at least once.
     	* Chai-style equivalent of `toHaveBeenCalled`.
     	*
     	* @example
     	* expect(spy).to.have.been.called
     	*/
    	readonly called: Assertion_2;
    	/**
     	* Checks that a spy was called a specific number of times.
     	* Chai-style equivalent of `toHaveBeenCalledTimes`.
     	*
     	* @example
     	* expect(spy).to.have.callCount(3)
     	*/
    	callCount: (count: number) => void;
    	/**
     	* Checks that a spy was called with specific arguments at least once.
     	* Chai-style equivalent of `toHaveBeenCalledWith`.
     	*
     	* @example
     	* expect(spy).to.have.been.calledWith('arg1', 'arg2')
     	*/
    	calledWith: <E extends any[]>(...args: E) => void;
    	/**
     	* Checks that a spy was called exactly once.
     	* Chai-style equivalent of `toHaveBeenCalledOnce`.
     	*
     	* @example
     	* expect(spy).to.have.been.calledOnce
     	*/
    	readonly calledOnce: Assertion_2;
    	/**
     	* Checks that a spy was called exactly once with specific arguments.
     	* Chai-style equivalent of `toHaveBeenCalledExactlyOnceWith`.
     	*
     	* @example
     	* expect(spy).to.have.been.calledOnceWith('arg1', 'arg2')
     	*/
    	calledOnceWith: <E extends any[]>(...args: E) => void;
    	/**
     	* Checks that the last call to a spy was made with specific arguments.
     	* Chai-style equivalent of `toHaveBeenLastCalledWith`.
     	*
     	* @example
     	* expect(spy).to.have.been.lastCalledWith('arg1', 'arg2')
     	*/
    	lastCalledWith: <E extends any[]>(...args: E) => void;
    	/**
     	* Checks that the nth call to a spy was made with specific arguments.
     	* Chai-style equivalent of `toHaveBeenNthCalledWith`.
     	*
     	* @example
     	* expect(spy).to.have.been.nthCalledWith(2, 'arg1', 'arg2')
     	*/
    	nthCalledWith: <E extends any[]>(n: number, ...args: E) => void;
    	/**
     	* Checks that a spy returned a specific value at least once.
     	* Chai-style equivalent of `toHaveReturnedWith`.
     	*
     	* @example
     	* expect(spy).to.have.returned('value')
     	*/
    	returned: <E>(value: E) => void;
    	/**
     	* Checks that a spy returned a specific value at least once.
     	* Chai-style equivalent of `toHaveReturnedWith`.
     	*
     	* @example
     	* expect(spy).to.have.returnedWith('value')
     	*/
    	returnedWith: <E>(value: E) => void;
    	/**
     	* Checks that a spy returned successfully a specific number of times.
     	* Chai-style equivalent of `toHaveReturnedTimes`.
     	*
     	* @example
     	* expect(spy).to.have.returnedTimes(3)
     	*/
    	returnedTimes: (count: number) => void;
    	/**
     	* Checks that the last return value of a spy matches the expected value.
     	* Chai-style equivalent of `toHaveLastReturnedWith`.
     	*
     	* @example
     	* expect(spy).to.have.lastReturnedWith('value')
     	*/
    	lastReturnedWith: <E>(value: E) => void;
    	/**
     	* Checks that the nth return value of a spy matches the expected value.
     	* Chai-style equivalent of `toHaveNthReturnedWith`.
     	*
     	* @example
     	* expect(spy).to.have.nthReturnedWith(2, 'value')
     	*/
    	nthReturnedWith: <E>(n: number, value: E) => void;
    	/**
     	* Checks that a spy was called before another spy.
     	* Chai-style equivalent of `toHaveBeenCalledBefore`.
     	*
     	* @example
     	* expect(spy1).to.have.been.calledBefore(spy2)
     	*/
    	calledBefore: (mock: MockInstance_2, failIfNoFirstInvocation?: boolean) => void;
    	/**
     	* Checks that a spy was called after another spy.
     	* Chai-style equivalent of `toHaveBeenCalledAfter`.
     	*
     	* @example
     	* expect(spy1).to.have.been.calledAfter(spy2)
     	*/
    	calledAfter: (mock: MockInstance_2, failIfNoFirstInvocation?: boolean) => void;
    	/**
     	* Checks that a spy was called exactly twice.
     	* Chai-style equivalent of `toHaveBeenCalledTimes(2)`.
     	*
     	* @example
     	* expect(spy).to.have.been.calledTwice
     	*/
    	readonly calledTwice: Assertion_2;
    	/**
     	* Checks that a spy was called exactly three times.
     	* Chai-style equivalent of `toHaveBeenCalledTimes(3)`.
     	*
     	* @example
     	* expect(spy).to.have.been.calledThrice
     	*/
    	readonly calledThrice: Assertion_2;
}

declare type ClearImmediate = (id: NodeImmediate) => void;

declare type ClearInterval = (id?: TimerId) => void;

declare type ClearTimeout = (id?: TimerId) => void;

declare type Clock = {
    now: number;
    Date: typeof Date & {
        clock?: Clock;
        isFake?: boolean;
        toSource?: () => string;
    };
    loopLimit: number;
    requestIdleCallback: RequestIdleCallback;
    cancelIdleCallback: CancelIdleCallback;
    setTimeout: SetTimeout;
    clearTimeout: ClearTimeout;
    nextTick: NextTick;
    queueMicrotask: QueueMicrotask;
    setInterval: SetInterval;
    clearInterval: ClearInterval;
    setImmediate: SetImmediate;
    clearImmediate: ClearImmediate;
    countTimers: CountTimers;
    requestAnimationFrame: RequestAnimationFrame;
    cancelAnimationFrame: CancelAnimationFrame;
    runMicrotasks: RunMicrotasks;
    tick: Tick;
    tickAsync: TickAsync;
    next: Next;
    nextAsync: NextAsync;
    runAll: RunAll;
    runToFrame: RunToFrame;
    runAllAsync: RunAllAsync;
    runToLast: RunToLast;
    runToLastAsync: RunToLastAsync;
    reset: Reset;
    setSystemTime: SetSystemTime;
    jump: Jump;
    performance: any;
    hrtime: Hrtime;
    uninstall: Uninstall;
    methods: string[];
    shouldClearNativeTimers?: boolean;
    timersModuleMethods: {
        methodName: string;
        original: unknown;
    }[] | undefined;
    timersPromisesModuleMethods: {
        methodName: string;
        original: unknown;
    }[] | undefined;
    abortListenerMap: Map<VoidVarArgsFunc, AbortSignal>;
    setTickMode: SetTickMode;
    timers?: Map<number, Timer>;
    timerHeap?: TimerHeap;
    duringTick?: boolean;
    isNearInfiniteLimit: boolean;
    attachedInterval?: TimerId;
    tickMode?: ClockTickMode;
    jobs?: Timer[];
    Intl?: IntlWithClock;
    Temporal?: any;
};

declare type ClockTickMode = {
    mode: TickMode;
    counter: number;
    delta?: number;
};

declare interface CloverOptions extends FileOptions, ProjectOptions {}

declare interface CoberturaOptions extends FileOptions, ProjectOptions {}

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
declare interface Colors {
    	comment: {
        		close: string;
        		open: string;
        	};
    	content: {
        		close: string;
        		open: string;
        	};
    	prop: {
        		close: string;
        		open: string;
        	};
    	tag: {
        		close: string;
        		open: string;
        	};
    	value: {
        		close: string;
        		open: string;
        	};
}

declare type CommonOptions = {
    root?: string;
    config?: string;
    configLoader?: LoadConfigOptions['loader'];
    related?: boolean;
    findRelatedTests?: boolean;
    changed?: boolean | string;
    globals?: boolean;
    /**
     * Pool options.
     * - `string`: shorthand for `{ type: string }` (from `--pool` flag)
     * - `object`: detailed pool config (from `--pool.*` options)
     */ pool?: string | {
        type?: string;
        maxWorkers?: string | number;
        execArgv?: string[] | string;
    };
    /**
     * Browser mode options.
     * - `boolean`: shorthand for `{ enabled: boolean }` (from `--browser` flag)
     * - `object`: detailed browser config (from `--browser.*` options)
     */ browser?: boolean | {
        enabled?: boolean;
        name?: BrowserName;
        headless?: boolean;
        port?: number;
        strictPort?: boolean;
        providerOptions?: Record<string, unknown>;
    };
    isolate?: boolean;
    include?: string[];
    exclude?: string[];
    reporters?: string | string[];
    project?: string[];
    /**
     * Coverage options.
     * - `boolean`: shorthand for `{ enabled: boolean }` (from `--coverage` flag)
     * - `object`: detailed coverage config (from `--coverage.*` options)
     */ coverage?: boolean | {
        enabled?: boolean | string;
        allowExternal?: boolean;
        provider?: 'istanbul' | 'v8';
        include?: string | string[];
        changed?: boolean | string;
        exclude?: string | string[];
        reporters?: string | string[];
        reportsDirectory?: string;
        reportOnFailure?: boolean | string;
        clean?: boolean | string;
    };
    passWithNoTests?: boolean;
    onlyFailures?: boolean;
    silent?: boolean | 'passed-only';
    printConsoleTrace?: boolean;
    logHeapUsage?: boolean;
    detectAsyncLeaks?: boolean;
    trace?: boolean;
    disableConsoleIntercept?: boolean;
    update?: boolean;
    testNamePattern?: RegExp | string;
    testTimeout?: number;
    hookTimeout?: number;
    testEnvironment?: string;
    clearMocks?: boolean;
    resetMocks?: boolean;
    restoreMocks?: boolean;
    unstubGlobals?: boolean;
    unstubEnvs?: boolean;
    retry?: number;
    maxConcurrency?: number;
    slowTestThreshold?: number;
    hideSkippedTests?: boolean;
    hideSkippedTestFiles?: boolean;
    bail?: number | boolean;
    shard?: string;
    includeTaskLocation?: boolean;
    federation?: boolean;
    source?: {
        tsconfigPath?: string;
    };
    dev?: {
        writeToDisk?: boolean;
    };
    output?: Pick<RstestOutputConfig, 'emitAssets' | 'cleanDistPath' | 'module'>;
};

/**
 * compare function used when sorting object keys, `null` can be used to skip over sorting.
 */
declare type CompareKeys = ((a: string, b: string) => number) | null | undefined;

declare interface Config {
    	callToJSON: boolean;
    	compareKeys: CompareKeys;
    	colors: Colors;
    	escapeRegex: boolean;
    	escapeString: boolean;
    	indent: string;
    	maxDepth: number;
    	maxWidth: number;
    	min: boolean;
    	plugins: Plugins;
    	printBasicPrototype: boolean;
    	printFunctionName: boolean;
    	printShadowRoot: boolean;
    	spacingInner: string;
    	spacingOuter: string;
    	maxOutputLength: number;
}

declare type Config_2 = {
    now?: number | Date | TemporalTimelike;
    toFake?: FakeMethod[];
    toNotFake?: FakeMethod[];
    loopLimit?: number;
    shouldAdvanceTime?: boolean;
    advanceTimeDelta?: number;
    shouldClearNativeTimers?: boolean;
    ignoreMissingTimers?: boolean;
    target?: GlobalObject;
};

/** The stdio stream a console log was written to */ declare type ConsoleStreamType = 'stdout' | 'stderr';

declare interface Constructable {
    	new (...args: any[]): any;
}

declare type Constructor<T = any> = new(...args: any[]) => T;

declare type ConstructSignature<T> = [T] extends [new(...args: infer A) => infer R] ? new(...args: A) => R : unknown;

/**
 * Base class for writing content
 */
declare class ContentWriter {
    /**
     * returns the colorized version of a string. Typically,
     * content writers that write to files will return the
     * same string and ones writing to a tty will wrap it in
     * appropriate escape sequences.
     */
    colorize(str: string, clazz?: string): string;
    /**
     * writes a string appended with a newline to the destination
     */
    println(str: string): void;
    /**
     * closes this content writer. Should be called after all writes are complete.
     */
    close(): void;
}

declare interface Context {
    data: any;
    dir: string;
    sourceFinder(filepath: string): string;
    watermarks: Watermarks;
    writer: FileWriter;
    /**
     * returns the coverage class given a coverage
     * types and a percentage value.
     */
    classForPercent(type: keyof Watermarks, value: number): string;
    /**
     * returns the source code for the specified file path or throws if
     * the source could not be found.
     */
    getSource(filepath: string): string;
    getTree(summarizer?: Summarizers): Tree;
    /**
     * returns a full visitor given a partial one.
     */
    getVisitor<N extends Node_2 = Node_2>(visitor: Partial<Visitor<N>>): Visitor<N>;
    /**
     * returns a FileWriter implementation for reporting use. Also available
     * as the `writer` property on the context.
     */
    getWriter(): FileWriter;
    /**
     * returns an XML writer for the supplied content writer
     */
    getXmlWriter(contentWriter: ContentWriter): XmlWriter;
}

declare class CounterMap<K> extends DefaultMap<K, number> {
    	constructor();
    	_total: number | undefined;
    	valueOf(): number;
    	increment(key: K): void;
    	total(): number;
}

declare type CountTimers = () => number;

declare interface Coverage {
    covered: number;
    total: number;
    coverage: number;
}

declare type CoverageCollectOptions = {
    assetFiles?: Record<string, string>;
    sourceMaps?: Record<string, string>;
    outputModule?: boolean;
};

declare class CoverageMap {
    constructor(data: CoverageMapData | CoverageMap);
    addFileCoverage(pathOrObject: string | FileCoverage | FileCoverageData): void;
    files(): string[];
    fileCoverageFor(filename: string): FileCoverage;
    filter(callback: (key: string) => boolean): void;
    getCoverageSummary(): CoverageSummary;
    merge(data: CoverageMapData | CoverageMap): void;
    toJSON(): CoverageMapData;
    data: CoverageMapData;
}

declare interface CoverageMapData {
    [key: string]: FileCoverage | FileCoverageData;
}

export declare type CoverageOptions = {
    /**
     * Enable coverage collection.
     * @default false
     */ enabled?: boolean;
    /**
     * A list of glob patterns that should be included for coverage collection.
     * Only collect coverage for tested files by default.
     *
     * @default undefined
     */ include?: string[];
    /**
     * Collect coverage only for files changed since a specified commit or branch.
     * When enabled from `--changed`, it inherits the changed files collected by `--changed`.
     *
     * @default undefined
     */ changed?: boolean | string;
    /**
     * A list of glob patterns that should be excluded from coverage collection.
     *
     * This option accepts an array of wax(https://crates.io/crates/wax)-compatible glob patterns
     *
     * @default ['**\/node_modules/**',
     *           '**\/__tests__/**',
     *           '**\/__mocks__/**',
     *           '**\/*.d.ts',
     *           '**\/*.{test,spec}.[jt]s',
     *           '**\/*.{test,spec}.[cm][jt]s',
     *           '**\/*.{test,spec}.[jt]sx',
     *           '**\/*.{test,spec}.[cm][jt]sx'
     * ]
     */ exclude?: string[];
    /**
     * The provider to use for coverage collection.
     * @default 'istanbul'
     */ provider?: 'istanbul' | 'v8';
    /**
     * The reporters to use for coverage collection.
     * Supports built-in istanbul reporters and custom reporters (e.g., '@canyonjs/report-html').
     * @default ['text', 'html', 'clover', 'json']
     * @example
     * // Built-in reporters
     * reporters: ['text', 'html', ['json', { file: 'coverage.json' }]]
     *
     * // Custom reporters
     * reporters: ['@canyonjs/report-html', ['custom-reporter', { outputDir: './reports' }]]
     *
     * // Mixed usage
     * reporters: ['text', '@canyonjs/report-html', ['html', { subdir: 'html-report' }]]
     */ reporters?: SupportedReporter[];
    /**
     * The directory to store coverage reports.
     * @default './coverage'
     */ reportsDirectory?: string;
    /**
     * Whether to clean the coverage directory before running tests.
     * @default true
     */ clean?: boolean;
    /**
     * Coverage thresholds
     *
     * @default undefined
     */ thresholds?: CoverageThresholds;
    /**
     * Whether to report coverage when tests fail.
     * @default false
     */ reportOnFailure?: boolean;
    /**
     * Whether to collect coverage for source files outside the project root directory.
     * This is useful in monorepo setups where tests import modules from sibling packages.
     * @default false
     */ allowExternal?: boolean;
};

export declare class CoverageProvider {
    constructor(options: NormalizedCoverageOptions, root?: string);
    /**
     * Initialize coverage collection
     */ init(): void | Promise<void>;
    /**
     * Collect coverage data into an Istanbul coverage map.
     */ collect(options?: CoverageCollectOptions): CoverageMap | null | Promise<CoverageMap | null>;
    /**
     * Collect lightweight, serializable raw coverage payloads in workers.
     *
     * Providers may implement this with `resolveRawCoverage` to defer expensive
     * conversion work to the main process. Return `null` to indicate that no raw
     * coverage was collected and the runner should not call `resolveRawCoverage`
     * for that worker result.
     *
     * @internal
     */ collectRaw?(options?: CoverageCollectOptions): unknown | null | Promise<unknown | null>;
    /**
     * Resolve raw payloads produced by `collectRaw` into an Istanbul coverage map.
     *
     * The runner passes only non-null payloads returned by the same provider.
     * Payloads are internal transfer objects and may be consumed during
     * resolution.
     * Implementations should ignore malformed payloads only when they can still
     * produce a valid partial report; otherwise they may reject to fail coverage
     * finalization.
     *
     * @internal
     */ resolveRawCoverage?(payloads: unknown[], options?: RawCoverageResolveOptions): CoverageMap | null | Promise<CoverageMap | null>;
    /**
     * Create a new coverage map
     */ createCoverageMap(): CoverageMap;
    /**
     * Generate coverage for untested files
     */ generateCoverageForUntestedFiles(params: {
        environmentName: string;
        files: string[];
    }): Promise<FileCoverageData[]>;
    /**
     * Generate coverage reports.
     *
     * Reporters and output directory come from the normalized options the
     * provider received at construction — there is no per-call override, so a
     * provider cannot silently ignore a second argument that drifts away from the
     * constructor config.
     */ generateReports(coverageMap: CoverageMap): Promise<void>;
    /**
     * Clean up coverage data
     */ cleanup(): void;
}

declare class CoverageSummary {
    constructor(data: CoverageSummary | CoverageSummaryData);
    merge(obj: CoverageSummary): CoverageSummary;
    toJSON(): CoverageSummaryData;
    isEmpty(): boolean;
    data: CoverageSummaryData;
    lines: Totals;
    statements: Totals;
    branches: Totals;
    functions: Totals;
}

declare interface CoverageSummaryData {
    lines: Totals;
    statements: Totals;
    branches: Totals;
    functions: Totals;
}

declare type CoverageThreshold = {
    /** Threshold for statements */ statements?: number;
    /** Threshold for functions */ functions?: number;
    /** Threshold for branches */ branches?: number;
    /** Threshold for lines */ lines?: number;
};

declare type CoverageThresholds = CoverageThreshold | (CoverageThreshold & ThresholdGlobRecord);

export declare function createRstest({ config, projects, configFilePath, trace, cwd, embedded }: {
    config: RstestConfig;
    configFilePath?: string;
    projects: Project[];
    /** CLI-only `--trace` switch; not exposed via user config. */ trace?: boolean;
    /** Working directory; defaults to `process.cwd()`. */ cwd?: string;
    /**
     * When true, Rstest won't install `process.on('exit' | 'SIG*')` handlers
     * and config errors throw instead of calling `process.exit()`, so a
     * programmatic run can't kill the host process. (`process.exitCode` is
     * still written; `runRstest` restores it via try/finally.) Set by the
     * `@rstest/core/api` adapter.
     */ embedded?: boolean;
}, command: RstestCommand, fileFilters: string[], fileFilterMode?: FileFilterMode): RstestInstance;

declare interface CustomMatcher {
    	/**
     	* Checks that a value satisfies a custom matcher function.
     	*
     	* @param matcher - A function returning a boolean based on the custom condition
     	* @param message - Optional custom error message on failure
     	*
     	* @example
     	* expect(age).toSatisfy(val => val >= 18, 'Age must be at least 18');
     	* expect(age).toEqual(expect.toSatisfy(val => val >= 18, 'Age must be at least 18'));
     	*/
    	toSatisfy: (matcher: (value: any) => boolean, message?: string) => any;
    	/**
     	* Matches if the received value is one of the values in the expected array or set.
     	*
     	* @example
     	* expect(1).toBeOneOf([1, 2, 3])
     	* expect('foo').toBeOneOf([expect.any(String)])
     	* expect({ a: 1 }).toEqual({ a: expect.toBeOneOf(['1', '2', '3']) })
     	*/
    	toBeOneOf: <T>(sample: Array<T> | Set<T>) => any;
}

/** Custom reporter configuration for non-istanbul reporters */ declare type CustomReporter = string | [string, Record<string, unknown>];

declare interface DecodedSourceMap extends SourceMapV3 {
    mappings: SourceMapSegment[][];
}

declare type DecodedSourceMapXInput = DecodedSourceMap & XInput;

declare type DeeplyAllowMatchers<T> = T extends Array<infer Element> ? WithAsymmetricMatcher<T> | DeeplyAllowMatchers<Element>[] : T extends object ? WithAsymmetricMatcher<T> | { [K in keyof T] : DeeplyAllowMatchers<T[K]> } : WithAsymmetricMatcher<T>;

/**
 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

declare class DefaultMap<
	K,
	V
> extends Map<K, V> {
    	private defaultFn;
    	constructor(defaultFn: (key: K) => V, entries?: Iterable<readonly [K, V]>);
    	get(key: K): V;
}

declare type DefaultReporterOptions = {
    /**
     * prints out summary of all tests
     * @default true
     */ summary?: boolean;
    /**
     * logger which write messages to
     * @default process.stdout/process.stderr
     */ logger?: Options['logger'];
    /**
     * prints out project name in test file title
     * show project name by default when running multiple projects
     */ showProjectName?: boolean;
};

/**
 * This function helps you to autocomplete configuration types.
 * It accepts a Rstest config object, or a function that returns a config.
 */ export declare function defineConfig<const Config extends RstestConfig>(config: () => Config): RstestConfigSyncFn;

export declare function defineConfig<const Config extends RstestConfig>(config: () => Promise<Config>): RstestConfigAsyncFn;

export declare function defineConfig(config: RstestConfig): RstestConfig;

export declare function defineConfig(config: RstestConfigExport): RstestConfigExport;

/**
 * This function helps you to autocomplete inline project configuration types.
 */ export declare function defineInlineProject(config: InlineProjectConfig): InlineProjectConfig;

/**
 * This function helps you to autocomplete project configuration types.
 * It accepts an inline or nested Rstest project config object, or a function that returns one.
 */ export declare function defineProject<const Config extends RstestProjectConfig>(config: () => Config): Config extends NestedProjectConfig ? NestedProjectConfigSyncFn : ProjectConfigSyncFn;

export declare function defineProject<const Config extends RstestProjectConfig>(config: () => Promise<Config>): Config extends NestedProjectConfig ? NestedProjectConfigAsyncFn : ProjectConfigAsyncFn;

export declare function defineProject(config: ExportedProjectConfig): ExportedProjectConfig;

export declare function defineProject(config: NestedProjectConfig): NestedProjectConfig;

export declare type Describe = DescribeFn & {
    each: DescribeEachFn;
    for: DescribeForFn;
    only: Describe;
    skip: Describe;
    runIf: (condition: boolean) => Describe;
    skipIf: (condition: boolean) => Describe;
    todo: Describe;
    concurrent: Describe;
    sequential: Describe;
};

export declare const describe: Rstest['describe'];

/**
 * The two accepted call shapes for `describe` and the functions returned by
 * `describe.each` / `describe.for`, mirroring `TestCall`:
 * - `(name, fn, timeout?)` — suite function second, optional numeric timeout last.
 * - `(name, options, fn?)` — `TestOptions` object as the second argument.
 *
 * Suite-level options propagate to descendant cases as inheritable defaults.
 */ declare type DescribeCall<Fn> = {
    (description: string, fn?: Fn, timeout?: number) : void;
    (description: string, options: TestOptions, fn?: Fn) : void;
};

declare interface DescribeEachFn {
    <T extends Record<string, unknown>>(cases: readonly T[]) : DescribeCall<(param: T) => MaybePromise<void>>;
    <T extends readonly [unknown, ...unknown[]]>(cases: readonly T[]) : DescribeCall<(...args: [...T]) => MaybePromise<void>>;
    <T>(cases: readonly T[]) : DescribeCall<(param: T) => MaybePromise<void>>;
    <T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]) : DescribeCall<(param: T) => MaybePromise<void>>;
}

declare type DescribeFn = DescribeCall<() => MaybePromise<void>>;

declare interface DescribeForFn {
    <T>(cases: readonly T[]) : DescribeCall<(param: T) => MaybePromise<void>>;
    <T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]) : DescribeCall<(param: T) => MaybePromise<void>>;
}

/**
 * Device presets aligned with Chrome DevTools device toolbar.
 *
 * These values are stable identifiers (not user-facing labels).
 *
 * IMPORTANT: Keep this union in sync with
 * `@rstest/browser` preset runtime source:
 * `packages/browser/src/viewportPresets.ts`.
 *
 * `@rstest/core` owns `defineConfig` typing, while `@rstest/browser` owns
 * runtime validation and resolution for preset ids.
 */ declare type DevicePreset = 'iPhoneSE' | 'iPhoneXR' | 'iPhone12Pro' | 'iPhone14ProMax' | 'Pixel7' | 'SamsungGalaxyS8Plus' | 'SamsungGalaxyS20Ultra' | 'iPadMini' | 'iPadAir' | 'iPadPro' | 'SurfacePro7' | 'SurfaceDuo' | 'GalaxyZFold5' | 'AsusZenbookFold' | 'SamsungGalaxyA51A71' | 'NestHub' | 'NestHubMax';

/**
 * @param a Expected value
 * @param b Received value
 * @param options Diff options
 * @returns {string | null} a string diff
 */
declare function diff(a: any, b: any, options?: DiffOptions, memorize?: Memorize): string | undefined;

declare interface DiffOptions {
    	aAnnotation?: string;
    	aColor?: DiffOptionsColor;
    	aIndicator?: string;
    	bAnnotation?: string;
    	bColor?: DiffOptionsColor;
    	bIndicator?: string;
    	changeColor?: DiffOptionsColor;
    	changeLineTrailingSpaceColor?: DiffOptionsColor;
    	commonColor?: DiffOptionsColor;
    	commonIndicator?: string;
    	commonLineTrailingSpaceColor?: DiffOptionsColor;
    	contextLines?: number;
    	emptyFirstOrLastLinePlaceholder?: string;
    	expand?: boolean;
    	includeChangeCounts?: boolean;
    	omitAnnotationLines?: boolean;
    	patchColor?: DiffOptionsColor;
    	printBasicPrototype?: boolean;
    	maxDepth?: number;
    	compareKeys?: CompareKeys;
    	truncateThreshold?: number;
    	truncateAnnotation?: string;
    	truncateAnnotationColor?: DiffOptionsColor;
}

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

declare type DiffOptionsColor = (arg: string) => string;

declare interface Disposable_2 {
    // @ts-ignore -- Symbol.dispose might not be in user types
    [Symbol.dispose]: () => void
}

declare type DisposableRstestUtilities = RstestUtilities & {
    /**
     * Restores the resource created by the current utility call when it leaves a `using` scope.
     */ [Symbol.dispose](): void;
};

declare interface DomainMatchResult {
    	pass: boolean;
    	message?: string;
    	/**
     	* The captured value viewed through the template's lens.
     	*
     	* Where the template uses patterns (e.g. regexes) or omits details,
     	* the resolved string adopts those patterns. Where the template doesn't
     	* match, the resolved string uses literal captured values instead.
     	*
     	* Used for two purposes:
     	* - **Diff display** (actual side): compared against `expected`
     	*   so the diff highlights only genuine mismatches, not pattern-vs-literal noise.
     	* - **Snapshot update** (`--update`): written as the new snapshot content,
     	*   preserving user-edited patterns from matched regions while incorporating
     	*   actual values for mismatched regions.
     	*
     	* When omitted, falls back to `render(capture(received))` (the raw rendered value).
     	*/
    	resolved?: string;
    	/**
     	* The stored template re-rendered as a string, representing what the user
     	* originally wrote or last saved.
     	*
     	* Used as the expected side in diff display.
     	*
     	* When omitted, falls back to the raw snapshot string from the snap file
     	* or inline snapshot.
     	*/
    	expected?: string;
}

declare type Duration = {
    totalTime: number;
    buildTime: number;
    testTime: number;
};

declare interface EncodedSourceMap extends SourceMapV3 {
    mappings: string;
}

declare type EncodedSourceMapXInput = EncodedSourceMap & XInput;

declare type EnvironmentName = 'node' | 'jsdom' | 'happy-dom';

declare type EnvironmentWithOptions = {
    name: EnvironmentName;
    options?: Record<string, any>;
};

export declare type Expect = ExpectStatic;

export declare const expect: Rstest['expect'];

declare type ExpectationResult = SyncExpectationResult | AsyncExpectationResult;

declare interface ExpectedSnapshot {
    	key: string;
    	count: number;
    	data?: string;
    	markAsChecked: () => void;
}

declare interface ExpectPollOptions {
    /**
     * @default 50
     */ interval?: number;
    /**
     * @default 1000
     */ timeout?: number;
    message?: string;
}

export declare interface ExpectStatic extends VitestExpectProperties {
    <T>(actual: T, message?: string) : Assertion<T>;
    unreachable: (message?: string) => never;
    soft: <T>(actual: T, message?: string) => Assertion<T>;
    poll: <T>(actual: () => T, options?: ExpectPollOptions) => Omit<PromisifyAssertion_2<Awaited<T>>, 'rejects' | 'resolves' | 'toThrow' | 'toThrowError' | 'throw' | 'throws' | 'matchSnapshot' | 'toMatchSnapshot' | 'toMatchInlineSnapshot' | 'toThrowErrorMatchingSnapshot' | 'toThrowErrorMatchingInlineSnapshot'>;
    addEqualityTesters: (testers: Tester[]) => void;
    assertions: (expected: number) => void;
    hasAssertions: () => void;
    addSnapshotSerializer: typeof addSerializer;
    getState: () => MatcherState_2;
    setState: (state: Partial<MatcherState_2>) => void;
}

declare interface ExpectStatic_2 extends Chai.ExpectStatic, Matchers, AsymmetricMatchersContaining {
    	<T>(actual: T, message?: string): Assertion_2<T>;
    	extend: (expects: MatchersObject) => void;
    	anything: () => any;
    	any: (constructor: unknown) => any;
    	getState: () => MatcherState;
    	setState: (state: Partial<MatcherState>) => void;
    	not: AsymmetricMatchersContaining;
}

declare type ExportedProjectConfig = ProjectConfig;

export declare type ExtendConfig = Omit<LooseRstestConfig, 'projects'>;

export declare type ExtendConfigFn = (userConfig: Readonly<LooseRstestConfig>) => MaybePromise<ExtendConfig>;

declare type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime" | "requestAnimationFrame" | "cancelAnimationFrame" | "requestIdleCallback" | "cancelIdleCallback" | "performance" | "queueMicrotask" | "Intl" | "Temporal";

declare type FakeTimerSystemTime = Parameters<Clock['setSystemTime']>[0];

declare type FakeTimerTickMode = Parameters<Clock['setTickMode']>[0];

declare type FakeTimerTickTime = Parameters<Clock['tick']>[0];

declare type Falsy = false | 0 | 0n | '' | null | undefined;

declare class FileCoverage implements FileCoverageData {
    constructor(data: string | FileCoverage | FileCoverageData);
    merge(other: FileCoverageData): void;
    getBranchCoverageByLine(): { [line: number]: Coverage };
    getLineCoverage(): { [line: number]: number };
    getUncoveredLines(): number[];
    resetHits(): void;
    computeBranchTotals(): Totals;
    computeSimpleTotals(): Totals;
    toSummary(): CoverageSummary;
    toJSON(): object;

    data: FileCoverageData;
    path: string;
    statementMap: { [key: string]: Range_2 };
    fnMap: { [key: string]: FunctionMapping };
    branchMap: { [key: string]: BranchMapping };
    s: { [key: string]: number };
    f: { [key: string]: number };
    b: { [key: string]: number[] };
}

declare interface FileCoverageData {
    path: string;
    statementMap: { [key: string]: Range_2 };
    fnMap: { [key: string]: FunctionMapping };
    branchMap: { [key: string]: BranchMapping };
    s: { [key: string]: number };
    f: { [key: string]: number };
    b: { [key: string]: number[] };
}

declare type FileFilterMode = 'fuzzy' | 'exact';

declare interface FileOptions {
    file: string;
}

/**
 * utility for writing files under a specific directory
 */
declare class FileWriter {
    constructor(baseDir: string);
    static startCapture(): void;
    static stopCapture(): void;
    static getOutput(): string;
    static resetOutput(): void;
    /**
     * returns a FileWriter that is rooted at the supplied subdirectory
     */
    writeForDir(subdir: string): FileWriter;
    /**
     * copies a file from a source directory to a destination name
     */
    copyFile(source: string, dest: string, header?: string): void;
    /**
     * returns a content writer for writing content to the supplied file.
     */
    writeFile(file: string | null): ContentWriter;
}

declare type Fixture<T, K extends keyof T, ExtraContext = object> = ((...args: any) => any) extends T[K] ? T[K] extends any ? FixtureFn<T, K, Omit<ExtraContext, Exclude<keyof T, K>>> : never : T[K] | (T[K] extends any ? FixtureFn<T, K, Omit<ExtraContext, Exclude<keyof T, K>>> : never);

declare type FixtureFn<T, K extends keyof T, ExtraContext> = (context: Omit<T, K> & ExtraContext, use: Use<T[K]>) => Promise<void>;

declare interface FixtureOptions {
    /**
     * Whether to automatically set up current fixture, even though it's not being used in tests.
     */ auto?: boolean;
}

export declare type Fixtures<T extends Record<string, any> = object, ExtraContext = object> = {
    [K in keyof T]: Fixture<T, K, ExtraContext & TestContext> | [Fixture<T, K, ExtraContext & TestContext>, FixtureOptions?];
};

declare type FormattedError = {
    fullStack?: boolean;
    message: string;
    name?: string;
    stack?: string;
    diff?: string;
    expected?: string;
    actual?: string;
    retryCount?: number;
};

declare interface Formatter {
    (input?: unknown): string;
    open: string;
    close: string;
}

declare type FunctionLike = (...args: any) => any;

declare interface FunctionMapping {
    name: string;
    decl: Range_2;
    loc: Range_2;
    line: number;
}

declare type GeneratedColumn = number;

declare function getMatcherUtils(): {
    	EXPECTED_COLOR: Formatter;
    	RECEIVED_COLOR: Formatter;
    	INVERTED_COLOR: Formatter;
    	BOLD_WEIGHT: Formatter;
    	DIM_COLOR: Formatter;
    	diff: typeof diff;
    	matcherHint: typeof matcherHint;
    	printReceived: typeof printReceived;
    	printExpected: typeof printExpected;
    	printDiffOrStringify: typeof printDiffOrStringify;
    	printWithType: typeof printWithType;
};

declare type GetSourcemap = (sourcePath: string) => Promise<SourceMapInput | null>;

declare type GithubActionsReporterOptions = {
    /**
     * Whether to output `::error` annotations for failed tests.
     * @default true
     */ annotations?: boolean;
    /**
     * Whether to append a Markdown summary to `GITHUB_STEP_SUMMARY`.
     * @default true
     */ summary?: boolean;
};

declare type GlobalObject = Record<string, any> & {
    setTimeout?: SetTimeout;
    clearTimeout?: ClearTimeout;
    setInterval?: SetInterval;
    clearInterval?: ClearInterval;
    setImmediate?: SetImmediate;
    clearImmediate?: ClearImmediate;
    queueMicrotask?: QueueMicrotask;
    requestAnimationFrame?: RequestAnimationFrame;
    cancelAnimationFrame?: CancelAnimationFrame;
    requestIdleCallback?: RequestIdleCallback;
    cancelIdleCallback?: CancelIdleCallback;
    process?: any;
    performance?: any;
    Performance?: any;
    Intl?: any;
    Temporal?: any;
    Promise?: typeof Promise;
    Date: typeof Date & {
        isFake?: boolean;
        toSource?: () => string;
        clock?: any;
    };
};

declare type Hrtime = (prev?: Array<number>) => Array<number>;

declare interface HtmlOptions {
    verbose: boolean;
    skipEmpty: boolean;
    subdir: string;
    linkMapper: LinkMapper;
}

declare interface HtmlSpaOptions extends HtmlOptions {
    metricsToShow: Array<"lines" | "branches" | "functions" | "statements">;
}

declare type IdleDeadline_2 = {
    didTimeout: boolean;
    timeRemaining: TimeRemaining;
};

declare type Indent = (arg0: string) => string;

export declare function initCli(options: CommonOptions): Promise<{
    config: RstestConfig;
    configFilePath?: string;
    projects: Project[];
}>;

/**
 * A list of glob patterns or files that match your test projects.
 *
 * eg. ['packages/*', 'examples/node/rstest.config.ts']
 */ /**
 * Inline project config must include a name.
 */ declare type InlineProjectConfig = ProjectConfig & {
    name: string;
};

declare interface InlineSnapshotMatcher<T> {
    <U extends {
        [P in keyof T]: any;
    }>(properties: Partial<U>, snapshot?: string, message?: string) : void;
    (message?: string) : void;
}

declare type IntlWithClock = Record<string, any> & {
    clock: Clock;
};

export declare const it: Rstest['it'];

declare interface JestAssertion<T = any> extends jest.Matchers<void, T>, CustomMatcher {
    	/**
     	* Used when you want to check that two objects have the same value.
     	* This matcher recursively checks the equality of all fields, rather than checking for object identity.
     	*
     	* @example
     	* expect(user).toEqual({ name: 'Alice', age: 30 });
     	*/
    	toEqual: <E>(expected: E) => void;
    	/**
     	* Use to test that objects have the same types as well as structure.
     	*
     	* @example
     	* expect(user).toStrictEqual({ name: 'Alice', age: 30 });
     	*/
    	toStrictEqual: <E>(expected: E) => void;
    	/**
     	* Checks that a value is what you expect. It calls `Object.is` to compare values.
     	* Don't use `toBe` with floating-point numbers.
     	*
     	* @example
     	* expect(result).toBe(42);
     	* expect(status).toBe(true);
     	*/
    	toBe: <E>(expected: E) => void;
    	/**
     	* Check that a string matches a regular expression.
     	*
     	* @example
     	* expect(message).toMatch(/hello/);
     	* expect(greeting).toMatch('world');
     	*/
    	toMatch: (expected: string | RegExp) => void;
    	/**
     	* Used to check that a JavaScript object matches a subset of the properties of an object
     	*
     	* @example
     	* expect(user).toMatchObject({
     	*   name: 'Alice',
     	*   address: { city: 'Wonderland' }
     	* });
     	*/
    	toMatchObject: <E extends object | any[]>(expected: E) => void;
    	/**
     	* Used when you want to check that an item is in a list.
     	* For testing the items in the list, this uses `===`, a strict equality check.
     	*
     	* @example
     	* expect(items).toContain('apple');
     	* expect(numbers).toContain(5);
     	*/
    	toContain: <E>(item: E) => void;
    	/**
     	* Used when you want to check that an item is in a list.
     	* For testing the items in the list, this matcher recursively checks the
     	* equality of all fields, rather than checking for object identity.
     	*
     	* @example
     	* expect(items).toContainEqual({ name: 'apple', quantity: 1 });
     	*/
    	toContainEqual: <E>(item: E) => void;
    	/**
     	* Use when you don't care what a value is, you just want to ensure a value
     	* is true in a boolean context. In JavaScript, there are six falsy values:
     	* `false`, `0`, `''`, `null`, `undefined`, and `NaN`. Everything else is truthy.
     	*
     	* @example
     	* expect(user.isActive).toBeTruthy();
     	*/
    	toBeTruthy: () => void;
    	/**
     	* When you don't care what a value is, you just want to
     	* ensure a value is false in a boolean context.
     	*
     	* @example
     	* expect(user.isActive).toBeFalsy();
     	*/
    	toBeFalsy: () => void;
    	/**
     	* For comparing floating point numbers.
     	*
     	* @example
     	* expect(score).toBeGreaterThan(10);
     	*/
    	toBeGreaterThan: (num: number | bigint) => void;
    	/**
     	* For comparing floating point numbers.
     	*
     	* @example
     	* expect(score).toBeGreaterThanOrEqual(10);
     	*/
    	toBeGreaterThanOrEqual: (num: number | bigint) => void;
    	/**
     	* For comparing floating point numbers.
     	*
     	* @example
     	* expect(score).toBeLessThan(10);
     	*/
    	toBeLessThan: (num: number | bigint) => void;
    	/**
     	* For comparing floating point numbers.
     	*
     	* @example
     	* expect(score).toBeLessThanOrEqual(10);
     	*/
    	toBeLessThanOrEqual: (num: number | bigint) => void;
    	/**
     	* Used to check that a variable is NaN.
     	*
     	* @example
     	* expect(value).toBeNaN();
     	*/
    	toBeNaN: () => void;
    	/**
     	* Used to check that a variable is undefined.
     	*
     	* @example
     	* expect(value).toBeUndefined();
     	*/
    	toBeUndefined: () => void;
    	/**
     	* This is the same as `.toBe(null)` but the error messages are a bit nicer.
     	* So use `.toBeNull()` when you want to check that something is null.
     	*
     	* @example
     	* expect(value).toBeNull();
     	*/
    	toBeNull: () => void;
    	/**
     	* Used to check that a variable is nullable (null or undefined).
     	*
     	* @example
     	* expect(value).toBeNullable();
     	*/
    	toBeNullable: () => void;
    	/**
     	* Ensure that a variable is not undefined.
     	*
     	* @example
     	* expect(value).toBeDefined();
     	*/
    	toBeDefined: () => void;
    	/**
     	* Ensure that an object is an instance of a class.
     	* This matcher uses `instanceof` underneath.
     	*
     	* @example
     	* expect(new Date()).toBeInstanceOf(Date);
     	*/
    	toBeInstanceOf: <E>(expected: E) => void;
    	/**
     	* Used to check that an object has a `.length` property
     	* and it is set to a certain numeric value.
     	*
     	* @example
     	* expect([1, 2, 3]).toHaveLength(3);
     	* expect('hello').toHaveLength(5);
     	*/
    	toHaveLength: (length: number) => void;
    	/**
     	* Use to check if a property at the specified path exists on an object.
     	* For checking deeply nested properties, you may use dot notation or an array containing
     	* the path segments for deep references.
     	*
     	* Optionally, you can provide a value to check if it matches the value present at the path
     	* on the target object. This matcher uses 'deep equality' (like `toEqual()`) and recursively checks
     	* the equality of all fields.
     	*
     	* @example
     	* expect(user).toHaveProperty('address.city', 'New York');
     	* expect(config).toHaveProperty(['settings', 'theme'], 'dark');
     	*/
    	toHaveProperty: <E>(property: string | (string | number)[], value?: E) => void;
    	/**
     	* Using exact equality with floating point numbers is a bad idea.
     	* Rounding means that intuitive things fail.
     	* The default for `numDigits` is 2.
     	*
     	* @example
     	* expect(price).toBeCloseTo(9.99, 2);
     	*/
    	toBeCloseTo: (number: number, numDigits?: number) => void;
    	/**
     	* Ensures that a mock function is called an exact number of times.
     	*
     	* Also under the alias `expect.toBeCalledTimes`.
     	*
     	* @example
     	* expect(mockFunc).toHaveBeenCalledTimes(2);
     	*/
    	toHaveBeenCalledTimes: (times: number) => void;
    	/**
     	* Ensures that a mock function is called an exact number of times.
     	*
     	* Alias for `expect.toHaveBeenCalledTimes`.
     	*
     	* @example
     	* expect(mockFunc).toBeCalledTimes(2);
     	* @deprecated Use `toHaveBeenCalledTimes` instead
     	*/
    	toBeCalledTimes: (times: number) => void;
    	/**
     	* Ensures that a mock function is called.
     	*
     	* Also under the alias `expect.toBeCalled`.
     	*
     	* @example
     	* expect(mockFunc).toHaveBeenCalled();
     	*/
    	toHaveBeenCalled: () => void;
    	/**
     	* Ensures that a mock function is called.
     	*
     	* Alias for `expect.toHaveBeenCalled`.
     	*
     	* @example
     	* expect(mockFunc).toBeCalled();
     	* @deprecated Use `toHaveBeenCalled` instead
     	*/
    	toBeCalled: () => void;
    	/**
     	* Ensure that a mock function is called with specific arguments.
     	*
     	* Also under the alias `expect.toBeCalledWith`.
     	*
     	* @example
     	* expect(mockFunc).toHaveBeenCalledWith('arg1', 42);
     	*/
    	toHaveBeenCalledWith: <E extends any[]>(...args: E) => void;
    	/**
     	* Ensure that a mock function is called with specific arguments.
     	*
     	* Alias for `expect.toHaveBeenCalledWith`.
     	*
     	* @example
     	* expect(mockFunc).toBeCalledWith('arg1', 42);
     	* @deprecated Use `toHaveBeenCalledWith` instead
     	*/
    	toBeCalledWith: <E extends any[]>(...args: E) => void;
    	/**
     	* Ensure that a mock function is called with specific arguments on an Nth call.
     	*
     	* Also under the alias `expect.nthCalledWith`.
     	*
     	* @example
     	* expect(mockFunc).toHaveBeenNthCalledWith(2, 'secondArg');
     	*/
    	toHaveBeenNthCalledWith: <E extends any[]>(n: number, ...args: E) => void;
    	/**
     	* If you have a mock function, you can use `.toHaveBeenLastCalledWith`
     	* to test what arguments it was last called with.
     	*
     	* Also under the alias `expect.lastCalledWith`.
     	*
     	* @example
     	* expect(mockFunc).toHaveBeenLastCalledWith('lastArg');
     	*/
    	toHaveBeenLastCalledWith: <E extends any[]>(...args: E) => void;
    	/**
     	* Used to test that a function throws when it is called.
     	*
     	* Also under the alias `expect.toThrowError`.
     	*
     	* @example
     	* expect(() => functionWithError()).toThrow('Error message');
     	* expect(() => parseJSON('invalid')).toThrow(SyntaxError);
     	* expect(() => { throw 42 }).toThrow(42);
     	*/
    	toThrow: (expected?: any) => void;
    	/**
     	* Used to test that a function throws when it is called.
     	*
     	* Alias for `expect.toThrow`.
     	*
     	* @example
     	* expect(() => functionWithError()).toThrowError('Error message');
     	* expect(() => parseJSON('invalid')).toThrowError(SyntaxError);
     	* expect(() => { throw 42 }).toThrowError(42);
     	* @deprecated Use `toThrow` instead
     	*/
    	toThrowError: (expected?: any) => void;
    	/**
     	* Use to test that the mock function successfully returned (i.e., did not throw an error) at least one time
     	*
     	* Alias for `expect.toHaveReturned`.
     	*
     	* @example
     	* expect(mockFunc).toReturn();
     	* @deprecated Use `toHaveReturned` instead
     	*/
    	toReturn: () => void;
    	/**
     	* Use to test that the mock function successfully returned (i.e., did not throw an error) at least one time
     	*
     	* Also under the alias `expect.toReturn`.
     	*
     	* @example
     	* expect(mockFunc).toHaveReturned();
     	*/
    	toHaveReturned: () => void;
    	/**
     	* Use to ensure that a mock function returned successfully (i.e., did not throw an error) an exact number of times.
     	* Any calls to the mock function that throw an error are not counted toward the number of times the function returned.
     	*
     	* Alias for `expect.toHaveReturnedTimes`.
     	*
     	* @example
     	* expect(mockFunc).toReturnTimes(3);
     	* @deprecated Use `toHaveReturnedTimes` instead
     	*/
    	toReturnTimes: (times: number) => void;
    	/**
     	* Use to ensure that a mock function returned successfully (i.e., did not throw an error) an exact number of times.
     	* Any calls to the mock function that throw an error are not counted toward the number of times the function returned.
     	*
     	* Also under the alias `expect.toReturnTimes`.
     	*
     	* @example
     	* expect(mockFunc).toHaveReturnedTimes(3);
     	*/
    	toHaveReturnedTimes: (times: number) => void;
    	/**
     	* Use to ensure that a mock function returned a specific value.
     	*
     	* Alias for `expect.toHaveReturnedWith`.
     	*
     	* @example
     	* expect(mockFunc).toReturnWith('returnValue');
     	* @deprecated Use `toHaveReturnedWith` instead
     	*/
    	toReturnWith: <E>(value: E) => void;
    	/**
     	* Use to ensure that a mock function returned a specific value.
     	*
     	* Also under the alias `expect.toReturnWith`.
     	*
     	* @example
     	* expect(mockFunc).toHaveReturnedWith('returnValue');
     	*/
    	toHaveReturnedWith: <E>(value: E) => void;
    	/**
     	* Use to test the specific value that a mock function last returned.
     	* If the last call to the mock function threw an error, then this matcher will fail
     	* no matter what value you provided as the expected return value.
     	*
     	* Also under the alias `expect.lastReturnedWith`.
     	*
     	* @example
     	* expect(mockFunc).toHaveLastReturnedWith('lastValue');
     	*/
    	toHaveLastReturnedWith: <E>(value: E) => void;
    	/**
     	* Use to test the specific value that a mock function returned for the nth call.
     	* If the nth call to the mock function threw an error, then this matcher will fail
     	* no matter what value you provided as the expected return value.
     	*
     	* Also under the alias `expect.nthReturnedWith`.
     	*
     	* @example
     	* expect(mockFunc).toHaveNthReturnedWith(2, 'nthValue');
     	*/
    	toHaveNthReturnedWith: <E>(nthCall: number, value: E) => void;
}

declare type JsonOptions = FileOptions;

declare type JsonReporterOptions = {
    /**
     * Write report JSON to a file instead of stdout.
     */ outputPath?: string;
};

declare type JsonSummaryOptions = FileOptions;

declare type Jump = (tickValue: number | string | TemporalDuration) => number;

declare interface LcovOnlyOptions extends FileOptions, ProjectOptions {}

declare interface LcovOptions extends FileOptions, ProjectOptions {}

declare interface LinkMapper {
    getPath(node: string | Node_2): string;
    relativePath(source: string | Node_2, target: string | Node_2): string;
    assetPath(node: Node_2, name: string): string;
}

declare type ListCommandOptions = {
    filesOnly?: boolean;
    json?: boolean | string;
    includeSuites?: boolean;
    printLocation?: boolean;
    summary?: boolean;
};

declare type ListCommandResult = {
    tests: TestInfo[];
    testPath: string;
    project: string;
    errors?: FormattedError[];
};

export declare function loadConfig({ cwd, path, envMode, configLoader }: {
    cwd?: string;
    path?: string;
    envMode?: string;
    configLoader?: LoadConfigOptions['loader'];
}): Promise<{
    content: RstestConfig;
    filePath: string | null;
}>;

declare type Location_2 = {
    line: number;
    column: number;
};

declare interface Location_3 {
    line: number;
    column: number;
}

declare type LooseRstestConfig = Omit<RstestConfig, 'reporters'> & {
    reporters?: any;
};

declare function matcherHint(matcherName: string, received?: string, expected?: string, options?: MatcherHintOptions): string;

declare interface MatcherHintOptions {
    	comment?: string;
    	expectedColor?: Formatter;
    	isDirectExpectCall?: boolean;
    	isNot?: boolean;
    	promise?: string;
    	receivedColor?: Formatter;
    	secondArgument?: string;
    	secondArgumentColor?: Formatter;
}

export declare interface Matchers<T = any> {}

declare type MatchersObject<T extends MatcherState = MatcherState> = Record<string, RawMatcherFn<T>> & ThisType<T> & { [K in keyof Matchers<T>]? : RawMatcherFn<T, Parameters<Matchers<T>[K]>> };

declare interface MatcherState {
    	customTesters: Array<Tester>;
    	assertionCalls: number;
    	currentTestName?: string;
    	/**
     	* @deprecated exists only in types
     	*/
    	dontThrow?: () => void;
    	/**
     	* @deprecated exists only in types
     	*/
    	error?: Error;
    	equals: (a: unknown, b: unknown, customTesters?: Array<Tester>, strictCheck?: boolean) => boolean;
    	/**
     	* @deprecated exists only in types
     	*/
    	expand?: boolean;
    	expectedAssertionsNumber?: number | null;
    	expectedAssertionsNumberErrorGen?: (() => Error) | null;
    	isExpectingAssertions?: boolean;
    	isExpectingAssertionsError?: Error | null;
    	isNot: boolean;
    	promise: string;
    	/**
     	* @deprecated exists only in types
     	*/
    	suppressedErrors: Array<Error>;
    	testPath?: string;
    	utils: ReturnType<typeof getMatcherUtils> & {
        		diff: typeof diff;
        		stringify: typeof stringify;
        		iterableEquality: Tester;
        		subsetEquality: Tester;
        	};
    	soft?: boolean;
    	poll?: boolean;
    	/**
     	* The same assertion instance that chai plugins receive.
     	* @experimental
     	* @see {@link https://www.chaijs.com/guide/plugins/} Core Plugin Concepts
     	*/
    	readonly assertion: Assertion_2;
}

declare interface MatcherState_2 extends MatcherState {
    environment: string;
    snapshotState: SnapshotState;
}

declare type MaybeMockedDeep<T> = T extends Constructor ? MockedClassDeep<T> : T extends MockProcedure ? MockedFunctionDeep<T> : T extends object ? MockedObjectDeep<T> : T;

declare type MaybePartiallyMocked<T> = T extends Constructor ? MockedClass<T> : T extends MockProcedure ? MockedFunction<T> : T extends object ? MockedObject<T> : T;

declare type MaybePartiallyMockedDeep<T> = T extends Constructor ? MockedClassDeep<T> : T extends MockProcedure ? MockedFunctionDeep<T> : T extends object ? MockedObjectDeep<T> : T;

declare type MaybePromise<T> = T | Promise<T>;

declare type MdReporterOptions = {
    /**
     * Output detail level preset.
     * - `'normal'`: balanced output with code frames, repro commands, and candidate files
     * - `'compact'`: minimal output without code frames, candidate files, or full stack traces
     * - `'full'`: verbose output including console logs and environment info
     * @default 'normal'
     */ preset?: 'normal' | 'compact' | 'full';
    /**
     * Header section controls.
     * - `false`: omit all header extras (runtime/env)
     * - `true`: include all default header extras
     * - object form: toggle individual parts
     * @default { env: true }
     */ header?: boolean | {
        env?: boolean;
    };
    /**
     * Reproduction command controls.
     * - `false`: omit reproduction commands
     * - `'file'`: only include the test file path
     * - `'file+name'`: include both file path and `--testNamePattern`
     * - `true`: same as `'file+name'`
     * @default 'file+name'
     */ reproduction?: boolean | 'file' | 'file+name';
    /**
     * Test lists (Passed / Skipped / Todo) display mode.
     * - `'auto'`: show only when all tests pass and the run is focused
     * - `'always'`: always show regardless of test status or focus
     * @default 'auto'
     */ testLists?: 'auto' | 'always';
    /**
     * Failure output controls.
     * @default { max: 50 }
     */ failures?: {
        max?: number;
    };
    /**
     * Code frame controls.
     * - `false`: disable code frames
     * - `true`: enable with default line window
     * - object form: customize line window
     * @default { linesAbove: 2, linesBelow: 2 }
     */ codeFrame?: boolean | {
        linesAbove?: number;
        linesBelow?: number;
    };
    /**
     * Stack output controls.
     * - `false`: omit stack info
     * - `'top'`: include only the top frame
     * - `number`: include up to N stack frames
     * - `'full'`: include a large default number of stack frames
     * @default 'top'
     */ stack?: number | false | 'full' | 'top';
    /**
     * Candidate files controls (best-effort files extracted from stack traces).
     * - `false`: omit candidate files
     * - `true`: enable with defaults
     * - object form: customize max items
     * @default { max: 5 }
     */ candidateFiles?: boolean | {
        max?: number;
    };
    /**
     * Console output controls.
     * - `false`: omit console logs
     * - `true`: include console logs with defaults
     * - object form: customize limits
     * @default { maxLogsPerTestPath: 10, maxCharsPerEntry: 500 }
     */ console?: boolean | {
        maxLogsPerTestPath?: number;
        maxCharsPerEntry?: number;
    };
    /**
     * Error section controls.
     * @default { unhandled: true }
     */ errors?: boolean | {
        unhandled?: boolean;
    };
};

declare interface Memorize {
    	(pointer: "expected" | "actual", stringifiedValue: string): string;
}

export declare const mergeProjectConfig: (...configs: ProjectConfig[]) => ProjectConfig;

export declare const mergeRstestConfig: (...configs: RstestConfig[]) => RstestConfig;

declare type Methods<T> = {
    [K in keyof T]: T[K] extends MockProcedure ? K : never;
}[keyof T];

export declare interface Mock<T extends FunctionLike = FunctionLike> extends MockInstance<T> {
    new(...args: Parameters<T>): ReturnType<T>;
    (...args: Parameters<T>) : ReturnType<T>;
}

declare interface MockContext<T extends Procedure | Constructable = Procedure> {
    	/**
     	* This is an array containing all arguments for each call. One item of the array is the arguments of that call.
     	*
     	* @see https://vitest.dev/api/mock#mock-calls
     	* @example
     	* const fn = vi.fn()
     	*
     	* fn('arg1', 'arg2')
     	* fn('arg3')
     	*
     	* fn.mock.calls === [
     	*   ['arg1', 'arg2'], // first call
     	*   ['arg3'], // second call
     	* ]
     	*/
    	calls: MockParameters<T>[];
    	/**
     	* This is an array containing all instances that were instantiated when mock was called with a `new` keyword. Note that this is an actual context (`this`) of the function, not a return value.
     	* @see https://vitest.dev/api/mock#mock-instances
     	*/
    	instances: MockProcedureContext<T>[];
    	/**
     	* An array of `this` values that were used during each call to the mock function.
     	* @see https://vitest.dev/api/mock#mock-contexts
     	*/
    	contexts: MockProcedureContext<T>[];
    	/**
     	* The order of mock's execution. This returns an array of numbers which are shared between all defined mocks.
     	*
     	* @see https://vitest.dev/api/mock#mock-invocationcallorder
     	* @example
     	* const fn1 = vi.fn()
     	* const fn2 = vi.fn()
     	*
     	* fn1()
     	* fn2()
     	* fn1()
     	*
     	* fn1.mock.invocationCallOrder === [1, 3]
     	* fn2.mock.invocationCallOrder === [2]
     	*/
    	invocationCallOrder: number[];
    	/**
     	* This is an array containing all values that were `returned` from the function.
     	*
     	* The `value` property contains the returned value or thrown error. If the function returned a `Promise`, then `result` will always be `'return'` even if the promise was rejected.
     	*
     	* @see https://vitest.dev/api/mock#mock-results
     	* @example
     	* const fn = vi.fn()
     	*   .mockReturnValueOnce('result')
     	*   .mockImplementationOnce(() => { throw new Error('thrown error') })
     	*
     	* const result = fn()
     	*
     	* try {
     	*   fn()
     	* }
     	* catch {}
     	*
     	* fn.mock.results === [
     	*   {
     	*     type: 'return',
     	*     value: 'result',
     	*   },
     	*   {
     	*     type: 'throw',
     	*     value: Error,
     	*   },
     	* ]
     	*/
    	results: MockResult<MockReturnType<T>>[];
    	/**
     	* An array containing all values that were `resolved` or `rejected` from the function.
     	*
     	* This array will be empty if the function was never resolved or rejected.
     	*
     	* @see https://vitest.dev/api/mock#mock-settledresults
     	* @example
     	* const fn = vi.fn().mockResolvedValueOnce('result')
     	*
     	* const result = fn()
     	*
     	* fn.mock.settledResults === [
     	*   {
     	*     type: 'incomplete',
     	*     value: undefined,
     	*   }
     	* ]
     	* fn.mock.results === [
     	*   {
     	*     type: 'return',
     	*     value: Promise<'result'>,
     	*   },
     	* ]
     	*
     	* await result
     	*
     	* fn.mock.settledResults === [
     	*   {
     	*     type: 'fulfilled',
     	*     value: 'result',
     	*   },
     	* ]
     	*/
    	settledResults: MockSettledResult<Awaited<MockReturnType<T>>>[];
    	/**
     	* This contains the arguments of the last call. If spy wasn't called, will return `undefined`.
     	* @see https://vitest.dev/api/mock#mock-lastcall
     	*/
    	lastCall: MockParameters<T> | undefined;
}

declare type MockContext_2<T extends FunctionLike = FunctionLike> = {
    /**
     * List of the call arguments of all calls that have been made to the mock.
     */ calls: Parameters<T>[];
    /**
     * List of all the object instances that have been instantiated from the mock.
     */ instances: ReturnType<T>[];
    /**
     * List of all the function contexts that have been applied to calls to the mock.
     */ contexts: ThisParameterType<T>[];
    /**
     * The order of mock's execution.
     * This returns an array of numbers which are shared between all defined mocks.
     * The index is starting with `1`.
     */ invocationCallOrder: number[];
    /**
     * List of the call arguments of the last call that was made to the mock.
     * If the function was not called, it will return `undefined`.
     */ lastCall: Parameters<T> | undefined;
    /**
     * List of the results of all calls that have been made to the mock.
     */ results: MockResult_2<ReturnType<T>>[];
    /**
     * List of the results of all values that were `resolved` or `rejected` from the function.
     */ settledResults: MockSettledResult_2<Awaited<ReturnType<T>>>[];
};

export declare type Mocked<T> = T extends Constructor ? MockedClass<T> : T extends MockProcedure ? MockedFunction<T> : T extends object ? MockedObject<T> : T;

declare type MockedCallable<T extends MockProcedure> = OmitThisParameter<T> & ConstructSignature<T> & Mock<T>;

declare type MockedClass<T extends Constructor> = MockedClassBase<T> & MockedObject<T>;

declare type MockedClassBase<T extends Constructor> = Mock<(...args: ConstructorParameters<T>) => InstanceType<T>> & {
    new(...args: ConstructorParameters<T>): InstanceType<T>;
    prototype: InstanceType<T>;
};

declare type MockedClassDeep<T extends Constructor> = MockedClassBase<T> & MockedObjectDeep<T>;

declare type MockedFunction<T extends MockProcedure> = MockedCallable<T> & {
    [K in keyof T]: T[K];
};

declare type MockedFunctionDeep<T extends MockProcedure> = MockedCallable<T> & MockedObjectDeep<T>;

declare type MockedObject<T> = {
    [K in Methods<T>]: T[K] extends MockProcedure ? MockedFunction<T[K]> : T[K];
} & {
    [K in Properties<T>]: T[K];
};

declare type MockedObjectDeep<T> = {
    [K in Methods<T>]: T[K] extends MockProcedure ? MockedFunctionDeep<T[K]> : T[K];
} & {
    [K in Properties<T>]: MaybeMockedDeep<T[K]>;
};

declare type MockFactory<T = unknown> = () => Partial<T>;

declare type MockFn = <T extends FunctionLike = FunctionLike>(fn?: T) => Mock<T>;

export declare interface MockInstance<T extends FunctionLike = FunctionLike> {
    _isMockFunction: true;
    /**
     * Returns the mock name string set by calling `.mockName()`
     */ getMockName(): string;
    /**
     * Sets the mock name for this mock.
     */ mockName(name: string): this;
    mock: MockContext_2<T>;
    /**
     * Clears all information about every call.
     */ mockClear(): this;
    /**
     * Does what `mockClear` does and resets inner implementation to the original function.
     */ mockReset(): this;
    /**
     * Does what `mockReset` does and restores original descriptors of spied-on objects.
     */ mockRestore(): void;
    /**
     * Restores the mock when it leaves a `using` scope.
     */ [Symbol.dispose](): void;
    /**
     * Returns current mock implementation if there is one.
     */ getMockImplementation(): NormalizedProcedure_2<T> | undefined;
    /**
     * Accepts a function that should be used as the implementation of the mock.
     */ mockImplementation(fn: NormalizedProcedure_2<T>): this;
    /**
     * Accepts a function that will be used as an implementation of the mock for one call to the mocked function.
     */ mockImplementationOnce(fn: NormalizedProcedure_2<T>): this;
    /**
     * Accepts a function which should be temporarily used as the implementation of the mock while the callback is being executed.
     */ withImplementation<T2>(fn: NormalizedProcedure_2<T>, callback: () => T2): T2 extends Promise<unknown> ? Promise<this> : this;
    /**
     * Return the `this` context from the method without invoking the actual implementation.
     */ mockReturnThis(): this;
    /**
     * Accepts a value that will be returned whenever the mock function is called.
     */ mockReturnValue(value: ReturnType<T>): this;
    /**
     * Accepts a value that will be returned for one call to the mock function.
     */ mockReturnValueOnce(value: ReturnType<T>): this;
    /**
     * Accepts a value that will be thrown whenever the mock function is called.
     */ mockThrow(value: unknown): this;
    /**
     * Accepts a value that will be thrown during the next function call.
     */ mockThrowOnce(value: unknown): this;
    /**
     * Accepts a value that will be resolved when the async function is called.
     */ mockResolvedValue(value: Awaited<ReturnType<T>>): this;
    /**
     * Accepts a value that will be resolved during the next function call.
     */ mockResolvedValueOnce(value: Awaited<ReturnType<T>>): this;
    /**
     * Accepts an error that will be rejected when async function is called.
     */ mockRejectedValue(error: unknown): this;
    /**
     * Accepts a value that will be rejected during the next function call.
     */ mockRejectedValueOnce(error: unknown): this;
}

declare interface MockInstance_2<T extends Procedure | Constructable = Procedure> extends Disposable_2 {
    	/**
     	* Use it to return the name assigned to the mock with the `.mockName(name)` method. By default, it will return `vi.fn()`.
     	* @see https://vitest.dev/api/mock#getmockname
     	*/
    	getMockName(): string;
    	/**
     	* Sets the internal mock name. This is useful for identifying the mock when an assertion fails.
     	* @see https://vitest.dev/api/mock#mockname
     	*/
    	mockName(name: string): this;
    	/**
     	* Current context of the mock. It stores information about all invocation calls, instances, and results.
     	*/
    	mock: MockContext<T>;
    	/**
     	* Clears all information about every call. After calling it, all properties on `.mock` will return to their initial state. This method does not reset implementations. It is useful for cleaning up mocks between different assertions.
     	*
     	* To automatically call this method before each test, enable the [`clearMocks`](https://vitest.dev/config/clearmocks) setting in the configuration.
     	* @see https://vitest.dev/api/mock#mockclear
     	*/
    	mockClear(): this;
    	/**
     	* Does what `mockClear` does and resets inner implementation to the original function. This also resets all "once" implementations.
     	*
     	* Note that resetting a mock from `vi.fn()` will set implementation to an empty function that returns `undefined`.
     	* Resetting a mock from `vi.fn(impl)` will set implementation to `impl`. It is useful for completely resetting a mock to its default state.
     	*
     	* To automatically call this method before each test, enable the [`mockReset`](https://vitest.dev/config/mockreset) setting in the configuration.
     	* @see https://vitest.dev/api/mock#mockreset
     	*/
    	mockReset(): this;
    	/**
     	* Does what `mockReset` does and restores original descriptors of spied-on objects.
     	* @see https://vitest.dev/api/mock#mockrestore
     	*/
    	mockRestore(): void;
    	/**
     	* Returns current permanent mock implementation if there is one.
     	*
     	* If mock was created with `vi.fn`, it will consider passed down method as a mock implementation.
     	*
     	* If mock was created with `vi.spyOn`, it will return `undefined` unless a custom implementation was provided.
     	*/
    	getMockImplementation(): NormalizedProcedure<T> | undefined;
    	/**
     	* Accepts a function to be used as the mock implementation. TypeScript expects the arguments and return type to match those of the original function.
     	* @see https://vitest.dev/api/mock#mockimplementation
     	* @example
     	* const increment = vi.fn().mockImplementation(count => count + 1);
     	* expect(increment(3)).toBe(4);
     	*/
    	mockImplementation(fn: NormalizedProcedure<T>): this;
    	/**
     	* Accepts a function to be used as the mock implementation. TypeScript expects the arguments and return type to match those of the original function. This method can be chained to produce different results for multiple function calls.
     	*
     	* When the mocked function runs out of implementations, it will invoke the default implementation set with `vi.fn(() => defaultValue)` or `.mockImplementation(() => defaultValue)` if they were called.
     	* @see https://vitest.dev/api/mock#mockimplementationonce
     	* @example
     	* const fn = vi.fn(count => count).mockImplementationOnce(count => count + 1);
     	* expect(fn(3)).toBe(4);
     	* expect(fn(3)).toBe(3);
     	*/
    	mockImplementationOnce(fn: NormalizedProcedure<T>): this;
    	/**
     	* Overrides the original mock implementation temporarily while the callback is being executed.
     	*
     	* Note that this method takes precedence over the [`mockImplementationOnce`](https://vitest.dev/api/mock#mockimplementationonce).
     	* @see https://vitest.dev/api/mock#withimplementation
     	* @example
     	* const myMockFn = vi.fn(() => 'original')
     	*
     	* myMockFn.withImplementation(() => 'temp', () => {
     	*   myMockFn() // 'temp'
     	* })
     	*
     	* myMockFn() // 'original'
     	*/
    	withImplementation(fn: NormalizedProcedure<T>, cb: () => Promise<unknown>): Promise<this>;
    	withImplementation(fn: NormalizedProcedure<T>, cb: () => unknown): this;
    	/**
     	* Use this if you need to return the `this` context from the method without invoking the actual implementation.
     	* @see https://vitest.dev/api/mock#mockreturnthis
     	*/
    	mockReturnThis(): this;
    	/**
     	* Accepts a value that will be returned whenever the mock function is called. TypeScript will only accept values that match the return type of the original function.
     	* @see https://vitest.dev/api/mock#mockreturnvalue
     	* @example
     	* const mock = vi.fn()
     	* mock.mockReturnValue(42)
     	* mock() // 42
     	* mock.mockReturnValue(43)
     	* mock() // 43
     	*/
    	mockReturnValue(value: MockReturnType<T>): this;
    	/**
     	* Accepts a value that will be returned whenever the mock function is called. TypeScript will only accept values that match the return type of the original function.
     	*
     	* When the mocked function runs out of implementations, it will invoke the default implementation set with `vi.fn(() => defaultValue)` or `.mockImplementation(() => defaultValue)` if they were called.
     	* @example
     	* const myMockFn = vi
     	*   .fn()
     	*   .mockReturnValue('default')
     	*   .mockReturnValueOnce('first call')
     	*   .mockReturnValueOnce('second call')
     	*
     	* // 'first call', 'second call', 'default'
     	* console.log(myMockFn(), myMockFn(), myMockFn())
     	*/
    	mockReturnValueOnce(value: MockReturnType<T>): this;
    	/**
     	* Accepts a value that will be thrown whenever the mock function is called.
     	* @see https://vitest.dev/api/mock#mockthrow
     	* @example
     	* const myMockFn = vi.fn().mockThrow(new Error('error'))
     	* myMockFn() // throws 'error'
     	*/
    	mockThrow(value: unknown): this;
    	/**
     	* Accepts a value that will be thrown during the next function call. If chained, every consecutive call will throw the specified value.
     	* @example
     	* const myMockFn = vi
     	*   .fn()
     	*   .mockReturnValue('default')
     	*   .mockThrowOnce(new Error('first call error'))
     	*   .mockThrowOnce('second call error')
     	*
     	* expect(() => myMockFn()).toThrowError('first call error')
     	* expect(() => myMockFn()).toThrowError('second call error')
     	* expect(myMockFn()).toEqual('default')
     	*/
    	mockThrowOnce(value: unknown): this;
    	/**
     	* Accepts a value that will be resolved when the async function is called. TypeScript will only accept values that match the return type of the original function.
     	* @example
     	* const asyncMock = vi.fn().mockResolvedValue(42)
     	* asyncMock() // Promise<42>
     	*/
    	mockResolvedValue(value: Awaited<MockReturnType<T>>): this;
    	/**
     	* Accepts a value that will be resolved during the next function call. TypeScript will only accept values that match the return type of the original function. If chained, each consecutive call will resolve the specified value.
     	* @example
     	* const myMockFn = vi
     	*   .fn()
     	*   .mockResolvedValue('default')
     	*   .mockResolvedValueOnce('first call')
     	*   .mockResolvedValueOnce('second call')
     	*
     	* // Promise<'first call'>, Promise<'second call'>, Promise<'default'>
     	* console.log(myMockFn(), myMockFn(), myMockFn())
     	*/
    	mockResolvedValueOnce(value: Awaited<MockReturnType<T>>): this;
    	/**
     	* Accepts an error that will be rejected when async function is called.
     	* @example
     	* const asyncMock = vi.fn().mockRejectedValue(new Error('Async error'))
     	* await asyncMock() // throws Error<'Async error'>
     	*/
    	mockRejectedValue(error: unknown): this;
    	/**
     	* Accepts a value that will be rejected during the next function call. If chained, each consecutive call will reject the specified value.
     	* @example
     	* const asyncMock = vi
     	*   .fn()
     	*   .mockResolvedValueOnce('first call')
     	*   .mockRejectedValueOnce(new Error('Async error'))
     	*
     	* await asyncMock() // first call
     	* await asyncMock() // throws Error<'Async error'>
     	*/
    	mockRejectedValueOnce(error: unknown): this;
}

/**
 * Options for rs.mock module mocking.
 * Supports `{ spy: true }` or `{ mock: true }`.
 */ declare type MockModuleOptions = {
    /**
     * If `true`, the module will be auto-mocked but the original implementations
     * will be preserved - all exports will be wrapped in spy functions that track calls.
     */ spy: true;
} | {
    /**
     * If `true`, the module will be auto-mocked with all exports replaced by mock functions.
     * Original implementations will NOT be preserved.
     */ mock: true;
};

/**
 * Options for mockObject
 */ declare interface MockOptions {
    /**
     * If `true`, the original implementation will be kept.
     * All methods will call the original implementation, but you can still track the calls.
     */ spy?: boolean;
}

declare type MockParameters<T extends Procedure | Constructable> = T extends Constructable ? ConstructorParameters<T> : T extends Procedure ? Parameters<T> : never;

declare type MockProcedure = (...args: any[]) => any;

declare type MockProcedureContext<T extends Procedure | Constructable> = T extends Constructable ? InstanceType<T> : ThisParameterType<T>;

declare type MockResult<T> = MockResultReturn<T> | MockResultThrow | MockResultIncomplete;

declare type MockResult_2<T> = MockResultReturn_2<T> | MockResultThrow_2 | MockResultIncomplete_2;

declare interface MockResultIncomplete {
    	type: "incomplete";
    	value: undefined;
}

declare interface MockResultIncomplete_2 {
    type: 'incomplete';
    value: undefined;
}

declare interface MockResultReturn<T> {
    	type: "return";
    	/**
     	* The value that was returned from the function. If function returned a Promise, then this will be a resolved value.
     	*/
    	value: T;
}

declare interface MockResultReturn_2<T> {
    type: 'return';
    /**
     * The value that was returned from the function. If function returned a Promise, then this will be a resolved value.
     */ value: T;
}

declare interface MockResultThrow {
    	type: "throw";
    	/**
     	* An error that was thrown during function execution.
     	*/
    	value: any;
}

declare interface MockResultThrow_2 {
    type: 'throw';
    /**
     * An error that was thrown during function execution.
     */ value: any;
}

declare type MockReturnType<T extends Procedure | Constructable> = T extends Constructable ? InstanceType<T> : T extends Procedure ? ReturnType<T> : never;

declare type MockSettledResult<T> = MockSettledResultFulfilled<T> | MockSettledResultRejected | MockSettledResultIncomplete;

declare type MockSettledResult_2<T> = MockSettledResultFulfilled_2<T> | MockSettledResultRejected_2;

declare interface MockSettledResultFulfilled<T> {
    	type: "fulfilled";
    	value: T;
}

declare interface MockSettledResultFulfilled_2<T> {
    type: 'fulfilled';
    value: T;
}

declare interface MockSettledResultIncomplete {
    	type: "incomplete";
    	value: undefined;
}

declare interface MockSettledResultRejected {
    	type: "rejected";
    	value: any;
}

declare interface MockSettledResultRejected_2 {
    type: 'rejected';
    value: any;
}

declare type ModifyRstestConfigCallback = (config: RstestConfig) => MaybePromise<RstestConfig | void>;

declare type NamesIndex = number;

declare type NestedProjectConfig = {
    projects: (InlineProjectConfig | string)[];
};

declare type NestedProjectConfigAsyncFn = () => Promise<NestedProjectConfig>;

declare type NestedProjectConfigSyncFn = () => NestedProjectConfig;

declare interface NewPlugin {
    	serialize: (val: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string;
    	test: Test;
}

declare type Next = () => number;

declare type NextAsync = () => Promise<number>;

declare type NextTick = (callback: VoidVarArgsFunc, ...args: unknown[]) => void;

declare interface Node_2 {
    isRoot(): boolean;
    visit(visitor: Visitor, state: any): void;
}

declare type NodeImmediate = {
    hasRef: NodeImmediateHasRef;
    ref: NodeImmediateRef;
    unref: NodeImmediateUnref;
};

declare type NodeImmediateHasRef = () => boolean;

declare type NodeImmediateRef = () => NodeImmediate;

declare type NodeImmediateUnref = () => NodeImmediate;

declare type NormalizedBrowserModeConfig = {
    enabled: boolean;
    provider: BrowserProvider;
    browser: BrowserName;
    headless: boolean;
    port?: number;
    strictPort: boolean;
    viewport?: BrowserViewport;
    providerOptions: Record<string, unknown>;
};

declare type NormalizedConfig = Required<Omit<RstestConfig, OptionalKeys | 'pool' | 'projects' | 'coverage' | 'setupFiles' | 'globalSetup' | 'exclude' | 'testEnvironment' | 'browser' | 'output'>> & Partial<Pick<RstestConfig, OptionalKeys>> & {
    shard?: ShardConfig;
    pool: RstestPoolOptions;
    testEnvironment: EnvironmentWithOptions;
    coverage: NormalizedCoverageOptions;
    browser: NormalizedBrowserModeConfig;
    setupFiles: string[];
    globalSetup: string[];
    exclude: {
        patterns: string[];
        override?: boolean;
    };
    output: NormalizedOutputConfig;
};

export declare type NormalizedCoverageOptions = Required<Omit<CoverageOptions, 'thresholds' | 'include' | 'changed'>> & {
    thresholds?: CoverageThresholds;
    include?: string[];
    changed?: boolean | string;
};

declare type NormalizedOutputConfig = Partial<Omit<RstestOutputConfig, 'distPath'>> & {
    distPath: {
        root: string;
    };
};

declare type NormalizedProcedure<T extends Procedure | Constructable> = T extends Constructable ? ({
    	new (...args: ConstructorParameters<T>): InstanceType<T>;
}) | ({
    	(this: InstanceType<T>, ...args: ConstructorParameters<T>): void;
}) : T extends Procedure ? (...args: Parameters<T>) => ReturnType<T> : never;

declare type NormalizedProcedure_2<T extends Procedure_2> = (...args: Parameters<T>) => ReturnType<T>;

declare type NormalizedProjectConfig = Required<Omit<NormalizedConfig, OptionalKeys | 'projects' | 'reporters' | 'pool' | 'shard' | 'setupFiles' | 'globalSetup' | 'output'>> & Pick<NormalizedConfig, OptionalKeys> & {
    setupFiles: string[];
    globalSetup: string[];
    output?: Omit<NormalizedOutputConfig, 'distPath'>;
};

declare interface OldPlugin {
    	print: (val: unknown, print: Print, indent: Indent, options: PluginOptions, colors: Colors) => string;
    	test: Test;
}

export declare const onTestFailed: Rstest['onTestFailed'];

declare type OnTestFailedHandler = (ctx: TestContext) => MaybePromise<void>;

export declare const onTestFinished: Rstest['onTestFinished'];

declare type OnTestFinishedHandler = (ctx: TestContext) => MaybePromise<void>;

declare type OptionalKeys = 'testNamePattern' | 'plugins' | 'performance' | 'source' | 'resolve' | 'tools' | 'dev' | 'onConsoleLog' | 'silent' | 'chaiConfig' | 'hideSkippedTestFiles' | 'resolveSnapshotPath' | 'extends';

declare interface Options {
    logger: {
        outputStream: Writable;
        errorStream: Writable;
        getColumns: () => number;
    };
    interval?: number;
    getWindow: () => string[];
}

declare type OptionsReceived = PrettyFormatOptions;

declare interface ParsedStack {
    	method: string;
    	file: string;
    	line: number;
    	column: number;
}

declare type Plugin_2 = NewPlugin | OldPlugin;

declare interface PluginOptions {
    	edgeSpacing: string;
    	min: boolean;
    	spacing: string;
}

declare type Plugins = Array<Plugin_2>;

declare interface PrettyFormatOptions {
    	/**
     	* Call `toJSON` on objects before formatting them.
     	* Ignored after the formatter has already called `toJSON` once for a value.
     	* @default true
     	*/
    	callToJSON?: boolean;
    	/**
     	* Whether to escape special characters in regular expressions.
     	* @default false
     	*/
    	escapeRegex?: boolean;
    	/**
     	* Whether to escape special characters in strings.
     	* @default true
     	*/
    	escapeString?: boolean;
    	/**
     	* Whether to highlight syntax using terminal colors.
     	* @default false
     	*/
    	highlight?: boolean;
    	/**
     	* Number of spaces to use for each level of indentation.
     	* @default 2
     	*/
    	indent?: number;
    	/**
     	* Maximum depth to recurse into nested values.
     	* @default Infinity
     	*/
    	maxDepth?: number;
    	/**
     	* Maximum number of items to print in arrays, sets, maps, and similar collections.
     	* @default Infinity
     	*/
    	maxWidth?: number;
    	/**
     	* Approximate per-depth-level budget for output length.
     	* When the accumulated output at any single depth level exceeds this value,
     	* further nesting is collapsed. This is a heuristic safety valve, not a hard
     	* limit — total output can reach up to roughly `maxDepth × maxOutputLength`.
     	* @default 1_000_000
     	*/
    	maxOutputLength?: number;
    	/**
     	* Whether to minimize added whitespace, including indentation and line breaks.
     	* @default false
     	*/
    	min?: boolean;
    	/**
     	* Whether to print `Object` / `Array` prefixes for plain objects and arrays.
     	* @default true
     	*/
    	printBasicPrototype?: boolean;
    	/**
     	* Whether to include the function name when formatting functions.
     	* @default true
     	*/
    	printFunctionName?: boolean;
    	/**
     	* Whether to include shadow-root contents when formatting DOM nodes.
     	* @default true
     	*/
    	printShadowRoot?: boolean;
    	/**
     	* Compare function used when sorting object keys. Set to `null` to disable sorting.
     	*/
    	compareKeys?: CompareKeys;
    	/**
     	* Plugins used to serialize application-specific data types.
     	* @default []
     	*/
    	plugins?: Plugins;
}

declare type Print = (arg0: unknown) => string;

declare function printDiffOrStringify(received: unknown, expected: unknown, options?: DiffOptions, memory?: StringifiedMemory): string | undefined;

declare type Printer = (val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string;

declare function printExpected(value: unknown): string;

declare function printReceived(object: unknown): string;

declare function printWithType<T>(name: string, value: T, print: (value: T) => string): string;

declare type Procedure = (...args: any[]) => any;

declare type Procedure_2 = (...args: any[]) => any;

declare interface ProcessDomainSnapshotOptions {
    	testId: string;
    	received: string;
    	expectedSnapshot: ExpectedSnapshot;
    	matchResult?: DomainMatchResult;
    	isInline?: boolean;
    	assertionName?: string;
    	error?: Error;
}

declare type Project = {
    config: RstestConfig;
    configFilePath?: string;
};

export declare type ProjectConfig = Omit<RstestConfig, 'projects' | 'reporters' | 'pool' | 'isolate' | 'coverage' | 'resolveSnapshotPath' | 'onConsoleLog' | 'silent' | 'bail' | 'output'> & {
    output?: Omit<RstestOutputConfig, 'distPath'>;
};

declare type ProjectConfigAsyncFn = () => Promise<ExportedProjectConfig>;

declare type ProjectConfigSyncFn = () => ExportedProjectConfig;

declare type ProjectContext = {
    name: string;
    environmentName: string;
    _environmentGroup?: {
        key: string;
        baseKey: string;
        baseTestEnvironment: NormalizedProjectConfig['testEnvironment'];
        sourceEnvironmentName: string;
        sourceProjectName: string;
        hasImplicitEntries?: boolean;
        environmentComment?: {
            name?: EnvironmentName;
            options?: Record<string, unknown>;
        };
    };
    /** The root path of current project. */ rootPath: string;
    /** Whether to output es module. */ outputModule: boolean;
    configFilePath?: string;
    normalizedConfig: NormalizedProjectConfig;
    _globalSetups: boolean;
};

declare interface ProjectOptions {
    projectRoot: string;
}

declare type Promisify<O> = { [K in keyof O] : O[K] extends (...args: infer A) => infer R ? Promisify<O[K]> & ((...args: A) => Promise<R>) : O[K] };

declare type Promisify_2<O> = {
    [K in keyof O]: O[K] extends (...args: infer A) => infer R ? Promisify_2<O[K]> & ((...args: A) => Promise<R>) : O[K];
};

declare type PromisifyAssertion<T> = Promisify<Assertion_2<T>>;

declare type PromisifyAssertion_2<T> = Promisify_2<Assertion<T>>;

declare type Properties<T> = {
    [K in keyof T]: T[K] extends MockProcedure ? never : K;
}[keyof T];

declare type QueueMicrotask = (callback: VoidVarArgsFunc) => void;

declare interface Range_2 {
    start: Location_3;
    end: Location_3;
}

/**
 * Core-to-provider contract for resolving raw coverage payloads.
 *
 * @internal
 */ export declare type RawCoverageResolveOptions = {
    /** Load compiled sources from the main-process asset store. */ loadAssetFiles?: (filenames: string[]) => Promise<NonNullable<CoverageCollectOptions['assetFiles']>>;
    /** Load source maps from the main-process asset store. */ loadSourceMaps?: (filenames: string[]) => Promise<NonNullable<CoverageCollectOptions['sourceMaps']>>;
};

declare interface RawMatcherFn<
	T extends MatcherState = MatcherState,
	E extends Array<any> = Array<any>
> {
    	(this: T, received: any, ...expected: E): ExpectationResult;
}

declare interface RawSnapshotInfo {
    	file: string;
    	readonly?: boolean;
    	content?: string;
}

export declare type RealTimers = {
    setTimeout: typeof globalThis.setTimeout;
    clearTimeout: typeof globalThis.clearTimeout;
    setImmediate?: typeof globalThis.setImmediate;
};

declare type Refs = Array<unknown>;

declare class ReportBase {
    constructor(options?: Partial<ReportBaseOptions>);
    execute(context: Context): void;
}

declare interface ReportBaseOptions {
    summarizer: Summarizers;
}

export declare interface Reporter {
    /**
     * Set to `false` when the reporter does not write to process stdout/stderr.
     * @default true
     */ flushOutputStreams?: boolean;
    /**
     * Called before test file run.
     */ onTestFileStart?: (test: TestFileInfo) => void;
    /**
     * Called after tests in file collected.
     */ onTestFileReady?: (test: TestFileInfo) => void;
    /**
     * Called when the test file has finished running.
     */ onTestFileResult?: (test: TestFileResult) => void;
    /**
     * Called before running the test suite.
     */ onTestSuiteStart?: (test: TestSuiteInfo) => void;
    /**
     * Called when the suite has finished running or was just skipped.
     *
     * `result.errors` contains only suite hooks errors
     */ onTestSuiteResult?: (result: TestResult) => void;
    /**
     * Called when the test has finished running or was just skipped.
     */ onTestCaseResult?: (result: TestResult) => void;
    /**
     * Called before running the test case.
     */ onTestCaseStart?: (test: TestCaseInfo) => void;
    /**
     * Called before all tests start
     */ onTestRunStart?: () => MaybePromise<void>;
    /**
     * Called after all tests have finished running.
     */ onTestRunEnd?: ({ results, coverage, testResults, duration, getSourcemap, snapshotSummary, unhandledErrors }: {
        results: TestFileResult[];
        coverage?: CoverageMapData;
        testResults: TestResult[];
        duration: Duration;
        getSourcemap: GetSourcemap;
        unhandledErrors?: Error[];
        snapshotSummary: SnapshotSummary;
        filterRerunTestPaths?: string[];
    }) => MaybePromise<void>;
    /**
     * Called when console log is calling.
     */ onUserConsoleLog?: (log: UserConsoleLog) => void;
    /**
     * Called when rstest exit abnormally
     */ onExit?: () => void;
}

declare type ReporterWithOptions<Name extends BuiltInReporterNames = BuiltInReporterNames> = Name extends keyof BuiltinReporterOptions ? [Name, Partial<BuiltinReporterOptions[Name]>] : [Name, Record<string, unknown>];

declare interface ReportOptions {
    clover: CloverOptions;
    cobertura: CoberturaOptions;
    "html-spa": HtmlSpaOptions;
    html: HtmlOptions;
    json: JsonOptions;
    "json-summary": JsonSummaryOptions;
    lcov: LcovOptions;
    lcovonly: LcovOnlyOptions;
    none: never;
    teamcity: TeamcityOptions;
    text: TextOptions;
    "text-lcov": TextLcovOptions;
    "text-summary": TextSummaryOptions;
}

declare type ReportWithOptions<Name extends keyof ReportOptions = keyof ReportOptions> = Name extends keyof ReportOptions ? [Name, Partial<ReportOptions[Name]>] : [Name, Record<string, unknown>];

declare type RequestAnimationFrame = (callback: AnimationFrameCallback) => TimerId;

declare type RequestIdleCallback = (callback: RequestIdleCallbackCallback, options?: {
    timeout?: number;
}) => number;

declare type RequestIdleCallbackCallback = (deadline: IdleDeadline_2) => any;

declare type Reset = () => void;

/**
 * `RstestConfig` after CLI options are merged in. Carries the resolved
 * `shard` value, which the CLI injects but the public config type omits.
 */ export declare type ResolvedRstestConfig = RstestConfig & {
    shard?: ShardConfig;
};

declare type Ro<T> = T extends Array<infer V> ? V[] | Readonly<V[]> | RoArray<V> | Readonly<RoArray<V>> : T extends object ? T | Readonly<T> | RoObject<T> | Readonly<RoObject<T>> : T;

declare type RoArray<T> = Ro<T>[];

declare type RoObject<T> = {
    [K in keyof T]: T[K] | Ro<T[K]>;
};

export declare const rs: RstestUtilities;

export { RsbuildPlugin }

export { Rspack }

export declare type Rstest = RunnerAPI & {
    expect: Expect;
    assert: typeof assert_2;
    rstest: RstestUtilities;
    rs: RstestUtilities;
};

export declare const rstest: RstestUtilities;

declare type RstestBuildCacheConfig = {
    /**
     * Directory used to store Rsbuild persistent cache files.
     *
     * When omitted, rstest stores cache files under
     * `node_modules/.cache/rstest-<project-name>`.
     */ cacheDirectory?: string;
    /**
     * Additional values that should invalidate the persistent cache when changed.
     *
     * rstest appends its own runtime digest automatically.
     */ cacheDigest?: Array<string | undefined>;
    /**
     * Additional files that should invalidate the persistent cache when changed.
     *
     * rstest automatically adds the active rstest config file, project config
     * files, and discovered tsconfig paths when available.
     */ buildDependencies?: string[];
};

export declare type RstestCommand = 'watch' | 'run' | 'list' | 'merge-reports';

export declare interface RstestConfig {
    /**
     * Extend configuration from adapters
     */ extends?: ExtendConfigFn | ExtendConfig | (ExtendConfigFn | ExtendConfig)[];
    /**
     * Project root
     *
     * @default process.cwd()
     */ root?: string;
    /**
     * Run tests from one or more projects.
     */ projects?: TestProject[];
    /**
     * Project name
     *
     * @default rstest
     */ name?: string;
    /**
     * A list of glob patterns that match your test files.
     *
     * @default ['**\/*.{test,spec}.?(c|m)[jt]s?(x)']
     */ include?: string[];
    /**
     * A list of glob patterns that should be excluded from your test files.
     *
     * @default ['**\/node_modules/**', '**\/dist/**']
     */ exclude?: string[] | {
        patterns: string[];
        /**
         * override default exclude patterns
         * @default false
         */ override?: boolean;
    };
    /**
     * A list of glob patterns that match your in-source test files
     *
     * @default []
     */ includeSource?: string[];
    /**
     * A list of glob patterns that trigger running the whole test suite when
     * matched by changed files collected from `--changed`.
     *
     * @default ['**\/package.json/**', '**\/rstest.config.*']
     */ forceRerunTriggers?: string[];
    /**
     * Path to setup files. They will be run before each test file.
     */ setupFiles?: string[] | string;
    /**
     * Path to global setup files, relative to project root.
     * A global setup file can either export named functions `setup` and `teardown`
     * or a `default` function that returns a teardown function.
     */ globalSetup?: string[] | string;
    /**
     * Retry the test specific number of times if it fails.
     * @default 0
     */ retry?: number;
    /**
     * Pass when no tests are found.
     *
     * @default false
     */ passWithNoTests?: boolean;
    /**
     * Run only the test files that failed in the previous run, backed by the
     * persistent results cache. File-level granularity: the whole failed test
     * file re-runs. When there are no previously-failed files (or no cache yet),
     * all tests run with a notice.
     *
     * @default false
     */ onlyFailures?: boolean;
    /**
     * Pool used to run tests in.
     */ pool?: RstestPoolType | RstestPoolOptions;
    /**
     * Run tests in an isolated environment
     *
     * @default true
     */ isolate?: boolean;
    /**
     * Provide global APIs
     *
     * @default false
     */ globals?: boolean;
    /**
     * The environment that will be used for testing
     *
     * @default 'node'
     */ testEnvironment?: EnvironmentName | EnvironmentWithOptions;
    /**
     * Stop running tests after n failures.
     * Set to 0 to run all tests regardless of failures.
     *
     * @default 0
     */ bail?: number;
    /**
     * print console traces when calling any console method.
     *
     * @default false
     */ printConsoleTrace?: boolean;
    /**
     * Disable console intercept enhancements. `onConsoleLog` & `printConsoleTrace`
     * configuration will not take effect. When `silent` is enabled, Rstest still
     * uses an internal console interception path to control test log output.
     *
     * @default false
     */ disableConsoleIntercept?: boolean;
    /**
     * Silence intercepted console output from tests.
     * - `true`: hide all intercepted test console logs
     * - `'passed-only'`: show intercepted logs only for failed tasks
     *
     * @default false
     */ silent?: boolean | 'passed-only';
    /**
     * Update snapshot files. Will update all changed snapshots and delete obsolete ones.
     *
     * @default false
     */ update?: boolean;
    /**
     * Custom reporter for output.
     * @default ['default']
     */ reporters?: Reporter | BuiltInReporterNames | (Reporter | BuiltInReporterNames | [BuiltInReporterNames] | ReporterWithOptions)[];
    /**
     * Hide skipped tests logs.
     *
     * @default false
     */ hideSkippedTests?: boolean;
    /**
     * Hide skipped test files logs.
     *
     * @default false
     */ hideSkippedTestFiles?: boolean;
    /**
     * Run only tests with a name that matches the regex.
     */ testNamePattern?: string | RegExp;
    /**
     * Timeout of a test in milliseconds.
     * @default 5000
     */ testTimeout?: number;
    /**
     * Timeout of hook in milliseconds.
     * @default 10000
     */ hookTimeout?: number;
    /**
     * Automatically clear mock calls, instances, contexts and results before every test.
     * @default false
     */ clearMocks?: boolean;
    /**
     * Automatically reset mock state before every test.
     * @default false
     */ resetMocks?: boolean;
    /**
     * Automatically restore mock state and implementation before every test.
     * @default false
     */ restoreMocks?: boolean;
    /**
     * The number of milliseconds after which a test or suite is considered slow and reported as such in the results.
     * @default 300
     */ slowTestThreshold?: number;
    /**
     * Detect async resources that are still active after a test file finishes.
     * This may slow down tests and should be used for debugging leaks.
     * @default false
     */ detectAsyncLeaks?: boolean;
    /**
     * Restores all global variables that were changed with `rstest.stubGlobal` before every test.
     * @default false
     */ unstubGlobals?: boolean;
    /**
     * Restores all runtime env values that were changed with `rstest.stubEnv` before every test.
     * @default false
     */ unstubEnvs?: boolean;
    /**
     * Maximum number of concurrent tests
     * @default 5
     */ maxConcurrency?: number;
    /**
     * Log heap usage after each test
     * @default false
     */ logHeapUsage?: boolean;
    /**
     * Custom handler for console log in tests.
     *
     * Return `false` to silence the log.
     *
     * @param content - The console output text.
     * @param type - Which stream the output came from.
     */ onConsoleLog?: (content: string, type: ConsoleStreamType) => boolean | void;
    /** Format snapshot output */ snapshotFormat?: SnapshotFormat;
    /**
     * Resolve custom snapshot path
     */ resolveSnapshotPath?: (testPath: string, snapExtension: string) => string;
    /**
     * Custom environment variables available on `process.env` during tests.
     */ env?: Partial<NodeJS.ProcessEnv>;
    /**
     * Browser mode configuration.
     */ browser?: BrowserModeConfig;
    /**
     * Enable Module Federation compatibility mode for Node tests.
     *
     * When enabled, Rstest installs runtime shims so that Module Federation
     * runtimes which load chunks via Node `fs`/`vm`/`eval` or HTTP work inside
     * the test worker.
     * @default false
     */ federation?: boolean;
    /**
     * Coverage options
     */ coverage?: CoverageOptions;
    /**
     * Performance-related Rsbuild options used by rstest.
     */ performance?: RstestPerformanceConfig;
    /**
     * chai configuration options
     */ chaiConfig?: ChaiConfig;
    /**
     * Include `location` property in `TestInfo` received by reporters
     */ includeTaskLocation?: boolean;
    // Rsbuild configs
    plugins?: RsbuildConfig['plugins'];
    source?: Pick<NonNullable<RsbuildConfig['source']>, 'assetsInclude' | 'define' | 'tsconfigPath' | 'decorators' | 'include' | 'exclude' | 'transformImport' | 'assetsInclude'>;
    dev?: Pick<NonNullable<RsbuildConfig['dev']>, 'writeToDisk'>;
    output?: RstestOutputConfig;
    resolve?: RsbuildConfig['resolve'];
    tools?: Pick<NonNullable<RsbuildConfig['tools']>, 'rspack' | 'swc' | 'bundlerChain'>;
}

export declare type RstestConfigAsyncFn = () => Promise<RstestConfig>;

export declare type RstestConfigExport = RstestConfig | RstestConfigSyncFn | RstestConfigAsyncFn;

export declare type RstestConfigSyncFn = () => RstestConfig;

declare type RstestContext = {
    /** The Rstest core version. */ version: string;
    /** The root path of rstest. */ rootPath: string;
    /** The original Rstest config passed from the createRstest method. */ originalConfig: Readonly<RstestConfig>;
    /** The normalized Rstest config. */ normalizedConfig: NormalizedConfig;
    /** filter by a filename regex pattern */ fileFilters?: string[];
    /** How file filters should match discovered test files. */ fileFilterMode?: FileFilterMode;
    /** Original source filters passed to `--related`, `--findRelatedTests`, or resolved from `--changed`. */ relatedFilters?: string[];
    /** CLI option that produced related source filters. */ relatedMode?: 'related' | 'changed';
    /** Related test resolution completed successfully but matched no test files. */ relatedResolutionEmpty?: boolean;
    /** Changed source files used to limit coverage reports for `--changed`. */ changedCoverageFilters?: string[];
    /** Why a related run was expanded back to the full test suite. */ relatedRerunReason?: 'forceRerunTrigger';
    /** Changed files that caused a related run to expand back to the full test suite. */ relatedRerunFiles?: string[];
    /** The config file path. */ configFilePath?: string;
    /**
     * Run tests from one or more projects.
     */ projects: ProjectContext[];
    /**
     * The test state
     */ testState: RstestTestState;
    /**
     * The command type.
     *
     * - run: `rstest`
     * - dev: `rstest dev` or watch mode
     * - list: `rstest list`
     */ command: RstestCommand;
    /**
     * Dump a Perfetto-compatible performance trace JSON file. CLI-only switch;
     * not exposed via user config.
     *
     * @internal
     */ trace: boolean;
    /** See the `embedded` option on `createRstest`. */ embedded: boolean;
    reporters: Reporter[];
    snapshotManager: SnapshotManager;
    stateManager: TestStateManager;
    reporterResults: {
        results: TestFileResult[];
        testResults: TestResult[];
    };
    /** Merge a batch of file/test results into `reporterResults`. */ updateReporterResultState: (results: TestFileResult[], testResults: TestResult[], deletedEntries?: string[]) => void;
};

export declare type RstestExposeAPI = {
    /**
     * Get the resolved Rstest config for the current Rsbuild environment.
     *
     * This API is exposed to Rsbuild plugins through `api.useExposed('rstest')`
     * in both Node Mode and Browser Mode projects.
     * It combines the current project's config with the effective global and
     * run-level config.
     *
     * The returned config uses a read-only type. Opaque values retain their
     * original identity and behavior.
     */ getRstestConfig: () => Readonly<ResolvedRstestConfig>;
    /**
     * Modify the Rstest config for the current Rsbuild environment.
     *
     * This API is exposed to Rsbuild plugins through `api.useExposed('rstest')`
     * in both Node Mode and Browser Mode projects.
     * In multi-project mode, the callback only applies to the Rstest project
     * that owns the current Rsbuild environment.
     *
     * This API is suitable for modifying existing project config, but it cannot
     * be used to dynamically add or remove Rstest projects, switch Browser Mode,
     * modify Browser Mode launch options, modify the project name, or modify
     * global options such as reporters, pool, isolate, coverage, update,
     * output.distPath, or plugins.
     */ modifyRstestConfig: (callback: ModifyRstestConfigCallback) => void;
};

declare type RstestInstance = {
    context: RstestContext;
    runTests: () => Promise<void>;
    listTests: (options: ListCommandOptions) => Promise<ListCommandResult[]>;
    mergeReports: (options?: {
        path?: string;
        cleanup?: boolean;
    }) => Promise<void>;
};

declare type RstestOutputConfig = Pick<NonNullable<RsbuildConfig['output']>, 'cssModules' | 'emitAssets' | 'externals' | 'cleanDistPath' | 'module'> & {
    distPath?: string | {
        root?: string;
    };
    /**
     * Whether to bundle third-party dependencies from node_modules.
     * - `true`: Always bundle all third-party dependencies.
     * - `false`: Always externalize third-party dependencies.
     * - `['pkg']`: Bundle the package and all of its subpaths.
     * - `['pkg/subpath']`: Bundle a specific package subpath.
     * - `['pkg/*']`: Bundle package subpaths that match the pattern.
     * - `[/^pkg\\/subpath/]`: Bundle package requests matched by a regular
     *   expression.
     *
     * When unset, rstest bundles dependencies in browser-like test
     * environments (jsdom, happy-dom, etc.) and externalizes them in the node
     * environment. This option is not supported in browser mode.
     */ bundleDependencies?: boolean | BundleDependencyPattern[];
};

declare type RstestPerformanceConfig = {
    /**
     * Enable Rsbuild persistent build cache for test builds.
     *
     * When set to `true`, rstest uses a cache directory outside the temporary
     * output folder and appends rstest-specific invalidation inputs.
     *
     * @default false
     */ buildCache?: boolean | RstestBuildCacheConfig;
};

declare type RstestPoolOptions = {
    /** Pool used to run tests in. */ type?: RstestPoolType;
    /** Maximum number or percentage of workers to run tests in. */ maxWorkers?: number | string;
    /** Pass additional arguments to node process in the child processes. */ execArgv?: string[];
};

declare type RstestPoolType = 'forks' | 'threads';

declare type RstestProjectConfig = ExportedProjectConfig | NestedProjectConfig;

declare type RstestTestState = {
    getRunningModules: () => RunningModules;
    getTestModules: () => TestFileResult[];
    /** Get the test files paths. return `undefined` in watch mode. */ getTestFiles: () => string[] | undefined;
};

export declare interface RstestUtilities {
    /**
     * Creates a spy on a function.
     */ fn: MockFn;
    /**
     * Creates a spy on a method of an object
     */ spyOn: <T extends Record<string, any>, K extends keyof T>(obj: T, methodName: K, accessType?: 'get' | 'set') => MockInstance<T[K]>;
    /**
     * Determines if the given function is a mocked function.
     */ isMockFunction: (fn: any) => fn is MockInstance;
    /**
     * Deeply mocks properties and methods of a given object
     * in the same way as `rstest.mock()` mocks module exports.
     *
     * @example
     * ```ts
     * const original = {
     *   simple: () => 'value',
     *   nested: {
     *     method: () => 'real'
     *   },
     *   prop: 'foo',
     * }
     *
     * const mocked = rstest.mockObject(original)
     * expect(mocked.simple()).toBe(undefined)
     * expect(mocked.nested.method()).toBe(undefined)
     * expect(mocked.prop).toBe('foo')
     *
     * mocked.simple.mockReturnValue('mocked')
     * expect(mocked.simple()).toBe('mocked')
     *
     * // With spy option to keep original implementations
     * const spied = rstest.mockObject(original, { spy: true })
     * expect(spied.simple()).toBe('value')
     * expect(spied.simple).toHaveBeenCalled()
     * ```
     *
     * @param value - The object to be mocked
     * @param options - Mock options
     * @returns A deeply mocked version of the input object
     */ mockObject: <T>(value: T, options?: MockOptions) => MaybeMockedDeep<T>;
    /**
     * Type helper for TypeScript. Just returns the object that was passed.
     *
     * When `partial` is `true` it will expect a `Partial<T>` as a return value.
     * By default, this will only make TypeScript believe that the first level values are mocked.
     * You can pass down `{ deep: true }` as a second argument to tell TypeScript
     * that the whole object is mocked, if it actually is.
     *
     * @example
     * ```ts
     * import example from './example.js'
     *
     * rstest.mock('./example.js')
     *
     * test('1 + 1 equals 10', async () => {
     *   rstest.mocked(example.calc).mockReturnValue(10)
     *   expect(example.calc(1, '+', 1)).toBe(10)
     * })
     * ```
     * @param item - Anything that can be mocked
     * @returns The same item with mocked type
     */ mocked: (<T>(item: T, deep?: false) => Mocked<T>) & (<T>(item: T, deep: true) => MaybeMockedDeep<T>) & (<T>(item: T, options: {
        partial?: false;
        deep?: false;
    }) => Mocked<T>) & (<T>(item: T, options: {
        partial?: false;
        deep: true;
    }) => MaybeMockedDeep<T>) & (<T>(item: T, options: {
        partial: true;
        deep?: false;
    }) => MaybePartiallyMocked<T>) & (<T>(item: T, options: {
        partial: true;
        deep: true;
    }) => MaybePartiallyMockedDeep<T>);
    /**
     * Calls `.mockClear()` on all spies.
     */ clearAllMocks: () => RstestUtilities;
    /**
     * Calls `.mockReset()` on all spies.
     */ resetAllMocks: () => RstestUtilities;
    /**
     * Calls `.mockRestore()` on all spies.
     */ restoreAllMocks: () => RstestUtilities;
    /**
     * Mock a module.
     *
     * When called with a factory function, the module will be replaced with the return value of the factory.
     * When called with `{ spy: true }`, the module will be auto-mocked but the original implementations
     * will be preserved - all exports will be wrapped in spy functions that track calls.
     *
     * @example
     * ```ts
     * // Replace module with factory
     * rs.mock('./module', () => ({ fn: rs.fn() }))
     *
     * // Auto-mock with spy mode - keeps original implementations
     * rs.mock('./module', { spy: true })
     * ```
     */ mock<T = unknown>(moduleName: string | Promise<T>, factoryOrOptions?: MockFactory<T> | MockModuleOptions): void;
    /**
     * Mock a module (CommonJS require)
     */ mockRequire: <T = unknown>(moduleName: string, factoryOrOptions?: (() => T) | MockModuleOptions) => void;
    /**
     * Mock a module, not hoisted.
     *
     * When called with `{ spy: true }`, the module will be auto-mocked but the original implementations
     * will be preserved - all exports will be wrapped in spy functions that track calls.
     */ doMock<T = unknown>(moduleName: string | Promise<T>, factoryOrOptions?: MockFactory<T> | MockModuleOptions): void;
    /**
     * Mock a module, not hoisted (CommonJS require).
     */ doMockRequire: <T = unknown>(moduleName: string, factoryOrOptions?: (() => T) | MockModuleOptions) => void;
    /**
     * Hoisted mock function.
     */ hoisted: <T = unknown>(fn: () => T) => T;
    /**
     * Removes module from the mocked registry.
     */ unmock: (path: string) => void;
    /**
     * Removes CommonJS require module from the mocked registry.
     */ unmockRequire: (path: string) => void;
    /**
     * Removes module from the mocked registry, not hoisted.
     */ doUnmock: (path: string) => void;
    /**
     * Removes CommonJS require module from the mocked registry, not hoisted.
     */ doUnmockRequire: (path: string) => void;
    /**
     * Imports a module with all of its properties (including nested properties) mocked.
     */ importMock: <T = Record<string, unknown>>(path: string) => Promise<T>;
    /**
     * Imports a module with all of its properties (including nested properties) mocked.
     */ requireMock: <T = Record<string, unknown>>(path: string) => T;
    /**
     * Import and return the actual module instead of a mock, bypassing all checks on whether the module should receive a mock implementation or not.
     */ importActual: <T = Record<string, unknown>>(path: string) => Promise<T>;
    /**
     * Require and return the actual module instead of a mock, bypassing all checks on whether the module should receive a mock implementation or not.
     */ requireActual: <T = Record<string, unknown>>(path: string) => T;
    /**
     * Resets modules registry by clearing the cache of all modules.
     */ resetModules: () => RstestUtilities;
    /**
     * Changes the value of an environment variable in the current runtime env store.
     * Uses `process.env` in Node.js and runtime env store in browser mode.
     */ stubEnv: (name: string, value: string | undefined) => DisposableRstestUtilities;
    /**
     * Restores all env values that were changed with `rstest.stubEnv`.
     */ unstubAllEnvs: () => RstestUtilities;
    /**
     * Changes the value of global variable.
     */ stubGlobal: (name: string | number | symbol, value: unknown) => DisposableRstestUtilities;
    /**
     * Restores all global variables that were changed with `rstest.stubGlobal`.
     */ unstubAllGlobals: () => RstestUtilities;
    /**
     * Update runtime config for the current test.
     */ setConfig: (config: RuntimeOptions) => void;
    /**
     * get runtime config for the current test.
     */ getConfig: () => RuntimeOptions;
    /**
     * Reset runtime config that were changed with `rstest.setConfig`.
     */ resetConfig: () => void;
    /**
     * Mocks timers using `@sinonjs/fake-timers`.
     */ useFakeTimers: (config?: Config_2) => DisposableRstestUtilities;
    useRealTimers: () => RstestUtilities;
    isFakeTimers: () => boolean;
    /**
     * Set the current system time used by fake timers.
     */ setSystemTime: (now?: FakeTimerSystemTime) => RstestUtilities;
    getRealSystemTime: () => number;
    getRealTimers: () => RealTimers;
    runAllTicks: () => RstestUtilities;
    runAllTimers: () => RstestUtilities;
    runAllTimersAsync: () => Promise<RstestUtilities>;
    runOnlyPendingTimers: () => RstestUtilities;
    runOnlyPendingTimersAsync: () => Promise<RstestUtilities>;
    advanceTimersByTime: (ms: FakeTimerTickTime) => RstestUtilities;
    advanceTimersByTimeAsync: (ms: FakeTimerTickTime) => Promise<RstestUtilities>;
    advanceTimersToNextTimer: (steps?: number) => RstestUtilities;
    advanceTimersToNextTimerAsync: (steps?: number) => Promise<RstestUtilities>;
    advanceTimersToNextFrame: () => RstestUtilities;
    jumpTimersByTime: (ms: FakeTimerTickTime) => RstestUtilities;
    setTickMode: (mode: FakeTimerTickMode) => RstestUtilities;
    /**
     * Returns the number of fake timers still left to run.
     */ getTimerCount: () => number;
    /**
     * Removes all timers that are scheduled to run.
     */ clearAllTimers: () => RstestUtilities;
    /**
     * Retry callback until it succeeds (doesn't throw) or timeout is reached.
     * If timeout is reached, throws the last error from the callback.
     */ waitFor: <T>(callback: WaitForCallback<T>, options?: number | WaitForOptions) => Promise<T>;
    /**
     * Retry callback until it returns a truthy value or timeout is reached.
     * If callback throws, it interrupts immediately and throws that error.
     * If timeout is reached, throws an error.
     */ waitUntil: <T>(callback: () => MaybePromise<T>, options?: number | WaitUntilOptions) => Promise<Truthy<Awaited<T>>>;
}

declare type RunAll = () => number;

declare type RunAllAsync = () => Promise<number>;

export declare function runCLI({ argv }?: RunCLIOptions): void;

export declare type RunCLIOptions = {
    /**
     * The command-line arguments to parse, matching the shape of Node.js `process.argv`
     * @default process.argv
     */ argv?: string[];
};

declare type RunMicrotasks = () => void;

declare type RunnerAPI = {
    describe: Describe;
    it: TestAPIs;
    test: TestAPIs;
    beforeAll: (fn: BeforeAllListener, timeout?: number) => void;
    afterAll: (fn: AfterAllListener, timeout?: number) => void;
    beforeEach: <ExtraContext = object>(fn: BeforeEachListener<ExtraContext>, timeout?: number) => void;
    afterEach: <ExtraContext = object>(fn: AfterEachListener<ExtraContext>, timeout?: number) => void;
    onTestFinished: (fn: OnTestFinishedHandler, timeout?: number) => void;
    onTestFailed: (fn: OnTestFailedHandler, timeout?: number) => void;
};

declare type RunningModules = Map<string, {
    runningTests: TestCaseInfo[];
    results: TestResult[];
}>;

declare type RuntimeConfig = Pick<RstestContext['normalizedConfig'], 'testTimeout' | 'testNamePattern' | 'globals' | 'passWithNoTests' | 'retry' | 'clearMocks' | 'resetMocks' | 'restoreMocks' | 'unstubEnvs' | 'unstubGlobals' | 'maxConcurrency' | 'printConsoleTrace' | 'disableConsoleIntercept' | 'testEnvironment' | 'federation' | 'isolate' | 'hookTimeout' | 'coverage' | 'snapshotFormat' | 'env' | 'logHeapUsage' | 'detectAsyncLeaks' | 'bail' | 'chaiConfig' | 'includeTaskLocation' | 'silent'>;

declare type RuntimeOptions = Partial<Pick<RuntimeConfig, 'testTimeout' | 'hookTimeout' | 'clearMocks' | 'resetMocks' | 'restoreMocks' | 'maxConcurrency' | 'retry'>>;

declare type RunToFrame = () => number;

declare type RunToLast = () => number;

declare type RunToLastAsync = () => Promise<number>;

declare interface SaveStatus {
    	deleted: boolean;
    	saved: boolean;
}

declare type SetImmediate = (callback: VoidVarArgsFunc, ...args: unknown[]) => NodeImmediate;

declare type SetInterval = (callback: VoidVarArgsFunc, delay?: number, ...args: unknown[]) => TimerId;

declare type SetSystemTime = (now?: number | Date | TemporalTimelike) => void;

declare type SetTickMode = (tickModeConfig: SetTickModeConfig) => void;

declare type SetTickModeConfig = {
    mode: TickMode;
    delta?: number;
};

declare type SetTimeout = (callback: VoidVarArgsFunc, delay?: number, ...args: unknown[]) => TimerId;

/**
 * Per-invocation test sharding, resolved from the `--shard <index/count>` CLI
 * flag. It is intentionally not a user config field: the index/count must
 * differ on every CI runner, so it cannot be expressed by a value committed to
 * the shared config file. Kept on the resolved/normalized config only.
 */ declare type ShardConfig = {
    count: number;
    index: number;
};

declare interface SnapshotEnvironment {
    	getVersion: () => string;
    	getHeader: () => string;
    	resolvePath: (filepath: string) => Promise<string>;
    	resolveRawPath: (testPath: string, rawPath: string) => Promise<string>;
    	saveSnapshotFile: (filepath: string, snapshot: string) => Promise<void>;
    	readSnapshotFile: (filepath: string) => Promise<string | null>;
    	removeSnapshotFile: (filepath: string) => Promise<void>;
    	processStackTrace?: (stack: ParsedStack) => ParsedStack;
}

declare type SnapshotFormat = Omit<NonNullable<SnapshotStateOptions['snapshotFormat']>, 'plugins' | 'compareKeys'>;

declare class SnapshotManager {
    	options: Omit<SnapshotStateOptions, "snapshotEnvironment">;
    	summary: SnapshotSummary;
    	extension: string;
    	constructor(options: Omit<SnapshotStateOptions, "snapshotEnvironment">);
    	clear(): void;
    	add(result: SnapshotResult): void;
    	resolvePath<T = any>(testPath: string, context?: T): string;
    	resolveRawPath(testPath: string, rawPath: string): string;
}

declare interface SnapshotMatcher<T> {
    <U extends {
        [P in keyof T]: any;
    }>(snapshot: Partial<U>, message?: string) : void;
    (message?: string) : void;
}

declare interface SnapshotMatchOptions {
    	testId: string;
    	testName: string;
    	received: unknown;
    	key?: string;
    	inlineSnapshot?: string;
    	isInline: boolean;
    	error?: Error;
    	rawSnapshot?: RawSnapshotInfo;
    	assertionName?: string;
}

declare interface SnapshotResult {
    	filepath: string;
    	added: number;
    	fileDeleted: boolean;
    	matched: number;
    	unchecked: number;
    	uncheckedKeys: Array<string>;
    	unmatched: number;
    	updated: number;
}

declare interface SnapshotReturnOptions {
    	actual: string;
    	count: number;
    	expected?: string;
    	key: string;
    	pass: boolean;
}

declare class SnapshotState {
    	testFilePath: string;
    	snapshotPath: string;
    	private _counters;
    	private _dirty;
    	private _updateSnapshot;
    	private _snapshotData;
    	private _initialData;
    	private _inlineSnapshots;
    	private _inlineSnapshotStacks;
    	private _testIdToKeys;
    	private _rawSnapshots;
    	private _uncheckedKeys;
    	private _snapshotFormat;
    	private _environment;
    	private _fileExists;
    	expand: boolean;
    	private _added;
    	private _matched;
    	private _unmatched;
    	private _updated;
    	get added(): CounterMap<string>;
    	set added(value: number);
    	get matched(): CounterMap<string>;
    	set matched(value: number);
    	get unmatched(): CounterMap<string>;
    	set unmatched(value: number);
    	get updated(): CounterMap<string>;
    	set updated(value: number);
    	private constructor();
    	static create(testFilePath: string, options: SnapshotStateOptions): Promise<SnapshotState>;
    	get snapshotUpdateState(): SnapshotUpdateState;
    	get environment(): SnapshotEnvironment;
    	markSnapshotsAsCheckedForTest(testName: string): void;
    	clearTest(testId: string): void;
    	protected _inferInlineSnapshotStack(stacks: ParsedStack[]): ParsedStack | null;
    	private _addSnapshot;
    	private _resolveKey;
    	private _resolveInlineStack;
    	private _reconcile;
    	save(): Promise<SaveStatus>;
    	getUncheckedCount(): number;
    	getUncheckedKeys(): Array<string>;
    	removeUncheckedKeys(): void;
    	probeExpectedSnapshot(options: Pick<SnapshotMatchOptions, "testName" | "testId" | "isInline" | "inlineSnapshot">): ExpectedSnapshot;
    	match({ testId, testName, received, key, inlineSnapshot, isInline, error, rawSnapshot, assertionName }: SnapshotMatchOptions): SnapshotReturnOptions;
    	processDomainSnapshot({ testId, received, expectedSnapshot, matchResult, isInline, error, assertionName }: ProcessDomainSnapshotOptions): SnapshotReturnOptions;
    	pack(): Promise<SnapshotResult>;
}

declare interface SnapshotStateOptions {
    	updateSnapshot: SnapshotUpdateState;
    	snapshotEnvironment: SnapshotEnvironment;
    	expand?: boolean;
    	snapshotFormat?: OptionsReceived;
    	resolveSnapshotPath?: (path: string, extension: string, context?: any) => string;
}

declare interface SnapshotSummary {
    	added: number;
    	didUpdate: boolean;
    	failure: boolean;
    	filesAdded: number;
    	filesRemoved: number;
    	filesRemovedList: Array<string>;
    	filesUnmatched: number;
    	filesUpdated: number;
    	matched: number;
    	total: number;
    	unchecked: number;
    	uncheckedKeysByFile: Array<UncheckedSnapshot>;
    	unmatched: number;
    	updated: number;
}

declare type SnapshotUpdateState = "all" | "new" | "none";

declare type SourceColumn = number;

declare type SourceLine = number;

declare abstract class SourceMap {
    version: SourceMapV3['version'];
    file: SourceMapV3['file'];
    names: SourceMapV3['names'];
    sourceRoot: SourceMapV3['sourceRoot'];
    sources: SourceMapV3['sources'];
    sourcesContent: SourceMapV3['sourcesContent'];
    resolvedSources: SourceMapV3['sources'];
    ignoreList: SourceMapV3['ignoreList'];
}

declare type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap;

declare type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];

declare interface SourceMapV3 {
    file?: string | null;
    names: string[];
    sourceRoot?: string;
    sources: (string | null)[];
    sourcesContent?: (string | null)[];
    version: 3;
    ignoreList?: number[];
}

declare type SourcesIndex = number;

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

declare interface StringifiedMemory {
    	expected?: string;
    	actual?: string;
}

declare function stringify(object: unknown, maxDepth?: number, { maxLength, filterNode, ...options }?: StringifyOptions): string;

declare interface StringifyOptions extends PrettyFormatOptions {
    	maxLength?: number;
    	filterNode?: string | ((node: any) => boolean);
}

declare interface SuiteContext {
    filepath: TestPath;
    meta: TaskMeta;
}

declare type Summarizers = "flat" | "nested" | "pkg" | "defaultSummarizer";

/** Union type for all supported reporter types */ declare type SupportedReporter = keyof ReportOptions | ReportWithOptions | ReportBase | CustomReporter;

declare interface SyncExpectationResult {
    	pass: boolean;
    	message: () => string;
    	actual?: any;
    	expected?: any;
    	meta?: object;
}

export declare type TaskMeta = Record<string, TaskMetaValue>;

export declare type TaskMetaValue = string | number | boolean | null | TaskMetaValue[] | {
    [key: string]: TaskMetaValue;
};

declare interface TeamcityOptions extends FileOptions {
    blockName: string;
}

declare type TemporalDuration = {
    years: number;
    months: number;
    weeks: number;
    days: number;
    hours: number;
    minutes: number;
    seconds: number;
    milliseconds: number;
    microseconds: number;
    nanoseconds: number;
    total: (options: {
        unit: string;
        relativeTo?: unknown;
    }) => number;
};

declare type TemporalTimelike = {
    epochMilliseconds: number;
};

declare type Test = (arg0: any) => boolean;

export declare const test: Rstest['test'];

declare type TestAPI<ExtraContext = object> = TestFn<ExtraContext> & {
    each: TestEachFn;
    for: TestForFn<ExtraContext>;
    fails: TestAPI<ExtraContext>;
    concurrent: TestAPI<ExtraContext>;
    sequential: TestAPI<ExtraContext>;
    only: TestAPI<ExtraContext>;
    skip: TestAPI<ExtraContext>;
    todo: TestAPI<ExtraContext>;
    runIf: (condition: boolean) => TestAPI<ExtraContext>;
    skipIf: (condition: boolean) => TestAPI<ExtraContext>;
};

export declare type TestAPIs<ExtraContext = object> = TestAPI<ExtraContext> & {
    extend: <T extends Record<string, any> = object>(fixtures: Fixtures<T, ExtraContext>) => TestAPIs<{
        [K in keyof T | keyof ExtraContext]: K extends keyof T ? T[K] : K extends keyof ExtraContext ? ExtraContext[K] : never;
    }>;
};

/**
 * The two accepted call shapes shared by `test` / `it` and the functions returned
 * by `test.each` / `test.for`:
 * - `(name, fn, timeout?)` — test function second, with an optional numeric timeout
 *   last (kept for Jest compatibility; shorthand for `{ timeout: n }`).
 * - `(name, options, fn?)` — `TestOptions` object as the second argument.
 *
 * The function-first overload is listed first so the common `test(name, fn)` case
 * binds the callback's context types — a function value is otherwise assignable to
 * the all-optional `TestOptions`, which would swallow contextual typing.
 */ declare type TestCall<Fn> = {
    (description: string, fn?: Fn, timeout?: number) : void;
    (description: string, options: TestOptions, fn?: Fn) : void;
};

declare type TestCallbackFn<ExtraContext = object> = (context: TestContext & ExtraContext) => MaybePromise<void>;

export declare type TestCaseInfo = {
    testId: string;
    testPath: TestPath;
    name: string;
    timeout?: number;
    parentNames?: string[];
    project: string;
    startTime?: number;
    /** Only included when `includeTaskLocation` config is enabled */ location?: Location_2;
    meta?: TaskMeta;
    type: 'case';
    runMode: TestRunMode;
};

export declare interface TestContext {
    /**
     * Metadata of the current test
     */ task: {
        /** A stable, unique identifier for the test */ id: string;
        /** Test name provided by user */ name: string;
        /** Absolute path of the current test file when provided by the runner */ filepath?: string;
        /** Absolute path of the current project's root directory. */ projectRoot?: string;
        /** Result of the current test, undefined if the test is not run yet */ result?: TestResult;
        /** Mutable metadata copied to the current test result. */ meta: TaskMeta;
    };
    expect: Expect;
    /** Skip the current test during execution. */ skip: () => never;
    onTestFinished: RunnerAPI['onTestFinished'];
    onTestFailed: RunnerAPI['onTestFailed'];
}

declare interface TestEachFn {
    <T extends Record<string, unknown>>(cases: readonly T[]) : TestCall<(param: T) => MaybePromise<void>>;
    <T extends readonly [unknown, ...unknown[]]>(cases: readonly T[]) : TestCall<(...args: [...T]) => MaybePromise<void>>;
    <T>(cases: readonly T[]) : TestCall<(...args: T[]) => MaybePromise<void>>;
    <T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]) : TestCall<(param: T) => MaybePromise<void>>;
}

declare type Tester = (this: TesterContext, a: any, b: any, customTesters: Array<Tester>) => boolean | undefined;

declare interface TesterContext {
    	equals: (a: unknown, b: unknown, customTesters?: Array<Tester>, strictCheck?: boolean) => boolean;
}

export declare type TestFileInfo = {
    testId: string;
    testPath: TestPath;
    project: string;
    tests: TestInfo[];
};

export declare type TestFileResult = TestResult & {
    results: TestResult[];
    snapshotResult?: SnapshotResult;
    coverage?: Record<string, FileCoverageData>;
    /**
     * Raw coverage payload used internally between workers and the pool.
     * Stripped at the pool boundary before results are exposed to reporters.
     *
     * @internal
     */ coverageRaw?: unknown;
    /**
     * Perfetto-compatible trace events. Stripped at the pool boundary.
     *
     * @internal
     */ traceEvents?: TraceEvent[];
};

declare type TestFn<ExtraContext = object> = TestCall<TestCallbackFn<ExtraContext>>;

export declare interface TestForFn<ExtraContext = object> {
    <T>(cases: readonly T[]) : TestCall<(param: T, context: TestContext & ExtraContext) => MaybePromise<void>>;
    <T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]) : TestCall<(param: T, context: TestContext & ExtraContext) => MaybePromise<void>>;
}

export declare type TestInfo = TestCaseInfo | (TestSuiteInfo & {
    tests: TestInfo[];
});

/**
 * Per-test options accepted as the second argument of `test` / `it` / `test.each` /
 * `test.for`. Passing a plain `number` as the last argument is equivalent to
 * `{ timeout: n }`.
 *
 * Declared as an `interface` so consumers can use module augmentation to add
 * fields in the future without breaking source compatibility.
 */ export declare interface TestOptions {
    /**
     * Per-test timeout in milliseconds. Overrides `test.testTimeout`.
     */ timeout?: number;
    /**
     * Number of times to retry the test if it fails. Overrides `test.retry`.
     *
     * @default 0
     */ retry?: number;
    /**
     * Number of times to re-run the test after it has already passed. The test is
     * considered failed as soon as any run fails. Total executions per case is
     * `repeats + 1`. Orthogonal to `retry`: each repeat independently honors the
     * configured retry budget.
     *
     * @default 0
     */ repeats?: number;
    /**
     * Initial metadata for this test or suite. Suite metadata is inherited by
     * descendant suites and tests; child metadata overrides inherited keys.
     */ meta?: TaskMeta;
}

/** The test file original path */ declare type TestPath = string;

declare type TestProject = string | InlineProjectConfig;

export declare type TestResult = {
    testId: string;
    status: TestResultStatus;
    name: string;
    testPath: TestPath;
    parentNames?: string[];
    duration?: number;
    errors?: FormattedError[];
    retryErrors?: FormattedError[];
    retryCount?: number;
    project: string;
    meta?: TaskMeta;
    heap?: number;
};

declare type TestResultStatus = 'skip' | 'pass' | 'fail' | 'todo';

declare type TestRunMode = 'run' | 'skip' | 'todo' | 'only';

declare class TestStateManager {
    runningModules: Map<string, {
        runningTests: TestCaseInfo[];
        results: TestResult[];
    }>;
    testModules: TestFileResult[];
    testFiles: string[] | undefined;
    onTestFileStart(testPath: string): void;
    onTestCaseResult(result: TestResult): void;
    onTestCaseStart(test: TestCaseInfo): void;
    getCountOfFailedTests(): number;
    onTestFileResult(test: TestFileResult): void;
    reset(): void;
}

export declare type TestSuiteInfo = {
    testId: string;
    name: string;
    parentNames?: string[];
    testPath: TestPath;
    project: string;
    type: 'suite';
    /** Only included when `includeTaskLocation` config is enabled */ location?: Location_2;
    meta?: TaskMeta;
    runMode: TestRunMode;
};

declare type TextLcovOptions = ProjectOptions;

declare interface TextOptions extends FileOptions {
    maxCols: number;
    skipEmpty: boolean;
    skipFull: boolean;
}

declare type TextSummaryOptions = FileOptions;

/** check thresholds for matched files */ declare type ThresholdGlobRecord = Record<string, CoverageThreshold & {
    /**
     * check thresholds per file
     * @default false
     */ perFile?: boolean;
}>;

declare type Tick = (tickValue: number | string | TemporalDuration) => number;

declare type TickAsync = (tickValue: number | string | TemporalDuration) => Promise<number>;

declare type TickMode = "nextAsync" | "manual" | "interval";

declare type Timer = TimerInitialProps;

declare type TimeRemaining = () => number;

declare type TimerHeap = {
    timers: Timer[];
    peek: () => Timer | undefined;
    push: (timer: Timer) => void;
    pop: () => Timer | undefined;
    remove: (timer: Timer) => void;
};

declare type TimerId = number | NodeImmediate | Timer;

declare type TimerInitialProps = {
    func: VoidVarArgsFunc;
    args?: unknown[];
    type?: 'Timeout' | 'Interval' | 'Immediate' | 'AnimationFrame' | 'IdleCallback';
    delay?: number;
    callAt?: number;
    createdAt?: number;
    immediate?: boolean;
    id?: number;
    error?: Error;
    interval?: number;
    animation?: boolean;
    requestIdleCallback?: boolean;
    order?: number;
    heapIndex?: number;
};

declare interface Totals {
    total: number;
    covered: number;
    skipped: number;
    pct: number;
}

/**
 * Perfetto/Chrome trace event (subset). Emitted by the worker-side
 * `PhaseTracker` and consumed by the controller below.
 *
 * `ph`:
 * - `'X'`: complete (sliced) event with `dur` — drawn as a slice
 * - `'M'`: metadata (process/thread name, sort index)
 * - `'C'`: counter — `args` numeric values are plotted as tracks
 */ declare type TraceEvent = {
    name: string;
    cat: string;
    ph: 'X' | 'M' | 'C';
    ts: number;
    dur?: number;
    pid: number;
    tid: number;
    args?: Record<string, string | number | boolean | undefined>;
};

declare class TraceMap implements SourceMap {
    version: SourceMapV3['version'];
    file: SourceMapV3['file'];
    names: SourceMapV3['names'];
    sourceRoot: SourceMapV3['sourceRoot'];
    sources: SourceMapV3['sources'];
    sourcesContent: SourceMapV3['sourcesContent'];
    ignoreList: SourceMapV3['ignoreList'];
    resolvedSources: string[];
    private _encoded;
    private _decoded;
    private _decodedMemo;
    private _bySources;
    private _bySourceMemos;
    constructor(map: Ro<SourceMapInput>, mapUrl?: string | null);
}

declare interface Tree<N extends Node_2 = Node_2> {
    getRoot(): N;
    visit(visitor: Partial<Visitor<N>>, state: any): void;
}

declare type Truthy<T> = Exclude<T, Falsy>;

declare interface UncheckedSnapshot {
    	filePath: string;
    	keys: Array<string>;
}

declare type Uninstall = () => void;

export declare type Use<T> = (value: T) => Promise<void>;

declare interface UserConsoleLog {
    content: string;
    name: string;
    taskId?: string;
    taskName?: string;
    taskParentNames?: string[];
    taskType?: 'file' | 'suite' | 'case';
    trace?: string;
    testPath: TestPath;
    /**
     * Owning project. A test path alone does not identify the emitter once
     * several projects run the same file, and consumers that attribute output to
     * a file (the blob reporter's replay track, the browser host's sink routing)
     * cannot recover it from the other fields.
     */ project: string;
    type: ConsoleStreamType;
}

declare type VerboseReporterOptions = Omit<DefaultReporterOptions, 'summary'>;

declare interface Visitor<N extends Node_2 = Node_2> {
    onStart(root: N, state: any): void;
    onSummary(root: N, state: any): void;
    onDetail(root: N, state: any): void;
    onSummaryEnd(root: N, state: any): void;
    onEnd(root: N, state: any): void;
}

declare type VitestAssertion<
	A,
	T
> = { [K in keyof A] : A[K] extends Chai.Assertion ? Assertion_2<T> : A[K] extends (...args: any[]) => any ? A[K] : VitestAssertion<A[K], T> } & ((type: string, message?: string) => Assertion_2);

declare type VitestExpectProperties = {
    [K in keyof ExpectStatic_2]: ExpectStatic_2[K];
};

declare type VoidVarArgsFunc = (...args: unknown[]) => void;

declare type WaitForCallback<T> = () => MaybePromise<T>;

declare interface WaitForOptions {
    timeout?: number;
    interval?: number;
}

declare interface WaitUntilOptions {
    timeout?: number;
    interval?: number;
}

declare type Watermark = [number, number];

declare interface Watermarks {
    statements: Watermark;
    functions: Watermark;
    branches: Watermark;
    lines: Watermark;
}

declare type WithAsymmetricMatcher<T> = T | AsymmetricMatcher<unknown>;

declare type XInput = {
    x_google_ignoreList?: SourceMapV3['ignoreList'];
};

declare interface XmlWriter {
    indent(str: string): string;
    /**
     * writes the opening XML tag with the supplied attributes
     */
    openTag(name: string, attrs?: any): void;
    /**
     * closes an open XML tag.
     */
    closeTag(name: string): void;
    /**
     * writes a tag and its value opening and closing it at the same time
     */
    inlineTag(name: string, attrs?: any, content?: string): void;
    /**
     * closes all open tags and ends the document
     */
    closeAll(): void;
}

export { }
