import {expectError, expectType} from 'tsd'; import any from '.'; expectType<{ [key: string]: string }>(any.simpleObject()); expectType<{ a: number, b: number, c: number }>(any.objectWithKeys(['a', 'b', 'c'], {factory: any.integer()})); expectError(any.objectWithKeys()) expectType(any.fromList(['a', 1])) expectError(any.fromList()) expectType(any.subList(['a', 'b', 'c'])) expectType(any.subList(['a', 'b', 'c'], {size: 2})) expectError(any.subList()) expectType(any.string()); expectType(any.string({length: 1})); expectType(any.string({length: 1, alpha: true, pool: 'abcde', casing: 'lower', numeric: true, symbols: true})); expectType(any.word()) expectType(any.word({length: 1})) expectType(any.word({length: 1, capitalize: true})) expectType(any.word({length: 1, capitalize: true, syllables: 1})) expectType(any.sentence()) expectType(any.sentence({words: 1})) expectType(any.sentence({words: 1, punctuation: '.'})) expectType(any.paragraph()) expectType(any.paragraph({sentences: 1})) expectType(any.integer()) expectType(any.integer({min: 1})) expectType(any.integer({min: 1, max: 2})) expectType(any.float()) expectType(any.float({min: 1})) expectType(any.float({min: 1, max: 2})) expectType(any.float({min: 1, max: 2, fixed: 4})) expectType(any.boolean()) expectType(any.boolean({likelihood: 30})) expectType(any.url()); expectType(any.url({protocol: 'https'})); expectType(any.url({ protocol: 'https', domain: 'google', domain_prefix: 'a', path: 'search', extensions: ['.jpg'] })); expectType(any.email()); expectType(any.email({length: 1})); expectType(any.email({length: 1, domain: 'gmail.com'})); expectType(any.date());