domma-js 0.3.1-alpha → 0.7.0-alpha

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.
Files changed (39) hide show
  1. package/README.md +33 -30
  2. package/assets/types/config.d.ts +127 -0
  3. package/assets/types/dates.d.ts +209 -0
  4. package/assets/types/dom.d.ts +448 -0
  5. package/assets/types/elements.d.ts +606 -0
  6. package/assets/types/http.d.ts +97 -0
  7. package/assets/types/icons.d.ts +147 -0
  8. package/assets/types/index.d.ts +197 -0
  9. package/assets/types/models.d.ts +188 -0
  10. package/assets/types/storage.d.ts +93 -0
  11. package/assets/types/tables.d.ts +327 -0
  12. package/assets/types/theme.d.ts +136 -0
  13. package/assets/types/utils.d.ts +675 -0
  14. package/bin/domma-cli.js +144 -0
  15. package/package.json +12 -5
  16. package/public/dist/bundles/domma-complete.css +2316 -170
  17. package/public/dist/bundles/domma-data-focused.css +2686 -321
  18. package/public/dist/bundles/domma-essentials.css +2686 -321
  19. package/public/dist/bundles/domma-full.css +2686 -321
  20. package/public/dist/bundles/domma-grayve.css +13839 -0
  21. package/public/dist/bundles/domma-minimal.css +1591 -9
  22. package/public/dist/domma-syntax.min.js +8 -0
  23. package/public/dist/domma.css +1586 -4
  24. package/public/dist/domma.esm.js +4 -4
  25. package/public/dist/domma.min.js +4 -4
  26. package/public/dist/elements.css +368 -17
  27. package/public/dist/grid.css +3 -3
  28. package/public/dist/syntax.css +3 -3
  29. package/public/dist/themes/domma-themes.css +216 -3
  30. package/public/dist/themes/grayve.css +213 -0
  31. package/templates/kickstart/about/index.html +241 -0
  32. package/templates/kickstart/assets/logo/placeholder.svg +6 -0
  33. package/templates/kickstart/blog/index.html +227 -0
  34. package/templates/kickstart/contact/index.html +218 -0
  35. package/templates/kickstart/css/custom.css +121 -0
  36. package/templates/kickstart/docs/index.html +310 -0
  37. package/templates/kickstart/domma.config.json +47 -0
  38. package/templates/kickstart/index.html +170 -0
  39. package/templates/kickstart/js/app.js +161 -0
@@ -0,0 +1,675 @@
1
+ /**
2
+ * Domma Utils Module - TypeScript Declarations
3
+ * 120+ Lodash-compatible utility functions
4
+ */
5
+
6
+ export type Collection<T> = T[] | Record<string, T>;
7
+ export type Iteratee<T, R> = (value: T, index: number | string, collection: Collection<T>) => R;
8
+ export type Predicate<T> = (value: T, index: number | string, collection: Collection<T>) => boolean;
9
+ export type PropertyIteratee<T> = ((value: T) => any) | keyof T;
10
+
11
+ export interface DebounceOptions {
12
+ leading?: boolean;
13
+ trailing?: boolean;
14
+ maxWait?: number;
15
+ }
16
+
17
+ export interface ThrottleOptions {
18
+ leading?: boolean;
19
+ trailing?: boolean;
20
+ }
21
+
22
+ export interface TruncateOptions {
23
+ length?: number;
24
+ omission?: string;
25
+ separator?: string | RegExp;
26
+ }
27
+
28
+ export interface TemplateOptions {
29
+ partials?: Record<string, string>;
30
+ helpers?: Record<string, (...args: any[]) => any>;
31
+ }
32
+
33
+ export interface DebouncedFunction<T extends (...args: any[]) => any> {
34
+ (...args: Parameters<T>): ReturnType<T>;
35
+
36
+ cancel(): void;
37
+
38
+ flush(): ReturnType<T>;
39
+ }
40
+
41
+ export interface MemoizedFunction<T extends (...args: any[]) => any> {
42
+ (...args: Parameters<T>): ReturnType<T>;
43
+
44
+ cache: Map<any, ReturnType<T>>;
45
+ }
46
+
47
+ export interface Utils {
48
+ // ============================================
49
+ // Array Utilities
50
+ // ============================================
51
+
52
+ /** Creates an array of elements split into groups of the specified size */
53
+ chunk<T>(array: T[], size?: number): T[][];
54
+
55
+ /** Creates an array with all falsy values removed */
56
+ compact<T>(array: T[]): T[];
57
+
58
+ /** Creates a new array concatenating array with additional arrays/values */
59
+ concat<T>(array: T[], ...values: (T | T[])[]): T[];
60
+
61
+ /** Creates an array of values not included in the other given arrays */
62
+ difference<T>(array: T[], ...values: T[][]): T[];
63
+
64
+ /** Creates a slice of array with n elements dropped from the beginning */
65
+ drop<T>(array: T[], n?: number): T[];
66
+
67
+ /** Creates a slice of array with n elements dropped from the end */
68
+ dropRight<T>(array: T[], n?: number): T[];
69
+
70
+ /** Fills elements of array with value from start up to end */
71
+ fill<T>(array: T[], value: T, start?: number, end?: number): T[];
72
+
73
+ /** Returns the index of the first element predicate returns truthy for */
74
+ findIndex<T>(array: T[], predicate: Predicate<T>, fromIndex?: number): number;
75
+
76
+ /** Returns the index of the last element predicate returns truthy for */
77
+ findLastIndex<T>(array: T[], predicate: Predicate<T>, fromIndex?: number): number;
78
+
79
+ /** Gets the first element of array */
80
+ first<T>(array: T[]): T | undefined;
81
+
82
+ /** Alias for first */
83
+ head<T>(array: T[]): T | undefined;
84
+
85
+ /** Flattens array a single level deep */
86
+ flatten<T>(array: (T | T[])[]): T[];
87
+
88
+ /** Recursively flattens array */
89
+ flattenDeep<T>(array: any[]): T[];
90
+
91
+ /** Flattens array up to depth times */
92
+ flattenDepth<T>(array: any[], depth?: number): T[];
93
+
94
+ /** Returns an object composed from key-value pairs */
95
+ fromPairs<T>(pairs: [string, T][]): Record<string, T>;
96
+
97
+ /** Gets the index at which the first occurrence of value is found */
98
+ indexOf<T>(array: T[], value: T, fromIndex?: number): number;
99
+
100
+ /** Gets all but the last element of array */
101
+ initial<T>(array: T[]): T[];
102
+
103
+ /** Creates an array of unique values that are included in all given arrays */
104
+ intersection<T>(...arrays: T[][]): T[];
105
+
106
+ /** Converts all elements in array into a string separated by separator */
107
+ join<T>(array: T[], separator?: string): string;
108
+
109
+ /** Gets the last element of array */
110
+ last<T>(array: T[]): T | undefined;
111
+
112
+ /** Gets the index at which the last occurrence of value is found */
113
+ lastIndexOf<T>(array: T[], value: T, fromIndex?: number): number;
114
+
115
+ /** Gets the element at index n of array (supports negative indices) */
116
+ nth<T>(array: T[], n?: number): T | undefined;
117
+
118
+ /** Removes all given values from array (mutates) */
119
+ pull<T>(array: T[], ...values: T[]): T[];
120
+
121
+ /** Removes elements from array corresponding to indexes (mutates) */
122
+ pullAt<T>(array: T[], ...indexes: (number | number[])[]): T[];
123
+
124
+ /** Reverses array (mutates) */
125
+ reverse<T>(array: T[]): T[];
126
+
127
+ /** Creates a slice of array from start up to end */
128
+ slice<T>(array: T[], start?: number, end?: number): T[];
129
+
130
+ /** Gets all but the first element of array */
131
+ tail<T>(array: T[]): T[];
132
+
133
+ /** Creates a slice of array with n elements taken from the beginning */
134
+ take<T>(array: T[], n?: number): T[];
135
+
136
+ /** Creates a slice of array with n elements taken from the end */
137
+ takeRight<T>(array: T[], n?: number): T[];
138
+
139
+ /** Creates an array of unique values, in order, from all given arrays */
140
+ union<T>(...arrays: T[][]): T[];
141
+
142
+ /** Creates a duplicate-free version of an array */
143
+ uniq<T>(array: T[]): T[];
144
+
145
+ /** Creates a duplicate-free version using iteratee */
146
+ uniqBy<T>(array: T[], iteratee: (value: T) => any): T[];
147
+
148
+ /** Creates an array excluding all given values */
149
+ without<T>(array: T[], ...values: T[]): T[];
150
+
151
+ /** Creates an array of unique values that is the symmetric difference */
152
+ xor<T>(...arrays: T[][]): T[];
153
+
154
+ /** Creates an array of grouped elements */
155
+ zip<T>(...arrays: T[][]): T[][];
156
+
157
+ /** Creates an object composed from arrays of keys and values */
158
+ zipObject<T>(keys: string[], values?: T[]): Record<string, T>;
159
+
160
+ /** Invokes the iteratee n times, returning an array of the results */
161
+ times<T>(n: number, iteratee?: (index: number) => T): T[];
162
+
163
+ /** Creates an array of numbers from start up to, but not including, end */
164
+ range(end: number): number[];
165
+
166
+ range(start: number, end: number, step?: number): number[];
167
+
168
+ /** Generates a unique ID. If prefix is given, the ID is appended to it */
169
+ uniqueId(prefix?: string): string;
170
+
171
+ // ============================================
172
+ // Collection Utilities
173
+ // ============================================
174
+
175
+ /** Creates an object composed of keys generated from running each element through iteratee */
176
+ countBy<T>(collection: Collection<T>, iteratee: (value: T) => string | number): Record<string, number>;
177
+
178
+ /** Iterates over elements invoking iteratee for each element */
179
+ each<T>(collection: Collection<T>, iteratee: Iteratee<T, void>): Collection<T>;
180
+
181
+ /** Alias for each */
182
+ forEach<T>(collection: Collection<T>, iteratee: Iteratee<T, void>): Collection<T>;
183
+
184
+ /** Iterates over elements in reverse invoking iteratee for each element */
185
+ eachRight<T>(collection: Collection<T>, iteratee: Iteratee<T, void>): Collection<T>;
186
+
187
+ /** Alias for eachRight */
188
+ forEachRight<T>(collection: Collection<T>, iteratee: Iteratee<T, void>): Collection<T>;
189
+
190
+ /** Checks if predicate returns truthy for all elements of collection */
191
+ every<T>(collection: Collection<T>, predicate: Predicate<T>): boolean;
192
+
193
+ /** Returns an array of all elements predicate returns truthy for */
194
+ filter<T>(collection: Collection<T>, predicate: Predicate<T>): T[];
195
+
196
+ /** Returns the first element predicate returns truthy for */
197
+ find<T>(collection: Collection<T>, predicate: Predicate<T>): T | undefined;
198
+
199
+ /** Returns the last element predicate returns truthy for */
200
+ findLast<T>(collection: Collection<T>, predicate: Predicate<T>): T | undefined;
201
+
202
+ /** Creates a flattened array of values by running each element through iteratee */
203
+ flatMap<T, R>(collection: Collection<T>, iteratee: Iteratee<T, R | R[]>): R[];
204
+
205
+ /** Recursively flattens the mapped results */
206
+ flatMapDeep<T, R>(collection: Collection<T>, iteratee: Iteratee<T, any>): R[];
207
+
208
+ /** Creates an object composed of keys generated from running each element through iteratee */
209
+ groupBy<T>(collection: Collection<T>, iteratee: PropertyIteratee<T>): Record<string, T[]>;
210
+
211
+ /** Checks if value is in collection */
212
+ includes<T>(collection: Collection<T> | string, value: T | string, fromIndex?: number): boolean;
213
+
214
+ /** Creates an object with keys generated from running each element through iteratee */
215
+ keyBy<T>(collection: Collection<T>, iteratee: PropertyIteratee<T>): Record<string, T>;
216
+
217
+ /** Creates an array of values by running each element through iteratee */
218
+ map<T, R>(collection: Collection<T>, iteratee: Iteratee<T, R>): R[];
219
+
220
+ /** Creates an array of elements sorted by the specified iteratees */
221
+ orderBy<T>(collection: Collection<T>, iteratees: PropertyIteratee<T> | PropertyIteratee<T>[], orders?: ('asc' | 'desc') | ('asc' | 'desc')[]): T[];
222
+
223
+ /** Creates an array of elements split into two groups */
224
+ partition<T>(collection: Collection<T>, predicate: Predicate<T>): [T[], T[]];
225
+
226
+ /** Reduces collection to a value */
227
+ reduce<T, R>(collection: Collection<T>, iteratee: (accumulator: R, value: T, index: number | string, collection: Collection<T>) => R, accumulator?: R): R;
228
+
229
+ /** Reduces collection from right to left */
230
+ reduceRight<T, R>(collection: Collection<T>, iteratee: (accumulator: R, value: T, index: number | string, collection: Collection<T>) => R, accumulator?: R): R;
231
+
232
+ /** Returns elements predicate does not return truthy for */
233
+ reject<T>(collection: Collection<T>, predicate: Predicate<T>): T[];
234
+
235
+ /** Gets a random element from collection */
236
+ sample<T>(collection: Collection<T>): T | undefined;
237
+
238
+ /** Gets n random elements from collection */
239
+ sampleSize<T>(collection: Collection<T>, n?: number): T[];
240
+
241
+ /** Creates a shuffled array using Fisher-Yates shuffle */
242
+ shuffle<T>(collection: Collection<T>): T[];
243
+
244
+ /** Gets the size of collection */
245
+ size(collection: Collection<any> | string | null | undefined): number;
246
+
247
+ /** Checks if predicate returns truthy for any element of collection */
248
+ some<T>(collection: Collection<T>, predicate: Predicate<T>): boolean;
249
+
250
+ /** Creates an array of elements sorted by iteratee */
251
+ sortBy<T>(collection: Collection<T>, iteratee: PropertyIteratee<T>): T[];
252
+
253
+ // ============================================
254
+ // Function Utilities
255
+ // ============================================
256
+
257
+ /** Creates a function that invokes func once it's called n or more times */
258
+ after<T extends (...args: any[]) => any>(n: number, func: T): T;
259
+
260
+ /** Creates a function that invokes func, with up to n arguments */
261
+ ary<T extends (...args: any[]) => any>(func: T, n?: number): T;
262
+
263
+ /** Creates a function that invokes func while it's called less than n times */
264
+ before<T extends (...args: any[]) => any>(n: number, func: T): T;
265
+
266
+ /** Creates a function that invokes func with the this binding of thisArg */
267
+ bind<T extends (...args: any[]) => any>(func: T, thisArg: any, ...partials: any[]): T;
268
+
269
+ /** Creates a function that accepts arguments and returns a curried function */
270
+ curry<T extends (...args: any[]) => any>(func: T, arity?: number): (...args: any[]) => any;
271
+
272
+ /** Like curry but arguments are processed right to left */
273
+ curryRight<T extends (...args: any[]) => any>(func: T, arity?: number): (...args: any[]) => any;
274
+
275
+ /** Creates a debounced function that delays invoking func until after wait ms */
276
+ debounce<T extends (...args: any[]) => any>(func: T, wait?: number, options?: DebounceOptions): DebouncedFunction<T>;
277
+
278
+ /** Defers invoking the func until the current call stack has cleared */
279
+ defer<T extends (...args: any[]) => any>(func: T, ...args: Parameters<T>): number;
280
+
281
+ /** Invokes func after wait milliseconds */
282
+ delay<T extends (...args: any[]) => any>(func: T, wait: number, ...args: Parameters<T>): number;
283
+
284
+ /** Creates a function that invokes func with arguments reversed */
285
+ flip<T extends (...args: any[]) => any>(func: T): T;
286
+
287
+ /** Creates a function that memoizes the result of func */
288
+ memoize<T extends (...args: any[]) => any>(func: T, resolver?: (...args: Parameters<T>) => any): MemoizedFunction<T>;
289
+
290
+ /** Creates a function that negates the result of the predicate func */
291
+ negate<T extends (...args: any[]) => boolean>(predicate: T): T;
292
+
293
+ /** Creates a function that is restricted to invoking func once */
294
+ once<T extends (...args: any[]) => any>(func: T): T;
295
+
296
+ /** Creates a function that invokes func with partials prepended */
297
+ partial<T extends (...args: any[]) => any>(func: T, ...partials: any[]): (...args: any[]) => ReturnType<T>;
298
+
299
+ /** Creates a function that invokes func with partials appended */
300
+ partialRight<T extends (...args: any[]) => any>(func: T, ...partials: any[]): (...args: any[]) => ReturnType<T>;
301
+
302
+ /** Creates a throttled function that only invokes func at most once per every wait ms */
303
+ throttle<T extends (...args: any[]) => any>(func: T, wait?: number, options?: ThrottleOptions): DebouncedFunction<T>;
304
+
305
+ /** Creates a function that accepts up to one argument */
306
+ unary<T extends (...args: any[]) => any>(func: T): (arg: Parameters<T>[0]) => ReturnType<T>;
307
+
308
+ /** Creates a function that provides value to wrapper as its first argument */
309
+ wrap<T, R>(value: T, wrapper: (value: T, ...args: any[]) => R): (...args: any[]) => R;
310
+
311
+ // ============================================
312
+ // Object Utilities
313
+ // ============================================
314
+
315
+ /** Assigns own enumerable properties of source objects to the destination object */
316
+ assign<T extends object>(object: T, ...sources: object[]): T;
317
+
318
+ /** Like assign but iterates over own and inherited source properties */
319
+ assignIn<T extends object>(object: T, ...sources: object[]): T;
320
+
321
+ /** Alias for assignIn */
322
+ extend<T extends object>(object: T, ...sources: object[]): T;
323
+
324
+ /** Creates an array of values corresponding to paths of object */
325
+ at<T extends object>(object: T, ...paths: (string | string[])[]): any[];
326
+
327
+ /** Creates a shallow clone of value */
328
+ clone<T>(value: T): T;
329
+
330
+ /** Creates a deep clone of value */
331
+ cloneDeep<T>(value: T): T;
332
+
333
+ /** Assigns properties of source objects for destination properties that resolve to undefined */
334
+ defaults<T extends object>(object: T, ...sources: object[]): T;
335
+
336
+ /** Like defaults but recursively assigns default properties */
337
+ defaultsDeep<T extends object>(object: T, ...sources: object[]): T;
338
+
339
+ /** Creates an array of own enumerable string keyed-value pairs */
340
+ entries<T extends object>(object: T): [string, T[keyof T]][];
341
+
342
+ /** Alias for entries */
343
+ toPairs<T extends object>(object: T): [string, T[keyof T]][];
344
+
345
+ /** Returns the key of the first element predicate returns truthy for */
346
+ findKey<T extends object>(object: T, predicate: (value: T[keyof T], key: string, object: T) => boolean): string | undefined;
347
+
348
+ /** Returns the key of the last element predicate returns truthy for */
349
+ findLastKey<T extends object>(object: T, predicate: (value: T[keyof T], key: string, object: T) => boolean): string | undefined;
350
+
351
+ /** Iterates over own and inherited enumerable properties of an object */
352
+ forIn<T extends object>(object: T, iteratee: (value: T[keyof T], key: string, object: T) => void | false): T;
353
+
354
+ /** Iterates over own enumerable properties of an object */
355
+ forOwn<T extends object>(object: T, iteratee: (value: T[keyof T], key: string, object: T) => void | false): T;
356
+
357
+ /** Gets the value at path of object */
358
+ get<T>(object: any, path: string | string[], defaultValue?: T): T;
359
+
360
+ /** Checks if path is a direct property of object */
361
+ has(object: any, path: string | string[]): boolean;
362
+
363
+ /** Creates an object composed of the inverted keys and values of object */
364
+ invert<T extends object>(object: T): Record<string, string>;
365
+
366
+ /** Like invert but accepts iteratee which is invoked for each element */
367
+ invertBy<T extends object>(object: T, iteratee?: (value: T[keyof T]) => string): Record<string, string[]>;
368
+
369
+ /** Creates an array of the own enumerable property names of object */
370
+ keys<T extends object>(object: T): string[];
371
+
372
+ /** Creates an array of own and inherited enumerable property names */
373
+ keysIn<T extends object>(object: T): string[];
374
+
375
+ /** Creates an object with the same values and keys generated by iteratee */
376
+ mapKeys<T extends object>(object: T, iteratee: (value: T[keyof T], key: string, object: T) => string): Record<string, T[keyof T]>;
377
+
378
+ /** Creates an object with the same keys and values generated by iteratee */
379
+ mapValues<T extends object, R>(object: T, iteratee: (value: T[keyof T], key: string, object: T) => R): Record<string, R>;
380
+
381
+ /** Recursively merges own and inherited enumerable properties of source objects */
382
+ merge<T extends object>(object: T, ...sources: object[]): T;
383
+
384
+ /** Creates an object composed of the own properties that are not omitted */
385
+ omit<T extends object, K extends keyof T>(object: T, ...paths: (K | K[])[]): Omit<T, K>;
386
+
387
+ /** Creates an object composed of the properties predicate doesn't return truthy for */
388
+ omitBy<T extends object>(object: T, predicate: (value: T[keyof T], key: string) => boolean): Partial<T>;
389
+
390
+ /** Creates an object composed of the picked object properties */
391
+ pick<T extends object, K extends keyof T>(object: T, ...paths: (K | K[])[]): Pick<T, K>;
392
+
393
+ /** Creates an object composed of the properties predicate returns truthy for */
394
+ pickBy<T extends object>(object: T, predicate: (value: T[keyof T], key: string) => boolean): Partial<T>;
395
+
396
+ /** Sets the value at path of object */
397
+ set<T extends object>(object: T, path: string | string[], value: any): T;
398
+
399
+ /** Removes the property at path of object */
400
+ unset(object: any, path: string | string[]): boolean;
401
+
402
+ /** Sets the value at path of object if the resolved value is undefined */
403
+ setIfUndefined<T extends object>(object: T, path: string | string[], value: any): T;
404
+
405
+ /** Creates an array of own enumerable string keyed property values of object */
406
+ values<T extends object>(object: T): T[keyof T][];
407
+
408
+ /** Creates an array of own and inherited enumerable property values */
409
+ valuesIn<T extends object>(object: T): any[];
410
+
411
+ // ============================================
412
+ // Lang Utilities (Type Checking)
413
+ // ============================================
414
+
415
+ /** Checks if value is an Array */
416
+ isArray(value: any): value is any[];
417
+
418
+ /** Checks if value is a boolean primitive or object */
419
+ isBoolean(value: any): value is boolean;
420
+
421
+ /** Checks if value is a Date object */
422
+ isDate(value: any): value is Date;
423
+
424
+ /** Checks if value is an empty object, collection, map, or set */
425
+ isEmpty(value: any): boolean;
426
+
427
+ /** Performs a deep comparison between two values */
428
+ isEqual(value: any, other: any): boolean;
429
+
430
+ /** Checks if object contains equivalent property values */
431
+ isMatch(object: any, source: any): boolean;
432
+
433
+ /** Checks if value is a finite number */
434
+ isFinite(value: any): value is number;
435
+
436
+ /** Checks if value is a Function object */
437
+ isFunction(value: any): value is (...args: any[]) => any;
438
+
439
+ /** Checks if value is an integer */
440
+ isInteger(value: any): value is number;
441
+
442
+ /** Checks if value is NaN */
443
+ isNaN(value: any): boolean;
444
+
445
+ /** Checks if value is null or undefined */
446
+ isNil(value: any): value is null | undefined;
447
+
448
+ /** Checks if value is null */
449
+ isNull(value: any): value is null;
450
+
451
+ /** Checks if value is a number primitive or object */
452
+ isNumber(value: any): value is number;
453
+
454
+ /** Checks if value is the language type of Object */
455
+ isObject(value: any): value is object;
456
+
457
+ /** Checks if value is a plain object */
458
+ isPlainObject(value: any): value is Record<string, any>;
459
+
460
+ /** Checks if value is a RegExp object */
461
+ isRegExp(value: any): value is RegExp;
462
+
463
+ /** Checks if value is a string primitive or object */
464
+ isString(value: any): value is string;
465
+
466
+ /** Checks if value is a Symbol primitive */
467
+ isSymbol(value: any): value is symbol;
468
+
469
+ /** Checks if value is undefined */
470
+ isUndefined(value: any): value is undefined;
471
+
472
+ // ============================================
473
+ // Type Conversion Utilities
474
+ // ============================================
475
+
476
+ /** Converts string to an integer of the specified radix */
477
+ parseInt(string: string | number, radix?: number): number;
478
+
479
+ /** Converts value to a number */
480
+ toNumber(value: any): number;
481
+
482
+ /** Converts value to an integer */
483
+ toInteger(value: any): number;
484
+
485
+ /** Converts value to a finite number */
486
+ toFinite(value: any): number;
487
+
488
+ /** Converts value to a safe integer */
489
+ toSafeInteger(value: any): number;
490
+
491
+ /** Converts value to a string */
492
+ toString(value: any): string;
493
+
494
+ /** Converts value to an array */
495
+ toArray<T>(value: T[] | Iterable<T> | Record<string, T> | string): T[] | string[];
496
+
497
+ /** Casts value as an array if it's not one */
498
+ castArray<T>(...args: T[]): T[];
499
+
500
+ /** Converts value to an integer suitable for use as array length */
501
+ toLength(value: any): number;
502
+
503
+ /** Converts value to a plain object flattening inherited properties */
504
+ toPlainObject(value: any): Record<string, any>;
505
+
506
+ // ============================================
507
+ // Math Utilities
508
+ // ============================================
509
+
510
+ /** Adds two numbers */
511
+ add(augend: number, addend: number): number;
512
+
513
+ /** Computes number rounded up to precision */
514
+ ceil(number: number, precision?: number): number;
515
+
516
+ /** Divide two numbers */
517
+ divide(dividend: number, divisor: number): number;
518
+
519
+ /** Computes number rounded down to precision */
520
+ floor(number: number, precision?: number): number;
521
+
522
+ /** Computes the maximum value of array */
523
+ max(array: number[]): number | undefined;
524
+
525
+ /** Computes the maximum value of array with iteratee */
526
+ maxBy<T>(array: T[], iteratee: PropertyIteratee<T>): T | undefined;
527
+
528
+ /** Computes the mean of the values in array */
529
+ mean(array: number[]): number;
530
+
531
+ /** Computes the mean using iteratee */
532
+ meanBy<T>(array: T[], iteratee: PropertyIteratee<T>): number;
533
+
534
+ /** Computes the minimum value of array */
535
+ min(array: number[]): number | undefined;
536
+
537
+ /** Computes the minimum value of array with iteratee */
538
+ minBy<T>(array: T[], iteratee: PropertyIteratee<T>): T | undefined;
539
+
540
+ /** Multiply two numbers */
541
+ multiply(multiplier: number, multiplicand: number): number;
542
+
543
+ /** Computes number rounded to precision */
544
+ round(number: number, precision?: number): number;
545
+
546
+ /** Subtract two numbers */
547
+ subtract(minuend: number, subtrahend: number): number;
548
+
549
+ /** Computes the sum of the values in array */
550
+ sum(array: number[]): number;
551
+
552
+ /** Computes the sum using iteratee */
553
+ sumBy<T>(array: T[], iteratee: PropertyIteratee<T>): number;
554
+
555
+ // ============================================
556
+ // Number Utilities
557
+ // ============================================
558
+
559
+ /** Clamps number within the inclusive lower and upper bounds */
560
+ clamp(number: number, upper: number): number;
561
+
562
+ clamp(number: number, lower: number, upper: number): number;
563
+
564
+ /** Checks if n is between start and up to but not including end */
565
+ inRange(number: number, end: number): boolean;
566
+
567
+ inRange(number: number, start: number, end: number): boolean;
568
+
569
+ /** Produces a random number between the inclusive lower and upper bounds */
570
+ random(floating?: boolean): number;
571
+
572
+ random(upper: number, floating?: boolean): number;
573
+
574
+ random(lower: number, upper: number, floating?: boolean): number;
575
+
576
+ // ============================================
577
+ // String Utilities
578
+ // ============================================
579
+
580
+ /** Converts string to camel case */
581
+ camelCase(string: string): string;
582
+
583
+ /** Converts the first character to upper case and remaining to lower case */
584
+ capitalize(string: string): string;
585
+
586
+ /** Checks if string ends with the given target string */
587
+ endsWith(string: string, target: string, position?: number): boolean;
588
+
589
+ /** Converts HTML special characters to HTML entities */
590
+ escape(string: string): string;
591
+
592
+ /** Converts string to kebab case */
593
+ kebabCase(string: string): string;
594
+
595
+ /** Converts string, as space separated words, to lower case */
596
+ lowerCase(string: string): string;
597
+
598
+ /** Converts the first character of string to lower case */
599
+ lowerFirst(string: string): string;
600
+
601
+ /** Pads string on the left and right sides if it's shorter than length */
602
+ pad(string?: string, length?: number, chars?: string): string;
603
+
604
+ /** Pads string on the right side if it's shorter than length */
605
+ padEnd(string?: string, length?: number, chars?: string): string;
606
+
607
+ /** Pads string on the left side if it's shorter than length */
608
+ padStart(string?: string, length?: number, chars?: string): string;
609
+
610
+ /** Repeats the given string n times */
611
+ repeat(string?: string, n?: number): string;
612
+
613
+ /** Replaces matches for pattern in string with replacement */
614
+ replace(string?: string, pattern?: string | RegExp, replacement?: string): string;
615
+
616
+ /** Converts string to snake case */
617
+ snakeCase(string: string): string;
618
+
619
+ /** Splits string by separator */
620
+ split(string?: string, separator?: string | RegExp, limit?: number): string[];
621
+
622
+ /** Converts string to start case */
623
+ startCase(string: string): string;
624
+
625
+ /** Checks if string starts with the given target string */
626
+ startsWith(string: string, target: string, position?: number): boolean;
627
+
628
+ /** Converts string to lowercase */
629
+ toLower(string: string): string;
630
+
631
+ /** Converts string to uppercase */
632
+ toUpper(string: string): string;
633
+
634
+ /** Removes leading and trailing whitespace or specified characters */
635
+ trim(string?: string, chars?: string): string;
636
+
637
+ /** Removes trailing whitespace or specified characters */
638
+ trimEnd(string?: string, chars?: string): string;
639
+
640
+ /** Removes leading whitespace or specified characters */
641
+ trimStart(string?: string, chars?: string): string;
642
+
643
+ /** Truncates string if it's longer than the given maximum string length */
644
+ truncate(string?: string, options?: TruncateOptions): string;
645
+
646
+ /** Converts HTML entities to their corresponding characters */
647
+ unescape(string: string): string;
648
+
649
+ /** Converts string, as space separated words, to upper case */
650
+ upperCase(string: string): string;
651
+
652
+ /** Converts the first character of string to upper case */
653
+ upperFirst(string: string): string;
654
+
655
+ /** Splits string into an array of its words */
656
+ words(string?: string, pattern?: string | RegExp): string[];
657
+
658
+ /** Returns a formatted string using printf-style format specifiers */
659
+ sprintf(format: string, ...args: any[]): string;
660
+
661
+ /** Alias for sprintf */
662
+ format(format: string, ...args: any[]): string;
663
+
664
+ // ============================================
665
+ // Template Engine
666
+ // ============================================
667
+
668
+ /** Compiles a template string into a reusable function */
669
+ template(template: string, options?: TemplateOptions): (data?: Record<string, any>) => string;
670
+
671
+ /** Renders a template string with the given data (one-shot) */
672
+ render(template: string, data: Record<string, any>, options?: TemplateOptions): string;
673
+ }
674
+
675
+ export declare const utils: Utils;