UNPKG

ts-randomizer

Version:

A tool to create random data by type parameters

21 lines (20 loc) 750 B
import { SpecimenFactory } from './specimen-factory'; import { TypeDescription } from '../types'; type RandomizerArguments = [TypeDescription?]; export declare class Randomizer { /** * Creates anonymous variables by description of T. * @returns An anonymous variable of type T. */ static create<T>(...args: RandomizerArguments): T | undefined; /** * Creates many anonymous objects by requested type. * @returns A sequence of anonymous object of type T. */ static createMany<T>(firstArg?: TypeDescription | number, minCount?: number, maxCount?: number): T[] | undefined; /** * Returns a specimen factory */ static build<T>(...args: RandomizerArguments): SpecimenFactory<T>; } export {};