declare global {
  namespace jest {
    interface Matchers<R, T = {}> {}
  }
}
/**
 * Structural shape of a bundler's `performance.buildCache`, kept structural so
 * core need not import each bundler's config type — the rsbuild and rslib
 * adapters pass their own (compatible) `buildCache` value.
 */ declare type AdapterBuildCache = boolean | {
    buildDependencies?: string[];
    cacheDirectory?: string;
    cacheDigest?: Array<string | undefined>;
};

/**
 * Build target shape(s) accepted across adapters: a single target string
 * (rsbuild / rslib `output.target`) or Rspack's `string | string[] | false`.
 */ export declare type AdapterBuildTarget = string | string[] | false | undefined;

/**
 * Normalized `performance.buildCache` that an adapter feeds to rstest.
 */ export declare type BuildCacheOutput = boolean | {
    cacheDirectory?: string;
    cacheDigest?: Array<string | undefined>;
    buildDependencies?: string[];
} | undefined;

/**
 * Whether a build target runs in Node (vs the browser). Recognizes Rspack's
 * `async-node` and any `node*` target, across single-string and array shapes.
 * Single source so adapters cannot drift on which targets count as Node.
 */
export declare const isNodeTarget: (target: AdapterBuildTarget) => boolean;

/**
 * Map a bundler's `performance.buildCache` to rstest's, resolving every
 * `buildDependencies` entry through {@link resolveCacheDependency} and adding
 * the config file itself as a dependency. Single source shared by the rsbuild
 * and rslib adapters, whose mappings are otherwise identical (the rspack
 * adapter has its own, persistent-cache-shaped variant).
 */
export declare const resolveBuildCache: ({ buildCache, configPath, root }: {
    buildCache?: AdapterBuildCache;
    configPath?: string;
    root?: string;
}) => BuildCacheOutput;

/**
 * Resolve one `buildDependencies` entry to a stable, normalized path so every
 * adapter computes the same cache key for the same inputs. Single source for
 * the per-entry resolution that previously diverged across the three adapters
 * (e.g. rslib skipped `normalize()`).
 *
 * Relative entries resolve against the config file's directory when a
 * `configPath` is given, else against `root`. Callers choose the base by which
 * argument they pass: the rsbuild and rslib adapters pass `configPath` (build
 * deps are relative to the config file); the rspack adapter passes only `root`
 * (Rspack resolves deps relative to the build `context`).
 */
export declare const resolveCacheDependency: ({ dependency, configPath, root }: {
    dependency: string;
    configPath?: string;
    root?: string;
}) => string;

/**
 * Default `testEnvironment` derived from a build target: Node targets map to
 * `'node'`, everything else (including no target) to `'happy-dom'`. Shared by
 * the rsbuild and rspack adapters; rslib keeps its own inverse rule (see its
 * call site) because libraries are Node-first, so an absent target → `'node'`.
 */
export declare const resolveTestEnvironmentFromTarget: (target: AdapterBuildTarget) => 'node' | 'happy-dom';

export { }
