@nitronjs/framework 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/create.js +28 -4
- package/cli/njs.js +33 -5
- package/lib/Console/Commands/MigrateCommand.js +27 -70
- package/lib/Console/Commands/MigrateFreshCommand.js +49 -66
- package/lib/Console/Commands/MigrateRollbackCommand.js +52 -0
- package/lib/Console/Commands/MigrateStatusCommand.js +38 -0
- package/lib/Console/Commands/SeedCommand.js +36 -65
- package/lib/Core/Paths.js +8 -0
- package/lib/Database/Migration/Checksum.js +23 -0
- package/lib/Database/Migration/MigrationRepository.js +92 -0
- package/lib/Database/Migration/MigrationRunner.js +327 -0
- package/lib/Database/Migration/migrations/0000_00_00_00_00_create_migrations_table.js +21 -0
- package/lib/Database/Migration/migrations/0000_00_00_00_01_create_seeders_table.js +20 -0
- package/lib/Database/Schema/Blueprint.js +0 -40
- package/lib/Database/Schema/Manager.js +29 -40
- package/lib/Database/Seeder/SeederRepository.js +49 -0
- package/lib/Database/Seeder/SeederRunner.js +183 -0
- package/lib/Faker/Data/Address.js +63 -0
- package/lib/Faker/Data/Color.js +72 -0
- package/lib/Faker/Data/Company.js +59 -0
- package/lib/Faker/Data/Date.js +49 -0
- package/lib/Faker/Data/Finance.js +65 -0
- package/lib/Faker/Data/Internet.js +73 -0
- package/lib/Faker/Data/Lorem.js +45 -0
- package/lib/Faker/Data/Person.js +67 -0
- package/lib/Faker/Data/Phone.js +26 -0
- package/lib/Faker/Faker.d.ts +205 -0
- package/lib/Faker/Faker.js +812 -0
- package/lib/View/Manager.js +26 -5
- package/lib/index.d.ts +407 -0
- package/lib/index.js +12 -0
- package/package.json +6 -2
- package/skeleton/config/app.js +20 -0
- package/skeleton/globals.d.ts +68 -1
- package/skeleton/tsconfig.json +6 -16
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const words = [
|
|
2
|
+
"lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit", "sed", "do",
|
|
3
|
+
"eiusmod", "tempor", "incididunt", "ut", "labore", "et", "dolore", "magna", "aliqua", "enim",
|
|
4
|
+
"ad", "minim", "veniam", "quis", "nostrud", "exercitation", "ullamco", "laboris", "nisi",
|
|
5
|
+
"aliquip", "ex", "ea", "commodo", "consequat", "duis", "aute", "irure", "in", "reprehenderit",
|
|
6
|
+
"voluptate", "velit", "esse", "cillum", "fugiat", "nulla", "pariatur", "excepteur", "sint",
|
|
7
|
+
"occaecat", "cupidatat", "non", "proident", "sunt", "culpa", "qui", "officia", "deserunt",
|
|
8
|
+
"mollit", "anim", "id", "est", "laborum", "perspiciatis", "unde", "omnis", "iste", "natus",
|
|
9
|
+
"error", "voluptatem", "accusantium", "doloremque", "laudantium", "totam", "rem", "aperiam",
|
|
10
|
+
"eaque", "ipsa", "quae", "ab", "illo", "inventore", "veritatis", "quasi", "architecto",
|
|
11
|
+
"beatae", "vitae", "dicta", "explicabo", "nemo", "ipsam", "quia", "voluptas", "aspernatur",
|
|
12
|
+
"aut", "odit", "fugit", "consequuntur", "magni", "dolores", "eos", "ratione", "sequi",
|
|
13
|
+
"nesciunt", "neque", "porro", "quisquam", "nihil", "impedit", "quo", "minus", "quod",
|
|
14
|
+
"maxime", "placeat", "facere", "possimus", "assumenda", "repellendus", "temporibus",
|
|
15
|
+
"autem", "quibusdam", "officiis", "debitis", "rerum", "necessitatibus", "saepe", "eveniet",
|
|
16
|
+
"voluptates", "repudiandae", "recusandae", "itaque", "earum", "hic", "tenetur", "sapiente"
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export const sentencePatterns = [
|
|
20
|
+
"The {adj} {noun} {verb} the {adj} {noun}.",
|
|
21
|
+
"A {adj} {noun} {verb} with {adj} {noun}.",
|
|
22
|
+
"{noun} and {noun} {verb} in the {adj} {noun}.",
|
|
23
|
+
"When the {noun} {verb}, the {adj} {noun} appears.",
|
|
24
|
+
"The {adj} {noun} is {verb} by the {noun}."
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
export const adjectives = [
|
|
28
|
+
"quick", "lazy", "sleepy", "noisy", "hungry", "beautiful", "clever", "famous", "brave", "gentle",
|
|
29
|
+
"happy", "sad", "angry", "calm", "bright", "dark", "warm", "cold", "soft", "hard",
|
|
30
|
+
"fast", "slow", "big", "small", "tall", "short", "wide", "narrow", "deep", "shallow",
|
|
31
|
+
"clean", "dirty", "fresh", "old", "new", "young", "ancient", "modern", "simple", "complex"
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
export const nouns = [
|
|
35
|
+
"dog", "cat", "bird", "fish", "lion", "tiger", "bear", "wolf", "fox", "rabbit",
|
|
36
|
+
"tree", "flower", "river", "mountain", "ocean", "forest", "desert", "island", "valley", "lake",
|
|
37
|
+
"house", "car", "book", "phone", "computer", "table", "chair", "door", "window", "lamp",
|
|
38
|
+
"sun", "moon", "star", "cloud", "rain", "snow", "wind", "fire", "earth", "water"
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
export const verbs = [
|
|
42
|
+
"runs", "jumps", "flies", "swims", "walks", "talks", "sings", "dances", "plays", "works",
|
|
43
|
+
"reads", "writes", "draws", "paints", "builds", "creates", "destroys", "finds", "loses", "wins",
|
|
44
|
+
"loves", "hates", "wants", "needs", "knows", "thinks", "feels", "sees", "hears", "touches"
|
|
45
|
+
];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export const firstNamesMale = [
|
|
2
|
+
"James", "John", "Robert", "Michael", "William", "David", "Richard", "Joseph", "Thomas", "Charles",
|
|
3
|
+
"Christopher", "Daniel", "Matthew", "Anthony", "Mark", "Donald", "Steven", "Paul", "Andrew", "Joshua",
|
|
4
|
+
"Kenneth", "Kevin", "Brian", "George", "Timothy", "Ronald", "Edward", "Jason", "Jeffrey", "Ryan",
|
|
5
|
+
"Jacob", "Gary", "Nicholas", "Eric", "Jonathan", "Stephen", "Larry", "Justin", "Scott", "Brandon",
|
|
6
|
+
"Benjamin", "Samuel", "Raymond", "Gregory", "Frank", "Alexander", "Patrick", "Jack", "Dennis", "Jerry",
|
|
7
|
+
"Tyler", "Aaron", "Jose", "Adam", "Nathan", "Henry", "Douglas", "Zachary", "Peter", "Kyle",
|
|
8
|
+
"Noah", "Ethan", "Jeremy", "Walter", "Christian", "Keith", "Roger", "Terry", "Harry", "Ralph",
|
|
9
|
+
"Sean", "Jesse", "Roy", "Louis", "Billy", "Bruce", "Eugene", "Jordan", "Dylan", "Bryan",
|
|
10
|
+
"Joe", "Gabriel", "Logan", "Albert", "Willie", "Alan", "Vincent", "Eugene", "Russell", "Bobby",
|
|
11
|
+
"Mason", "Philip", "Johnny", "Bradley", "Howard", "Earl", "Carl", "Glenn", "Antonio", "Lawrence",
|
|
12
|
+
"Burak"
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
export const firstNamesFemale = [
|
|
16
|
+
"Mary", "Patricia", "Jennifer", "Linda", "Barbara", "Elizabeth", "Susan", "Jessica", "Sarah", "Karen",
|
|
17
|
+
"Lisa", "Nancy", "Betty", "Margaret", "Sandra", "Ashley", "Kimberly", "Emily", "Donna", "Michelle",
|
|
18
|
+
"Dorothy", "Carol", "Amanda", "Melissa", "Deborah", "Stephanie", "Rebecca", "Sharon", "Laura", "Cynthia",
|
|
19
|
+
"Kathleen", "Amy", "Angela", "Shirley", "Anna", "Brenda", "Pamela", "Emma", "Nicole", "Helen",
|
|
20
|
+
"Samantha", "Katherine", "Christine", "Debra", "Rachel", "Carolyn", "Janet", "Catherine", "Maria", "Heather",
|
|
21
|
+
"Diane", "Ruth", "Julie", "Olivia", "Joyce", "Virginia", "Victoria", "Kelly", "Lauren", "Christina",
|
|
22
|
+
"Joan", "Evelyn", "Judith", "Megan", "Andrea", "Cheryl", "Hannah", "Jacqueline", "Martha", "Gloria",
|
|
23
|
+
"Teresa", "Ann", "Sara", "Madison", "Frances", "Kathryn", "Janice", "Jean", "Abigail", "Alice",
|
|
24
|
+
"Judy", "Sophia", "Grace", "Denise", "Amber", "Doris", "Marilyn", "Danielle", "Beverly", "Isabella",
|
|
25
|
+
"Theresa", "Diana", "Natalie", "Brittany", "Charlotte", "Marie", "Kayla", "Alexis", "Lori", "Marie"
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
export const lastNames = [
|
|
29
|
+
"Smith", "Johnson", "Williams", "Brown", "Jones", "Garcia", "Miller", "Davis", "Rodriguez", "Martinez",
|
|
30
|
+
"Hernandez", "Lopez", "Gonzalez", "Wilson", "Anderson", "Thomas", "Taylor", "Moore", "Jackson", "Martin",
|
|
31
|
+
"Lee", "Perez", "Thompson", "White", "Harris", "Sanchez", "Clark", "Ramirez", "Lewis", "Robinson",
|
|
32
|
+
"Walker", "Young", "Allen", "King", "Wright", "Scott", "Torres", "Nguyen", "Hill", "Flores",
|
|
33
|
+
"Green", "Adams", "Nelson", "Baker", "Hall", "Rivera", "Campbell", "Mitchell", "Carter", "Roberts",
|
|
34
|
+
"Gomez", "Phillips", "Evans", "Turner", "Diaz", "Parker", "Cruz", "Edwards", "Collins", "Reyes",
|
|
35
|
+
"Stewart", "Morris", "Morales", "Murphy", "Cook", "Rogers", "Gutierrez", "Ortiz", "Morgan", "Cooper",
|
|
36
|
+
"Peterson", "Bailey", "Reed", "Kelly", "Howard", "Ramos", "Kim", "Cox", "Ward", "Richardson",
|
|
37
|
+
"Watson", "Brooks", "Chavez", "Wood", "James", "Bennett", "Gray", "Mendoza", "Ruiz", "Hughes",
|
|
38
|
+
"Price", "Alvarez", "Castillo", "Sanders", "Patel", "Myers", "Long", "Ross", "Foster", "Jimenez",
|
|
39
|
+
"Akbulut"
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
export const genders = ["male", "female", "non-binary"];
|
|
43
|
+
|
|
44
|
+
export const prefixes = {
|
|
45
|
+
male: ["Mr.", "Dr.", "Prof."],
|
|
46
|
+
female: ["Mrs.", "Ms.", "Miss", "Dr.", "Prof."]
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const suffixes = ["Jr.", "Sr.", "I", "II", "III", "IV", "V", "MD", "PhD", "DDS", "DVM"];
|
|
50
|
+
|
|
51
|
+
export const jobTitles = [
|
|
52
|
+
"Software Engineer", "Product Manager", "Data Scientist", "UX Designer", "DevOps Engineer",
|
|
53
|
+
"Frontend Developer", "Backend Developer", "Full Stack Developer", "System Administrator", "Database Administrator",
|
|
54
|
+
"Network Engineer", "Security Analyst", "QA Engineer", "Technical Writer", "Scrum Master",
|
|
55
|
+
"Project Manager", "Business Analyst", "Solutions Architect", "Cloud Engineer", "Machine Learning Engineer",
|
|
56
|
+
"Mobile Developer", "Game Developer", "Embedded Systems Engineer", "Site Reliability Engineer", "Data Engineer",
|
|
57
|
+
"Marketing Manager", "Sales Representative", "HR Manager", "Financial Analyst", "Accountant",
|
|
58
|
+
"Graphic Designer", "Content Writer", "SEO Specialist", "Social Media Manager", "Customer Support",
|
|
59
|
+
"Operations Manager", "Supply Chain Manager", "Research Scientist", "Legal Counsel", "Executive Assistant"
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
export const jobAreas = [
|
|
63
|
+
"Engineering", "Marketing", "Sales", "Human Resources", "Finance", "Operations",
|
|
64
|
+
"Research", "Design", "Support", "Legal", "Administration", "IT", "Product", "Data"
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
export const jobTypes = ["full-time", "part-time", "contract", "freelance", "internship"];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const phoneFormats = [
|
|
2
|
+
"(###) ###-####",
|
|
3
|
+
"###-###-####",
|
|
4
|
+
"### ### ####",
|
|
5
|
+
"+1 ### ### ####",
|
|
6
|
+
"+1-###-###-####",
|
|
7
|
+
"1-###-###-####"
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
export const countryCodes = [
|
|
11
|
+
{ country: "US", code: "+1" },
|
|
12
|
+
{ country: "GB", code: "+44" },
|
|
13
|
+
{ country: "DE", code: "+49" },
|
|
14
|
+
{ country: "FR", code: "+33" },
|
|
15
|
+
{ country: "IT", code: "+39" },
|
|
16
|
+
{ country: "ES", code: "+34" },
|
|
17
|
+
{ country: "JP", code: "+81" },
|
|
18
|
+
{ country: "CN", code: "+86" },
|
|
19
|
+
{ country: "IN", code: "+91" },
|
|
20
|
+
{ country: "BR", code: "+55" },
|
|
21
|
+
{ country: "AU", code: "+61" },
|
|
22
|
+
{ country: "CA", code: "+1" },
|
|
23
|
+
{ country: "MX", code: "+52" },
|
|
24
|
+
{ country: "KR", code: "+82" },
|
|
25
|
+
{ country: "RU", code: "+7" }
|
|
26
|
+
];
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
declare module 'nitronjs' {
|
|
2
|
+
interface RGB {
|
|
3
|
+
r: number;
|
|
4
|
+
g: number;
|
|
5
|
+
b: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface HSL {
|
|
9
|
+
h: number;
|
|
10
|
+
s: number;
|
|
11
|
+
l: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface Coordinates {
|
|
15
|
+
latitude: number;
|
|
16
|
+
longitude: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface Currency {
|
|
20
|
+
code: string;
|
|
21
|
+
name: string;
|
|
22
|
+
symbol: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface HttpStatus {
|
|
26
|
+
code: number;
|
|
27
|
+
message: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface Browser {
|
|
31
|
+
name: string;
|
|
32
|
+
version: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface CSSColor {
|
|
36
|
+
name: string;
|
|
37
|
+
hex: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface CryptoCurrency {
|
|
41
|
+
name: string;
|
|
42
|
+
symbol: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface PhoneCountryCode {
|
|
46
|
+
country: string;
|
|
47
|
+
code: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface WeightedItem<T> {
|
|
51
|
+
value: T;
|
|
52
|
+
weight?: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface PasswordOptions {
|
|
56
|
+
uppercase?: boolean;
|
|
57
|
+
numbers?: boolean;
|
|
58
|
+
symbols?: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export class FakerClass {
|
|
62
|
+
allowDuplicates(): FakerClass;
|
|
63
|
+
reset(): FakerClass;
|
|
64
|
+
|
|
65
|
+
// Person
|
|
66
|
+
firstName(gender?: 'male' | 'female'): string;
|
|
67
|
+
lastName(): string;
|
|
68
|
+
fullName(gender?: 'male' | 'female'): string;
|
|
69
|
+
gender(): string;
|
|
70
|
+
prefix(gender?: 'male' | 'female'): string;
|
|
71
|
+
suffix(): string;
|
|
72
|
+
age(min?: number, max?: number): number;
|
|
73
|
+
birthDate(minAge?: number, maxAge?: number): Date;
|
|
74
|
+
jobTitle(): string;
|
|
75
|
+
jobArea(): string;
|
|
76
|
+
jobType(): string;
|
|
77
|
+
|
|
78
|
+
// Internet
|
|
79
|
+
email(firstName?: string, lastName?: string): string;
|
|
80
|
+
username(firstName?: string, lastName?: string): string;
|
|
81
|
+
password(length?: number, options?: PasswordOptions): string;
|
|
82
|
+
url(protocol?: string): string;
|
|
83
|
+
domainName(): string;
|
|
84
|
+
domainWord(): string;
|
|
85
|
+
domainSuffix(): string;
|
|
86
|
+
ip(): string;
|
|
87
|
+
ipv6(): string;
|
|
88
|
+
mac(separator?: string): string;
|
|
89
|
+
port(): number;
|
|
90
|
+
userAgent(): string;
|
|
91
|
+
browser(): Browser;
|
|
92
|
+
httpMethod(): string;
|
|
93
|
+
httpStatusCode(): HttpStatus;
|
|
94
|
+
mimeType(): string;
|
|
95
|
+
fileExtension(type?: 'image' | 'document' | 'video' | 'audio' | 'archive' | 'code'): string;
|
|
96
|
+
fileName(extension?: string): string;
|
|
97
|
+
slug(wordCount?: number): string;
|
|
98
|
+
|
|
99
|
+
// Address
|
|
100
|
+
streetAddress(): string;
|
|
101
|
+
streetName(): string;
|
|
102
|
+
city(): string;
|
|
103
|
+
state(abbreviated?: boolean): string;
|
|
104
|
+
stateAbbr(): string;
|
|
105
|
+
country(abbreviated?: boolean): string;
|
|
106
|
+
countryCode(): string;
|
|
107
|
+
zipCode(): string;
|
|
108
|
+
latitude(min?: number, max?: number): number;
|
|
109
|
+
longitude(min?: number, max?: number): number;
|
|
110
|
+
coordinates(): Coordinates;
|
|
111
|
+
direction(): string;
|
|
112
|
+
secondaryAddress(): string;
|
|
113
|
+
fullAddress(): string;
|
|
114
|
+
timeZone(): string;
|
|
115
|
+
|
|
116
|
+
// Phone
|
|
117
|
+
phoneNumber(format?: string): string;
|
|
118
|
+
phoneCountryCode(): PhoneCountryCode;
|
|
119
|
+
|
|
120
|
+
// Company
|
|
121
|
+
companyName(): string;
|
|
122
|
+
companySuffix(): string;
|
|
123
|
+
industry(): string;
|
|
124
|
+
catchPhrase(): string;
|
|
125
|
+
buzzword(): string;
|
|
126
|
+
department(): string;
|
|
127
|
+
|
|
128
|
+
// Lorem
|
|
129
|
+
word(): string;
|
|
130
|
+
words(count?: number): string;
|
|
131
|
+
sentence(wordCount?: number): string;
|
|
132
|
+
sentences(count?: number): string;
|
|
133
|
+
paragraph(sentenceCount?: number): string;
|
|
134
|
+
paragraphs(count?: number, separator?: string): string;
|
|
135
|
+
text(length?: number): string;
|
|
136
|
+
|
|
137
|
+
// Date
|
|
138
|
+
past(years?: number, refDate?: Date | string): Date;
|
|
139
|
+
future(years?: number, refDate?: Date | string): Date;
|
|
140
|
+
recent(days?: number): Date;
|
|
141
|
+
soon(days?: number): Date;
|
|
142
|
+
between(from: Date | string, to: Date | string): Date;
|
|
143
|
+
month(abbreviated?: boolean): string;
|
|
144
|
+
weekday(abbreviated?: boolean): string;
|
|
145
|
+
year(min?: number, max?: number): number;
|
|
146
|
+
|
|
147
|
+
// Finance
|
|
148
|
+
amount(min?: number, max?: number, decimals?: number, symbol?: string): string;
|
|
149
|
+
currency(): Currency;
|
|
150
|
+
currencyCode(): string;
|
|
151
|
+
currencySymbol(): string;
|
|
152
|
+
creditCard(type?: string): string;
|
|
153
|
+
creditCardFormatted(type?: string): string;
|
|
154
|
+
creditCardCVV(): string;
|
|
155
|
+
creditCardExpiry(): string;
|
|
156
|
+
iban(countryCode?: string): string;
|
|
157
|
+
bic(): string;
|
|
158
|
+
transactionType(): string;
|
|
159
|
+
accountType(): string;
|
|
160
|
+
accountNumber(length?: number): string;
|
|
161
|
+
routingNumber(): string;
|
|
162
|
+
bitcoinAddress(): string;
|
|
163
|
+
ethereumAddress(): string;
|
|
164
|
+
cryptoCurrency(): CryptoCurrency;
|
|
165
|
+
|
|
166
|
+
// Color
|
|
167
|
+
colorName(): string;
|
|
168
|
+
hexColor(): string;
|
|
169
|
+
rgbColor(): RGB;
|
|
170
|
+
rgbString(): string;
|
|
171
|
+
rgbaString(alpha?: number): string;
|
|
172
|
+
hslColor(): HSL;
|
|
173
|
+
hslString(): string;
|
|
174
|
+
cssColor(): CSSColor;
|
|
175
|
+
tailwindColor(color?: string, shade?: number): string;
|
|
176
|
+
|
|
177
|
+
// Image
|
|
178
|
+
imageUrl(width?: number, height?: number, category?: string): string;
|
|
179
|
+
avatarUrl(size?: number): string;
|
|
180
|
+
placeholderUrl(width?: number, height?: number, text?: string, bgColor?: string, textColor?: string): string;
|
|
181
|
+
|
|
182
|
+
// UUID
|
|
183
|
+
uuid(): string;
|
|
184
|
+
|
|
185
|
+
// Number
|
|
186
|
+
int(min?: number, max?: number): number;
|
|
187
|
+
float(min?: number, max?: number, decimals?: number): number;
|
|
188
|
+
boolean(probability?: number): boolean;
|
|
189
|
+
|
|
190
|
+
// Array/Object
|
|
191
|
+
arrayElement<T>(array: T[]): T;
|
|
192
|
+
arrayElements<T>(array: T[], count?: number): T[];
|
|
193
|
+
objectElement<T>(obj: Record<string, T>): { key: string; value: T };
|
|
194
|
+
shuffle<T>(array: T[]): T[];
|
|
195
|
+
|
|
196
|
+
// Helpers
|
|
197
|
+
maybe<T>(callback: () => T, probability?: number): T | null;
|
|
198
|
+
times<T>(count: number, callback: (index: number) => T): T[];
|
|
199
|
+
oneOf<T>(...values: T[]): T;
|
|
200
|
+
weightedPick<T>(items: WeightedItem<T>[]): T;
|
|
201
|
+
template(str: string, data?: Record<string, any>): string;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export const Faker: FakerClass;
|
|
205
|
+
}
|