export interface SequenceGenerator { generatorType: 'sequence'; call: (counter: number) => T; } export interface PerBuildGenerator { generatorType: 'perBuild'; call: () => T; } export interface OneOfGenerator { generatorType: 'oneOf'; call: () => T; } export type FieldGenerator = SequenceGenerator | OneOfGenerator | PerBuildGenerator; export type Field = T | FieldGenerator | FieldsConfiguration; export type FieldsConfiguration = { readonly [Key in keyof FactoryResultType]: Field; }; export type Overrides = { [Key in keyof FactoryResultType]?: 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 interface Builder { (buildTimeConfig?: BuildTimeConfig): FactoryResultType; reset(): void; one(buildTimeConfig?: BuildTimeConfig): FactoryResultType; many(count: number, buildTimeConfig?: BuildTimeConfig): FactoryResultType[]; } export declare const build: (factoryNameOrConfig: string | BuildConfiguration, configObject?: BuildConfiguration | undefined) => Builder; export declare const oneOf: (...options: T[]) => OneOfGenerator; export declare const bool: () => OneOfGenerator; type Sequence = { (): SequenceGenerator; (userProvidedFunction: (count: number) => T): SequenceGenerator; }; export declare const sequence: Sequence; export declare const perBuild: (func: () => T) => PerBuildGenerator; export {}; //# sourceMappingURL=index.d.ts.map