@types/chance
- Version 1.1.6
- Published
- 13.5 kB
- No dependencies
- MIT license
Install
npm i @types/chance
yarn add @types/chance
pnpm add @types/chance
Overview
TypeScript definitions for chance
Index
Namespaces
Chance
- Chance
- ChanceStatic
- CharacterOptions
- CreditCardExpiration
- CreditCardType
- Currency
- DateOptions
- EmailOptions
- FalsyOptions
- FalsyType
- FirstNameNationalities
- FirstNameOptions
- FullNameOptions
- IntegerOptions
- LastNameNationalities
- LastNameOptions
- MacOptions
- MixinDescriptor
- Month
- Name
- NameOptions
- Options
- PrefixOptions
- Seed
- Seeded
- SentenceOptions
- Setter
- StringOptions
- SuffixOptions
- Timezone
- UniqueOptions
- UrlOptions
- WordOptions
Namespaces
namespace Chance
namespace Chance {}
interface Chance
interface Chance extends Seeded {}
property set
set: Setter;
method address
address: (opts?: Options) => string;
method age
age: (opts?: Options) => number;
method altitude
altitude: (opts?: Options) => number;
method ampm
ampm: () => string;
method android_id
android_id: () => string;
method animal
animal: (opts?: Options) => string;
method apple_token
apple_token: () => string;
method areacode
areacode: () => string;
method avatar
avatar: (opts?: Options) => string;
method bb_pin
bb_pin: () => string;
method birthday
birthday: { (): Date; (opts?: Options): string | Date };
method bool
bool: (opts?: { likelihood: number }) => boolean;
method capitalize
capitalize: (str: string) => string;
method cc
cc: (opts?: Options) => string;
method cc_type
cc_type: { (): string; (opts: Options): string | CreditCardType };
method cc_types
cc_types: () => CreditCardType[];
method cf
cf: (opts?: Options) => string;
method character
character: (opts?: Partial<CharacterOptions>) => string;
method city
city: () => string;
method coin
coin: () => string;
method color
color: (opts?: Options) => string;
method company
company: () => string;
method coordinates
coordinates: (opts?: Options) => string;
method country
country: (opts?: Options) => string;
method cpf
cpf: (opts?: { formatted: boolean }) => string;
method currency
currency: () => Currency;
method currency_pair
currency_pair: () => [Currency, Currency];
method d10
d10: () => number;
method d100
d100: () => number;
method d12
d12: () => number;
method d20
d20: () => number;
method d30
d30: () => number;
method d4
d4: () => number;
method d6
d6: () => number;
method d8
d8: () => number;
method date
date: { (): Date; (opts: DateOptions): string | Date };
method depth
depth: (opts?: Options) => number;
method dollar
dollar: (opts?: Options) => string;
method domain
domain: (opts?: Options) => string;
method email
email: (opts?: Partial<EmailOptions>) => string;
method euro
euro: (opts?: Options) => string;
method exp
exp: { (): string; (opts: Options): string | CreditCardExpiration };
method exp_month
exp_month: (opts?: Options) => string;
method exp_year
exp_year: (opts?: Options) => string;
method falsy
falsy: (ops?: FalsyOptions) => FalsyType;
https://chancejs.com/basics/falsy.html
method fbid
fbid: () => string;
method first
first: (opts?: Partial<FirstNameOptions>) => string;
method floating
floating: (opts?: Options) => number;
method gender
gender: () => string;
method geohash
geohash: (opts?: Options) => string;
method google_analytics
google_analytics: () => string;
method guid
guid: (options?: { version: 4 | 5 }) => string;
method hammertime
hammertime: () => number;
method hash
hash: (opts?: Options) => string;
method hashtag
hashtag: () => string;
method hour
hour: (opts?: Options) => number;
method integer
integer: (opts?: Partial<IntegerOptions>) => number;
method ip
ip: () => string;
method ipv6
ipv6: () => string;
method klout
klout: () => string;
method last
last: (opts?: LastNameOptions) => string;
method latitude
latitude: (opts?: Options) => number;
method letter
letter: (opts?: Options) => string;
method locale
locale: (opts?: { region: true }) => string;
method locales
locales: (opts?: { region: true }) => string[];
method longitude
longitude: (opts?: Options) => number;
method mac_address
mac_address: (opts?: Partial<MacOptions>) => string;
method mersenne_twister
mersenne_twister: (seed?: Seed) => any;
method millisecond
millisecond: () => number;
method minute
minute: () => number;
method mixin
mixin: (desc: MixinDescriptor) => any;
method month
month: { (): string; (opts: Options): Month };
method months
months: () => Month[];
method n
n: { <T>(generator: () => T, count: number): T[]; <T, O extends Options>( generator: (options: O) => T, count: number, options: O ): T[];};
method name
name: (opts?: Partial<NameOptions>) => string;
method name_prefix
name_prefix: (opts?: Partial<PrefixOptions>) => string;
method name_prefixes
name_prefixes: () => Name[];
method name_suffix
name_suffix: (opts?: SuffixOptions) => string;
method natural
natural: (opts?: Options) => number;
method normal
normal: (opts?: Options) => number;
method pad
pad: (num: number, width: number, padChar?: string) => string;
method paragraph
paragraph: (opts?: Options) => string;
method phone
phone: (opts?: Options) => string;
method pick
pick: { <T>(arr: T[]): T; <T>(arr: T[], count: number): T[] };
Deprecated
Use pickone
Deprecated
Use pickset
method pickone
pickone: <T>(arr: T[]) => T;
method pickset
pickset: <T>(arr: T[], count?: number) => T[];
method postal
postal: () => string;
method postcode
postcode: () => string;
method prefix
prefix: (opts?: Partial<PrefixOptions>) => string;
method profession
profession: (opts?: Options) => string;
method province
province: (opts?: Options) => string;
method provinces
provinces: () => Name[];
method radio
radio: (opts?: Options) => string;
method rpg
rpg: { (dice: string): number[]; (dice: string, opts?: Options): number | number[];};
method second
second: () => number;
method sentence
sentence: (opts?: Partial<SentenceOptions>) => string;
method shuffle
shuffle: <T>(arr: T[]) => T[];
method ssn
ssn: (opts?: Options) => string;
method state
state: (opts?: Options) => string;
method states
states: () => Name[];
method street
street: (opts?: Options) => string;
method street_suffix
street_suffix: () => Name;
method street_suffixes
street_suffixes: () => Name[];
method string
string: (opts?: Partial<StringOptions>) => string;
method suffix
suffix: (opts?: SuffixOptions) => string;
method syllable
syllable: (opts?: Options) => string;
method template
template: (template: string) => string;
method timestamp
timestamp: () => number;
method timezone
timezone: () => Timezone;
method tld
tld: () => string;
method tv
tv: (opts?: Options) => string;
method twitter
twitter: () => string;
method unique
unique: { <T>(generator: () => T, count: number): T[]; <T, O extends UniqueOptions<T>>( generator: (options: O) => T, count: number, options: O ): T[];};
method url
url: (opts?: Partial<UrlOptions>) => string;
method weekday
weekday: ( opts: Options) => | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday' | 'Sunday';
method weighted
weighted: <T>(values: T[], weights: number[]) => T;
method word
word: (opts?: Partial<WordOptions>) => string;
method wp7_anid
wp7_anid: () => string;
method wp8_anid2
wp8_anid2: () => string;
method year
year: (opts?: Options) => string;
method zip
zip: (opts?: Options) => string;
interface ChanceStatic
interface ChanceStatic {}
construct signature
new (): Chance;
construct signature
new (...seed: Seed[]): Chance;
construct signature
new (generator: () => any): Chance;
call signature
(): Chance;
call signature
(...seed: Seed[]): Chance;
call signature
(generator: () => any): Chance;
interface CharacterOptions
interface CharacterOptions {}
interface CreditCardExpiration
interface CreditCardExpiration {}
interface CreditCardType
interface CreditCardType {}
property length
length: number;
property name
name: string;
property prefix
prefix: string;
property short_name
short_name: string;
interface DateOptions
interface DateOptions {}
interface EmailOptions
interface EmailOptions {}
interface FalsyOptions
interface FalsyOptions {}
property pool
pool: FalsyType[];
interface FirstNameOptions
interface FirstNameOptions {}
property gender
gender: 'male' | 'female';
property nationality
nationality: FirstNameNationalities;
interface FullNameOptions
interface FullNameOptions {}
property middle
middle: boolean;
property middle_initial
middle_initial: boolean;
property prefix
prefix: boolean;
property suffix
suffix: boolean;
interface IntegerOptions
interface IntegerOptions {}
interface LastNameOptions
interface LastNameOptions {}
property nationality
nationality: LastNameNationalities;
interface MacOptions
interface MacOptions {}
property networkVersion
networkVersion: boolean;
property separator
separator: string;
interface MixinDescriptor
interface MixinDescriptor {}
index signature
[id: string]: (...args: any[]) => any;
interface Month
interface Month {}
interface Name
interface Name {}
property abbreviation
abbreviation: string;
property name
name: string;
interface Options
interface Options {}
index signature
[id: string]: any;
interface SentenceOptions
interface SentenceOptions {}
property punctuation
punctuation: '.' | '?' | ';' | '!' | ':' | boolean;
property words
words: number;
interface Setter
interface Setter {}
call signature
(key: 'firstNames', values: string[]): any;
call signature
(key: 'lastNames', values: string[]): any;
call signature
<T>(key: string, values: T[]): any;
call signature
(key: 'provinces', values: string[]): any;
call signature
(key: 'us_states_and_dc', values: string[]): any;
call signature
(key: 'territories', values: string[]): any;
call signature
(key: 'armed_forces', values: string[]): any;
call signature
(key: 'street_suffixes', values: string[]): any;
call signature
(key: 'months', values: string[]): any;
call signature
(key: 'cc_types', values: string[]): any;
call signature
(key: 'currency_types', values: string[]): any;
interface SuffixOptions
interface SuffixOptions {}
property full
full: boolean;
interface Timezone
interface Timezone {}
interface UrlOptions
interface UrlOptions {}
property domain
domain: string;
property domain_prefix
domain_prefix: string;
property extensions
extensions: string[];
property path
path: string;
property protocol
protocol: string;
interface WordOptions
interface WordOptions {}
property capitalize
capitalize: boolean;
property length
length: number;
property syllables
syllables: number;
type FalsyType
type FalsyType = false | null | undefined | 0 | typeof NaN | '';
type FirstNameNationalities
type FirstNameNationalities = 'en' | 'it';
type LastNameNationalities
type LastNameNationalities = | FirstNameNationalities | 'nl' | 'uk' | 'de' | 'jp' | 'es' | 'fr' | '*';
type NameOptions
type NameOptions = FullNameOptions & FirstNameOptions & LastNameOptions & PrefixOptions;
type PrefixOptions
type PrefixOptions = { gender: 'male' | 'female' | 'all' } & SuffixOptions;
type Seed
type Seed = number | string;
type StringOptions
type StringOptions = CharacterOptions & { length: number };
type UniqueOptions
type UniqueOptions<T> = { comparator?: ((array: T[], value: T) => boolean) | undefined;} & Options;
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/chance
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/chance)
- HTML<a href="https://www.jsdocs.io/package/@types/chance"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3911 ms. - Missing or incorrect documentation? Open an issue for this package.