import type { Faker } from '@faker-js/faker'; export type SequenceFunction = (counter: number) => unknown; export interface SequenceGenerator { generatorType: 'sequence'; userProvidedFunction: SequenceFunction; call: (userProvidedFunction: SequenceFunction, counter: number) => unknown; } export interface FakerGenerator { generatorType: 'faker'; call: (fake: Faker) => any; } export interface PerBuildGenerator { generatorType: 'perBuild'; func: () => any; call: (f: () => any) => any; } export interface OneOfGenerator { generatorType: 'oneOf'; options: any[]; call: (options: T[]) => T; } export type FieldGenerator = FakerGenerator | SequenceGenerator | OneOfGenerator | PerBuildGenerator; export type Field = string | number | null | FieldGenerator | { [x: string]: Field | {}; } | any[]; export type FieldsConfiguration = { readonly [x in keyof FactoryResultType]: Field; }; export interface Overrides { [x: string]: Field; } export interface BuildTimeConfig { overrides?: Overrides; map?: (builtThing: FactoryResultType) => FactoryResultType; traits?: string | string[]; } export interface TraitsConfiguration { readonly [traitName: string]: { overrides?: Overrides; postBuild?: (builtThing: FactoryResultType) => FactoryResultType; }; } export interface BuildConfiguration { readonly fields: FieldsConfiguration; readonly traits?: TraitsConfiguration; readonly postBuild?: (x: FactoryResultType) => FactoryResultType; } export type ValueOf = T[keyof T]; export declare const build: (factoryNameOrConfig: string | BuildConfiguration, configObject?: BuildConfiguration) => ((buildTimeConfig?: BuildTimeConfig) => FactoryResultType); export declare const oneOf: (...options: T[]) => OneOfGenerator; export declare const bool: () => OneOfGenerator; export declare const sequence: (userProvidedFunction?: SequenceFunction) => SequenceGenerator; export declare const perBuild: (func: () => T) => PerBuildGenerator; export type FakerUserArgs = (fake: Faker) => any; export declare const fake: (userDefinedUsage: FakerUserArgs) => FakerGenerator;