import type { Config } from "@jest/types"; /** * This is the type for values in the optional object that can be passed to each * config exported by this package. * * @typeParam T - either `InitialOptions` (for the `global` key) or * `InitialProjectOptions` (for all other keys) from jest */ export type ExtraConfig = { /** * Additional values to spread into the default config. */ config?: T; /** * If provided, this wrapper function will be called with the default config * to generate the final config. * * @param config - the default config; if `config` is passed in this * `ExtraConfig` as well, it's values will be spread into the default config * before calling this function * @returns a promise that resolves to the final config value */ wrapper?: (config: T) => Promise; }; /** * This is the type of the optional argument for each of the exported * configurations. */ export type ExtraConfigs = { /** * Extra configurations and an an optional wrapper to apply to the global * config. */ global?: ExtraConfig; /** * Extra configurations and an an optional wrapper to apply to the `unit` * project config. */ unit?: ExtraConfig; /** * Extra configurations and an an optional wrapper to apply to the * `integration` project config. */ integration?: ExtraConfig; /** * Extra configurations and an an optional wrapper to apply to the `format` * project config. */ format?: ExtraConfig; /** * Extra configurations and an an optional wrapper to apply to the `lint` * project config. */ lint?: ExtraConfig; }; export declare const config: (extra: ExtraConfigs) => Promise; export declare const wrap: (wrapper: ((value: T) => Promise) | undefined, arg: T) => Promise;