cafe-utility 30.0.0 → 31.0.0

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 (3) hide show
  1. package/index.d.ts +1067 -994
  2. package/index.js +1858 -2693
  3. package/package.json +16 -16
package/index.d.ts CHANGED
@@ -1,1072 +1,1145 @@
1
- type Indexable = number | string;
2
- type CafeObject<T = unknown> = Record<string, T>;
3
- declare function invertPromise<T>(promise: Promise<T>): Promise<unknown>;
4
- declare function raceFulfilled<T>(promises: Promise<T>[]): Promise<unknown>;
5
- declare function runInParallelBatches<T>(promises: (() => Promise<T>)[], concurrency?: number): Promise<T[]>;
6
- declare function sleepMillis(millis: number): Promise<unknown>;
7
- declare function shuffle<T>(array: T[], generator?: () => number): T[];
8
- declare function onlyOrThrow<T>(array: T[]): T;
9
- declare function onlyOrNull<T>(array: T[]): T | null;
10
- declare function firstOrNull<T>(array: T[]): T | null;
11
- declare function firstOrThrow<T>(array: T[]): T;
12
- declare function initializeArray<T>(count: number, initializer: (index: number) => T): T[];
13
- declare function rotate2DArray<T>(array: T[][]): T[][];
14
- declare function initialize2DArray<T>(width: number, height: number, initialValue: T): T[][];
15
- declare function containsShape<T>(array2D: T[][], shape: T[][], x: number, y: number): boolean;
16
- declare function pickRandomIndices<T>(array: T[], count: number, generator?: () => number): number[];
17
- declare function pluck<T, K extends keyof T>(array: T[], key: K): T[K][];
18
- declare function makeSeededRng(seed: number): () => number;
19
- declare function intBetween(min: number, max: number, generator?: () => number): number;
20
- declare function floatBetween(min: number, max: number, generator?: () => number): number;
21
- declare function signedRandom(): number;
1
+ type Indexable = number | string
2
+ type CafeObject<T = unknown> = Record<string, T>
3
+ declare function invertPromise<T>(promise: Promise<T>): Promise<unknown>
4
+ declare function raceFulfilled<T>(promises: Promise<T>[]): Promise<unknown>
5
+ declare function runInParallelBatches<T>(promises: (() => Promise<T>)[], concurrency?: number): Promise<T[]>
6
+ declare function sleepMillis(millis: number): Promise<unknown>
7
+ declare function shuffle<T>(array: T[], generator?: () => number): T[]
8
+ declare function onlyOrThrow<T>(array: T[]): T
9
+ declare function onlyOrNull<T>(array: T[]): T | null
10
+ declare function firstOrNull<T>(array: T[]): T | null
11
+ declare function firstOrThrow<T>(array: T[]): T
12
+ declare function initializeArray<T>(count: number, initializer: (index: number) => T): T[]
13
+ declare function rotate2DArray<T>(array: T[][]): T[][]
14
+ declare function initialize2DArray<T>(width: number, height: number, initialValue: T): T[][]
15
+ declare function containsShape<T>(array2D: T[][], shape: T[][], x: number, y: number): boolean
16
+ declare function pickRandomIndices<T>(array: T[], count: number, generator?: () => number): number[]
17
+ declare function pluck<T, K extends keyof T>(array: T[], key: K): T[K][]
18
+ declare function makeSeededRng(seed: number): () => number
19
+ declare function intBetween(min: number, max: number, generator?: () => number): number
20
+ declare function floatBetween(min: number, max: number, generator?: () => number): number
21
+ declare function signedRandom(): number
22
22
  interface Rectangle {
23
- x: number;
24
- y: number;
25
- width: number;
26
- height: number;
23
+ x: number
24
+ y: number
25
+ width: number
26
+ height: number
27
27
  }
28
- declare function randomPoint(width: number, height: number, exclude?: Rectangle, generator?: () => number): [number, number];
29
- declare function procs(probabilty: number, generator?: () => number): number;
30
- declare function chance(threshold: number, generator?: () => number): boolean;
31
- declare function pick<T>(array: T[], generator?: () => number): T;
32
- declare function pickMany<T>(array: T[], count: number, generator?: () => number): T[];
33
- declare function pickManyUnique<T>(array: T[], count: number, equalityFunction: (a: T, b: T) => boolean, generator?: () => number): T[];
34
- declare function pickGuaranteed<T>(array: T[], include: T | null, exclude: T | null, count: number, predicate: (value: T, values: T[]) => boolean, generator?: () => number): {
35
- values: T[];
36
- indexOfGuaranteed: number;
37
- };
38
- declare function last<T>(array: T[]): T;
39
- declare function pipe<T>(value: any, functions: ((value: any) => any)[], assertionFn: (value: any) => T): T;
40
- declare function makePipe<T>(functions: ((value: any) => any)[], assertionFn: (value: any) => T): (value: any) => T;
41
- declare function pickWeighted<T>(array: T[], weights: number[], randomNumber?: number): T;
42
- declare function sortWeighted<T>(array: T[], weights: number[], generator?: () => number): T[];
43
- declare function getDeep(some: any, path: string): unknown;
44
- declare function setDeep<T>(object: CafeObject, path: string, value: T): T;
45
- declare function incrementDeep(object: CafeObject, path: string, amount?: number): number;
46
- declare function ensureDeep(object: CafeObject, path: string, value: unknown): unknown;
47
- declare function deleteDeep(object: CafeObject, path: string): void;
48
- declare function replaceDeep(object: CafeObject, path: string, value: unknown): unknown;
49
- declare function getFirstDeep(object: CafeObject, paths: string[], fallbackToAnyKey?: boolean): unknown;
50
- declare function forever(callable: (() => Promise<void>) | (() => void), millis: number, log?: (message: string, metadata: object) => void): Promise<never>;
51
- declare function runAndSetInterval(callable: () => void, millis: number): () => void;
52
- declare function whereAmI(): 'browser' | 'node';
53
- declare function asMegabytes(number: number): number;
54
- declare function convertBytes(bytes: number, divisor?: number): string;
55
- declare function hexToRgb(hex: string): [number, number, number];
56
- declare function rgbToHex(rgb: [number, number, number]): string;
57
- declare function haversineDistanceToMeters(lat1: number, lon1: number, lat2: number, lon2: number): number;
58
- declare function roundToNearest(value: number, nearest: number): number;
59
- declare function formatDistance(meters: number): string;
60
- declare function triangularNumber(n: number): number;
61
- declare function searchFloat(string: string): number;
62
- declare function isObject(value: any, checkForPlainObject?: boolean): value is object;
63
- declare function isStrictlyObject(value: any): value is object;
64
- declare function isEmptyArray(value: any): boolean;
65
- declare function isEmptyObject(value: any): boolean;
66
- declare function isUndefined(value: any): value is undefined;
67
- declare function isFunction(value: any): value is Function;
68
- declare function isString(value: any): value is string;
69
- declare function isNumber(value: any): value is number;
70
- declare function isBoolean(value: any): value is boolean;
71
- declare function isDate(value: any): value is Date;
72
- declare function isBlank(value: any): boolean;
73
- declare function isId(value: any): value is number;
74
- declare function isIntegerString(value: any): boolean;
75
- declare function isHexString(value: any): boolean;
76
- declare function randomLetterString(length: number, generator?: () => number): string;
77
- declare function randomAlphanumericString(length: number, generator?: () => number): string;
78
- declare function randomRichAsciiString(length: number, generator?: () => number): string;
79
- declare function randomUnicodeString(length: number, generator?: () => number): string;
80
- declare function searchHex(string: string, length: number): string | null;
81
- declare function searchSubstring(string: string, predicate: (string: string) => boolean, separators?: string[]): string | null;
82
- declare function randomHexString(length: number, generator?: () => number): string;
83
- declare function asIntegerString(value: any, options?: {
84
- name?: string;
85
- min?: bigint;
86
- max?: bigint;
87
- }): string;
88
- declare function asString(string: any, options?: {
89
- name?: string;
90
- min?: number;
91
- max?: number;
92
- }): string;
93
- declare function asHexString(string: any, options?: {
94
- name?: string;
95
- byteLength?: number;
96
- }): string;
97
- declare function asSafeString(string: any, options?: {
98
- name?: string;
99
- min?: number;
100
- max?: number;
101
- }): string;
102
- declare function asFunction(value: any, options?: {
103
- name: string;
104
- }): Function;
105
- declare function asNumber(number: any, options?: {
106
- name?: string;
107
- min?: number;
108
- max?: number;
109
- }): number;
110
- declare function asInteger(number: any, options?: {
111
- name?: string;
112
- min?: number;
113
- max?: number;
114
- }): number;
115
- declare function asBoolean(bool: any, options?: {
116
- name: string;
117
- }): boolean;
118
- declare function asDate(date: any, options?: {
119
- name: string;
120
- }): Date;
121
- declare function asNullableString(string: any): string | null;
122
- declare function asEmptiableString(string: any, options?: {
123
- name: string;
124
- }): string;
125
- declare function asId(value: any, options?: {
126
- name: string;
127
- }): number;
128
- declare function asTime(value: any, options?: {
129
- name: string;
130
- }): string;
131
- declare function asArray(value: any, options?: {
132
- name: string;
133
- }): unknown[];
134
- declare function asObject(value: any, options?: {
135
- name: string;
136
- }): Record<string, unknown>;
137
- declare function asNullableObject(value: any, options?: {
138
- name: string;
139
- }): Record<string, unknown> | null;
140
- declare function asStringMap(value: any, options?: {
141
- name: string;
142
- }): Record<string, string>;
143
- declare function asNumericDictionary(value: any, options?: {
144
- name: string;
145
- }): Record<string, number>;
146
- declare function isUrl(value: any): boolean;
147
- declare function asUrl(value: any, options?: {
148
- name: string;
149
- }): string;
150
- declare function isNullable(typeFn: (value: any) => boolean, value: any): boolean;
151
- declare function asNullable<T>(typeFn: (value: any) => T, value: any): T | null;
152
- declare function asOptional<T>(typeFn: (value: any) => T, value: any): T | undefined;
153
- declare function enforceObjectShape(value: Record<string, any>, shape: Record<string, (value: any) => boolean>): boolean;
154
- declare function enforceArrayShape(value: any[], shape: Record<string, (value: any) => boolean>): boolean;
155
- declare function represent(value: any, strategy?: 'json' | 'key-value', depth?: number): string;
156
- declare function expandError(error: any, stackTrace?: boolean): string;
157
- declare function deepMergeInPlace<X extends object, Y extends object>(target: X, source: Y): X & Y;
158
- declare function deepMerge2<X extends object, Y extends object>(target: X, source: Y): X & Y;
159
- declare function deepMerge3<X extends object, Y extends object, Z extends object>(target: X, sourceA: Y, sourceB: Z): X & Y & Z;
160
- declare function zip<T>(objects: CafeObject<T>[], reducer: (a: T, b: T) => T): CafeObject<T>;
161
- declare function zipSum(objects: CafeObject<number>[]): CafeObject<number>;
162
- declare function pushToBucket<T>(object: Record<string, T[]>, bucket: string, item: T): void;
163
- declare function unshiftAndLimit<T>(array: T[], item: T, limit: number): void;
164
- declare function atRolling<T>(array: T[], index: number): T;
165
- declare function pushAll<T>(array: T[], elements: T[]): void;
166
- declare function unshiftAll<T>(array: T[], elements: T[]): void;
167
- declare function mapAllAsync<T, K>(array: T[], fn: (value: T) => Promise<K>): Promise<K[]>;
168
- declare function glue<T, K>(array: T[], glueElement: K | (() => K)): (T | K)[];
169
- declare function asEqual<A>(a: A, b: A): [A, A];
170
- declare function asTrue(data: any): true;
171
- declare function asTruthy<T>(data: T): T;
172
- declare function asFalse(data: any): false;
173
- declare function asFalsy<T>(data: T): T;
174
- declare function asEither(data: string, values: string[]): string;
175
- declare function scheduleMany<T>(handlers: (() => T)[], dates: Date[]): void;
176
- declare function interpolate(a: number, b: number, t: number): number;
177
- declare function sum(array: number[]): number;
178
- declare function average(array: number[]): number;
179
- declare function median(array: number[]): number;
180
- declare function getDistanceFromMidpoint(position: number, length: number): number;
181
- declare function range(start: number, end: number): number[];
182
- declare function includesAny(string: string, substrings: string[]): boolean;
183
- declare function isChinese(string: string): boolean;
184
- declare function slugify(string: string, shouldAllowToken?: (character: string) => boolean): string;
185
- declare function normalForm(string: string): string;
186
- declare function camelToTitle(string: string): string;
187
- declare function slugToTitle(string: string): string;
188
- declare function slugToCamel(string: string): string;
189
- declare function joinHumanly(parts: string[], separator?: string, lastSeparator?: string): string;
190
- declare function surroundInOut(string: string, filler: string): string;
191
- declare function enumify(string: string): string;
192
- declare function getFuzzyMatchScore(string: string, input: string): number;
193
- declare function sortByFuzzyScore(strings: string[], input: string): string[];
194
- declare function escapeHtml(string: string): string;
195
- declare function decodeHtmlEntities(string: string): string;
196
- declare function before(string: string, searchString: string): string | null;
197
- declare function after(string: string, searchString: string): string | null;
198
- declare function beforeLast(string: string, searchString: string): string | null;
199
- declare function afterLast(string: string, searchString: string): string | null;
200
- declare function betweenWide(string: string, start: string, end: string): string | null;
201
- declare function betweenNarrow(string: string, start: string, end: string): string | null;
202
- declare function splitOnce(string: string, separator: string, last?: boolean): [string | null, string | null];
203
- declare function splitAll(string: string, separators: string[]): string[];
204
- declare function getExtension(path: string): string;
205
- declare function getBasename(path: string): string;
206
- declare function normalizeEmail(email: string): string;
207
- declare function normalizeFilename(path: string): string;
28
+ declare function randomPoint(width: number, height: number, exclude?: Rectangle, generator?: () => number): [number, number]
29
+ declare function procs(probabilty: number, generator?: () => number): number
30
+ declare function chance(threshold: number, generator?: () => number): boolean
31
+ declare function pick<T>(array: T[], generator?: () => number): T
32
+ declare function pickMany<T>(array: T[], count: number, generator?: () => number): T[]
33
+ declare function pickManyUnique<T>(array: T[], count: number, equalityFunction: (a: T, b: T) => boolean, generator?: () => number): T[]
34
+ declare function pickGuaranteed<T>(
35
+ array: T[],
36
+ include: T | null,
37
+ exclude: T | null,
38
+ count: number,
39
+ predicate: (value: T, values: T[]) => boolean,
40
+ generator?: () => number
41
+ ): {
42
+ values: T[]
43
+ indexOfGuaranteed: number
44
+ }
45
+ declare function last<T>(array: T[]): T
46
+ declare function pipe<T>(value: any, functions: ((value: any) => any)[], assertionFn: (value: any) => T): T
47
+ declare function makePipe<T>(functions: ((value: any) => any)[], assertionFn: (value: any) => T): (value: any) => T
48
+ declare function pickWeighted<T>(array: T[], weights: number[], randomNumber?: number): T
49
+ declare function sortWeighted<T>(array: T[], weights: number[], generator?: () => number): T[]
50
+ declare function getDeep(some: any, path: string): unknown
51
+ declare function setDeep<T>(object: CafeObject, path: string, value: T): T
52
+ declare function incrementDeep(object: CafeObject, path: string, amount?: number): number
53
+ declare function ensureDeep(object: CafeObject, path: string, value: unknown): unknown
54
+ declare function deleteDeep(object: CafeObject, path: string): void
55
+ declare function replaceDeep(object: CafeObject, path: string, value: unknown): unknown
56
+ declare function getFirstDeep(object: CafeObject, paths: string[], fallbackToAnyKey?: boolean): unknown
57
+ declare function forever(callable: (() => Promise<void>) | (() => void), millis: number, log?: (message: string, metadata: object) => void): Promise<never>
58
+ declare function runAndSetInterval(callable: () => void, millis: number): () => void
59
+ declare function whereAmI(): 'browser' | 'node'
60
+ declare function asMegabytes(number: number): number
61
+ declare function convertBytes(bytes: number, divisor?: number): string
62
+ declare function hexToRgb(hex: string): [number, number, number]
63
+ declare function rgbToHex(rgb: [number, number, number]): string
64
+ declare function haversineDistanceToMeters(lat1: number, lon1: number, lat2: number, lon2: number): number
65
+ declare function roundToNearest(value: number, nearest: number): number
66
+ declare function formatDistance(meters: number): string
67
+ declare function triangularNumber(n: number): number
68
+ declare function searchFloat(string: string): number
69
+ declare function isObject(value: any, checkForPlainObject?: boolean): value is object
70
+ declare function isStrictlyObject(value: any): value is object
71
+ declare function isEmptyArray(value: any): boolean
72
+ declare function isEmptyObject(value: any): boolean
73
+ declare function isUndefined(value: any): value is undefined
74
+ declare function isFunction(value: any): value is Function
75
+ declare function isString(value: any): value is string
76
+ declare function isNumber(value: any): value is number
77
+ declare function isBoolean(value: any): value is boolean
78
+ declare function isDate(value: any): value is Date
79
+ declare function isBlank(value: any): boolean
80
+ declare function isId(value: any): value is number
81
+ declare function isIntegerString(value: any): boolean
82
+ declare function isHexString(value: any): boolean
83
+ declare function randomLetterString(length: number, generator?: () => number): string
84
+ declare function randomAlphanumericString(length: number, generator?: () => number): string
85
+ declare function randomRichAsciiString(length: number, generator?: () => number): string
86
+ declare function randomUnicodeString(length: number, generator?: () => number): string
87
+ declare function searchHex(string: string, length: number): string | null
88
+ declare function searchSubstring(string: string, predicate: (string: string) => boolean, separators?: string[]): string | null
89
+ declare function randomHexString(length: number, generator?: () => number): string
90
+ declare function asIntegerString(
91
+ value: any,
92
+ options?: {
93
+ name?: string
94
+ min?: bigint
95
+ max?: bigint
96
+ }
97
+ ): string
98
+ declare function asString(
99
+ string: any,
100
+ options?: {
101
+ name?: string
102
+ min?: number
103
+ max?: number
104
+ }
105
+ ): string
106
+ declare function asHexString(
107
+ string: any,
108
+ options?: {
109
+ name?: string
110
+ byteLength?: number
111
+ }
112
+ ): string
113
+ declare function asSafeString(
114
+ string: any,
115
+ options?: {
116
+ name?: string
117
+ min?: number
118
+ max?: number
119
+ }
120
+ ): string
121
+ declare function asFunction(
122
+ value: any,
123
+ options?: {
124
+ name: string
125
+ }
126
+ ): Function
127
+ declare function asNumber(
128
+ number: any,
129
+ options?: {
130
+ name?: string
131
+ min?: number
132
+ max?: number
133
+ }
134
+ ): number
135
+ declare function asInteger(
136
+ number: any,
137
+ options?: {
138
+ name?: string
139
+ min?: number
140
+ max?: number
141
+ }
142
+ ): number
143
+ declare function asBoolean(
144
+ bool: any,
145
+ options?: {
146
+ name: string
147
+ }
148
+ ): boolean
149
+ declare function asDate(
150
+ date: any,
151
+ options?: {
152
+ name: string
153
+ }
154
+ ): Date
155
+ declare function asNullableString(string: any): string | null
156
+ declare function asEmptiableString(
157
+ string: any,
158
+ options?: {
159
+ name: string
160
+ }
161
+ ): string
162
+ declare function asId(
163
+ value: any,
164
+ options?: {
165
+ name: string
166
+ }
167
+ ): number
168
+ declare function asTime(
169
+ value: any,
170
+ options?: {
171
+ name: string
172
+ }
173
+ ): string
174
+ declare function asArray(
175
+ value: any,
176
+ options?: {
177
+ name: string
178
+ }
179
+ ): unknown[]
180
+ declare function asObject(
181
+ value: any,
182
+ options?: {
183
+ name: string
184
+ }
185
+ ): Record<string, unknown>
186
+ declare function asNullableObject(
187
+ value: any,
188
+ options?: {
189
+ name: string
190
+ }
191
+ ): Record<string, unknown> | null
192
+ declare function asStringMap(
193
+ value: any,
194
+ options?: {
195
+ name: string
196
+ }
197
+ ): Record<string, string>
198
+ declare function asNumericDictionary(
199
+ value: any,
200
+ options?: {
201
+ name: string
202
+ }
203
+ ): Record<string, number>
204
+ declare function isUrl(value: any): boolean
205
+ declare function asUrl(
206
+ value: any,
207
+ options?: {
208
+ name: string
209
+ }
210
+ ): string
211
+ declare function isNullable(typeFn: (value: any) => boolean, value: any): boolean
212
+ declare function asNullable<T>(typeFn: (value: any) => T, value: any): T | null
213
+ declare function asOptional<T>(typeFn: (value: any) => T, value: any): T | undefined
214
+ declare function enforceObjectShape(value: Record<string, any>, shape: Record<string, (value: any) => boolean>): boolean
215
+ declare function enforceArrayShape(value: any[], shape: Record<string, (value: any) => boolean>): boolean
216
+ declare function represent(value: any, strategy?: 'json' | 'key-value', depth?: number): string
217
+ declare function expandError(error: any, stackTrace?: boolean): string
218
+ declare function deepMergeInPlace<X extends object, Y extends object>(target: X, source: Y): X & Y
219
+ declare function deepMerge2<X extends object, Y extends object>(target: X, source: Y): X & Y
220
+ declare function deepMerge3<X extends object, Y extends object, Z extends object>(target: X, sourceA: Y, sourceB: Z): X & Y & Z
221
+ declare function zip<T>(objects: CafeObject<T>[], reducer: (a: T, b: T) => T): CafeObject<T>
222
+ declare function zipSum(objects: CafeObject<number>[]): CafeObject<number>
223
+ declare function pushToBucket<T>(object: Record<string, T[]>, bucket: string, item: T): void
224
+ declare function unshiftAndLimit<T>(array: T[], item: T, limit: number): void
225
+ declare function atRolling<T>(array: T[], index: number): T
226
+ declare function pushAll<T>(array: T[], elements: T[]): void
227
+ declare function unshiftAll<T>(array: T[], elements: T[]): void
228
+ declare function mapAllAsync<T, K>(array: T[], fn: (value: T) => Promise<K>): Promise<K[]>
229
+ declare function glue<T, K>(array: T[], glueElement: K | (() => K)): (T | K)[]
230
+ declare function asEqual<A>(a: A, b: A): [A, A]
231
+ declare function asTrue(data: any): true
232
+ declare function asTruthy<T>(data: T): T
233
+ declare function asFalse(data: any): false
234
+ declare function asFalsy<T>(data: T): T
235
+ declare function asEither(data: string, values: string[]): string
236
+ declare function scheduleMany<T>(handlers: (() => T)[], dates: Date[]): void
237
+ declare function interpolate(a: number, b: number, t: number): number
238
+ declare function sum(array: number[]): number
239
+ declare function average(array: number[]): number
240
+ declare function median(array: number[]): number
241
+ declare function getDistanceFromMidpoint(position: number, length: number): number
242
+ declare function range(start: number, end: number): number[]
243
+ declare function includesAny(string: string, substrings: string[]): boolean
244
+ declare function isChinese(string: string): boolean
245
+ declare function slugify(string: string, shouldAllowToken?: (character: string) => boolean): string
246
+ declare function normalForm(string: string): string
247
+ declare function camelToTitle(string: string): string
248
+ declare function slugToTitle(string: string): string
249
+ declare function slugToCamel(string: string): string
250
+ declare function joinHumanly(parts: string[], separator?: string, lastSeparator?: string): string
251
+ declare function surroundInOut(string: string, filler: string): string
252
+ declare function enumify(string: string): string
253
+ declare function getFuzzyMatchScore(string: string, input: string): number
254
+ declare function sortByFuzzyScore(strings: string[], input: string): string[]
255
+ declare function escapeHtml(string: string): string
256
+ declare function decodeHtmlEntities(string: string): string
257
+ declare function before(string: string, searchString: string): string | null
258
+ declare function after(string: string, searchString: string): string | null
259
+ declare function beforeLast(string: string, searchString: string): string | null
260
+ declare function afterLast(string: string, searchString: string): string | null
261
+ declare function betweenWide(string: string, start: string, end: string): string | null
262
+ declare function betweenNarrow(string: string, start: string, end: string): string | null
263
+ declare function splitOnce(string: string, separator: string, last?: boolean): [string | null, string | null]
264
+ declare function splitAll(string: string, separators: string[]): string[]
265
+ declare function getExtension(path: string): string
266
+ declare function getBasename(path: string): string
267
+ declare function normalizeEmail(email: string): string
268
+ declare function normalizeFilename(path: string): string
208
269
  interface ParsedFilename {
209
- basename: string;
210
- extension: string;
211
- filename: string;
270
+ basename: string
271
+ extension: string
272
+ filename: string
212
273
  }
213
- declare function parseFilename(string: string): ParsedFilename;
214
- declare function randomize(string: string, generator?: () => number): string;
215
- declare function expand(input: string): string[];
216
- declare function shrinkTrim(string: string): string;
217
- declare function capitalize(string: string): string;
218
- declare function decapitalize(string: string): string;
219
- declare function isLetter(character: string): boolean;
220
- declare function isDigit(character: string): boolean;
221
- declare function isLetterOrDigit(character: string): boolean;
222
- declare function isValidObjectPathCharacter(character: string): boolean;
223
- declare function insertString(string: string, index: number, length: number, before: string, after: string): string;
274
+ declare function parseFilename(string: string): ParsedFilename
275
+ declare function randomize(string: string, generator?: () => number): string
276
+ declare function expand(input: string): string[]
277
+ declare function shrinkTrim(string: string): string
278
+ declare function capitalize(string: string): string
279
+ declare function decapitalize(string: string): string
280
+ declare function isLetter(character: string): boolean
281
+ declare function isDigit(character: string): boolean
282
+ declare function isLetterOrDigit(character: string): boolean
283
+ declare function isValidObjectPathCharacter(character: string): boolean
284
+ declare function insertString(string: string, index: number, length: number, before: string, after: string): string
224
285
  interface RegexMatch {
225
- index: number;
226
- match: string;
286
+ index: number
287
+ match: string
227
288
  }
228
- declare function indexOfRegex(string: string, regex: RegExp, start?: number): RegexMatch | null;
229
- declare function lineMatches(haystack: string, needles: (string | RegExp)[], orderMatters?: boolean): boolean;
230
- declare function linesMatchInOrder(lines: string[], expectations: (string | RegExp)[][], orderMatters?: boolean): boolean;
231
- declare function csvEscape(string: string): string;
232
- declare function allIndexOf(string: string, searchString: string, start?: number): number[];
233
- declare function indexOfEarliest(string: string, searchStrings: string[], start?: number): number;
234
- declare function lastIndexOfBefore(string: string, searchString: string, start?: number): number;
235
- declare function findWeightedPair(string: string, start?: number, opening?: string, closing?: string): number;
289
+ declare function indexOfRegex(string: string, regex: RegExp, start?: number): RegexMatch | null
290
+ declare function lineMatches(haystack: string, needles: (string | RegExp)[], orderMatters?: boolean): boolean
291
+ declare function linesMatchInOrder(lines: string[], expectations: (string | RegExp)[][], orderMatters?: boolean): boolean
292
+ declare function csvEscape(string: string): string
293
+ declare function allIndexOf(string: string, searchString: string, start?: number): number[]
294
+ declare function indexOfEarliest(string: string, searchStrings: string[], start?: number): number
295
+ declare function lastIndexOfBefore(string: string, searchString: string, start?: number): number
296
+ declare function findWeightedPair(string: string, start?: number, opening?: string, closing?: string): number
236
297
  interface BlockExtractionOptions {
237
- start?: number;
238
- opening: string;
239
- closing: string;
240
- exclusive?: boolean;
241
- wordBoundary?: boolean;
298
+ start?: number
299
+ opening: string
300
+ closing: string
301
+ exclusive?: boolean
302
+ wordBoundary?: boolean
242
303
  }
243
- declare function extractBlock(string: string, options: BlockExtractionOptions): string | null;
244
- declare function extractAllBlocks(string: string, options: BlockExtractionOptions): string[];
245
- declare function replaceBlocks(string: string, replaceFn: (match: string) => string, options: BlockExtractionOptions): string;
304
+ declare function extractBlock(string: string, options: BlockExtractionOptions): string | null
305
+ declare function extractAllBlocks(string: string, options: BlockExtractionOptions): string[]
306
+ declare function replaceBlocks(string: string, replaceFn: (match: string) => string, options: BlockExtractionOptions): string
246
307
  type StringSegment = {
247
- symbol: string | null;
248
- string: string;
249
- };
250
- declare function splitFormatting(string: string, symbol: string): StringSegment[];
251
- declare function splitHashtags(string: string): StringSegment[];
252
- declare function splitUrls(string: string): StringSegment[];
253
- declare function base64ToUint8Array(base64String: string): Uint8Array;
254
- declare function uint8ArrayToBase64(array: Uint8Array): string;
255
- declare function base32ToUint8Array(base32String: string): Uint8Array;
256
- declare function uint8ArrayToBase32(array: Uint8Array): string;
257
- declare function hexToUint8Array(hex: string): Uint8Array;
258
- declare function uint8ArrayToHex(array: Uint8Array): string;
259
- declare function uint8ArrayToBinary(array: Uint8Array): string;
260
- declare function binaryToUint8Array(binary: string): Uint8Array;
261
- declare function route(pattern: string, actual: string): Record<string, unknown> | null;
308
+ symbol: string | null
309
+ string: string
310
+ }
311
+ declare function splitFormatting(string: string, symbol: string): StringSegment[]
312
+ declare function splitHashtags(string: string): StringSegment[]
313
+ declare function splitUrls(string: string): StringSegment[]
314
+ declare function base64ToUint8Array(base64String: string): Uint8Array
315
+ declare function uint8ArrayToBase64(array: Uint8Array): string
316
+ declare function base32ToUint8Array(base32String: string): Uint8Array
317
+ declare function uint8ArrayToBase32(array: Uint8Array): string
318
+ declare function hexToUint8Array(hex: string): Uint8Array
319
+ declare function uint8ArrayToHex(array: Uint8Array): string
320
+ declare function uint8ArrayToBinary(array: Uint8Array): string
321
+ declare function binaryToUint8Array(binary: string): Uint8Array
322
+ declare function route(pattern: string, actual: string): Record<string, unknown> | null
262
323
  type VariantGroup = {
263
- variants: string[];
264
- avoid: string | null;
265
- };
266
- declare function explodeReplace(string: string, substring: string, variants: string[]): string[];
267
- declare function generateVariants(string: string, groups: VariantGroup[], count: number, generator?: () => number): string[];
268
- declare function replaceWord(string: string, search: string, replace: string, whitespaceOnly?: boolean): string;
269
- declare function replacePascalCaseWords(string: string, replacer: (word: string) => string): string;
270
- declare function stripHtml(string: string): string;
324
+ variants: string[]
325
+ avoid: string | null
326
+ }
327
+ declare function explodeReplace(string: string, substring: string, variants: string[]): string[]
328
+ declare function generateVariants(string: string, groups: VariantGroup[], count: number, generator?: () => number): string[]
329
+ declare function replaceWord(string: string, search: string, replace: string, whitespaceOnly?: boolean): string
330
+ declare function replacePascalCaseWords(string: string, replacer: (word: string) => string): string
331
+ declare function stripHtml(string: string): string
271
332
  declare function breakLine(string: string): {
272
- line: string;
273
- rest: string;
274
- };
275
- declare function measureTextWidth(string: string, characterWidths?: Record<string, number>): number;
276
- declare function toLines(string: string, maxWidth: number, characterWidths?: Record<string, number>): string[];
277
- declare function levenshteinDistance(a: string, b: string): number;
278
- declare function findCommonPrefix(strings: string[]): string;
279
- declare function findCommonDirectory(paths: string[]): string;
280
- declare function containsWord(string: string, word: string): boolean;
281
- declare function containsWords(string: string, words: string[], mode: 'any' | 'all'): boolean;
282
- declare function parseHtmlAttributes(string: string): Record<string, string>;
283
- declare function readNextWord(string: string, index: number, allowedCharacters?: string[]): string;
284
- declare function readWordsAfterAll(string: string, after: string, allowedCharacters?: string[]): string[];
285
- declare function resolveVariables(string: string, variables: Record<string, string>, prefix?: string, separator?: string): string;
286
- declare function resolveVariableWithDefaultSyntax(string: string, key: string, value: string, prefix?: string, separator?: string): string;
287
- declare function resolveRemainingVariablesWithDefaults(string: string, prefix?: string, separator?: string): string;
288
- declare function resolveMarkdownLinks(string: string, transformer: (label: string, link: string) => string): string;
289
- declare function toQueryString(object: Record<string, any>, questionMark?: boolean): string;
290
- declare function parseQueryString(queryString: string): Record<string, string>;
291
- declare function hasKey(object: Record<string, any>, key: string): boolean;
292
- declare function selectMax<T>(object: Record<string, T>, mapper: (item: T) => number): [string, T] | null;
293
- declare function reposition(array: Record<string, unknown>[], key: string, current: number, delta: number): void;
294
- declare function unwrapSingleKey(object: Record<string, unknown>): unknown;
295
- declare function parseKeyValues(lines: string[], separator?: string): Record<string, string>;
296
- declare function buildUrl(baseUrl?: string | null, path?: string | null, query?: Record<string, any> | null): string;
297
- declare function parseCsv(string: string, delimiter?: string, quote?: string): string[];
298
- declare function humanizeProgress(state: Progress): string;
299
- declare function waitFor(predicate: () => Promise<boolean>, waitLength: number, maxWaits: number): Promise<void>;
300
- declare function filterAndRemove<T>(array: T[], predicate: (item: T) => boolean): T[];
301
- declare function cloneWithJson<T>(a: T): T;
302
- declare function unixTimestamp(optionalTimestamp?: number): number;
303
- declare function isoDate(optionalDate?: Date): string;
304
- declare function dateTimeSlug(optionalDate?: Date): string;
305
- declare function fromUtcString(string: string): Date;
306
- declare function fromMillis(millis: number): Date;
307
- declare function createTimeDigits(value: number): string;
308
- declare function normalizeTime(time: string): string;
309
- declare function humanizeTime(millis: number): string;
310
- declare function absoluteDays(date: Date | number): number;
333
+ line: string
334
+ rest: string
335
+ }
336
+ declare function measureTextWidth(string: string, characterWidths?: Record<string, number>): number
337
+ declare function toLines(string: string, maxWidth: number, characterWidths?: Record<string, number>): string[]
338
+ declare function levenshteinDistance(a: string, b: string): number
339
+ declare function findCommonPrefix(strings: string[]): string
340
+ declare function findCommonDirectory(paths: string[]): string
341
+ declare function containsWord(string: string, word: string): boolean
342
+ declare function containsWords(string: string, words: string[], mode: 'any' | 'all'): boolean
343
+ declare function parseHtmlAttributes(string: string): Record<string, string>
344
+ declare function readNextWord(string: string, index: number, allowedCharacters?: string[]): string
345
+ declare function readWordsAfterAll(string: string, after: string, allowedCharacters?: string[]): string[]
346
+ declare function resolveVariables(string: string, variables: Record<string, string>, prefix?: string, separator?: string): string
347
+ declare function resolveVariableWithDefaultSyntax(string: string, key: string, value: string, prefix?: string, separator?: string): string
348
+ declare function resolveRemainingVariablesWithDefaults(string: string, prefix?: string, separator?: string): string
349
+ declare function resolveMarkdownLinks(string: string, transformer: (label: string, link: string) => string): string
350
+ declare function toQueryString(object: Record<string, any>, questionMark?: boolean): string
351
+ declare function parseQueryString(queryString: string): Record<string, string>
352
+ declare function hasKey(object: Record<string, any>, key: string): boolean
353
+ declare function selectMax<T>(object: Record<string, T>, mapper: (item: T) => number): [string, T] | null
354
+ declare function reposition(array: Record<string, unknown>[], key: string, current: number, delta: number): void
355
+ declare function unwrapSingleKey(object: Record<string, unknown>): unknown
356
+ declare function parseKeyValues(lines: string[], separator?: string): Record<string, string>
357
+ declare function buildUrl(baseUrl?: string | null, path?: string | null, query?: Record<string, any> | null): string
358
+ declare function parseCsv(string: string, delimiter?: string, quote?: string): string[]
359
+ declare function humanizeProgress(state: Progress): string
360
+ interface WaitOptions {
361
+ waitMillis: number
362
+ attempts: number
363
+ requiredConsecutivePasses?: number
364
+ }
365
+ declare function waitFor(predicate: () => Promise<boolean>, options: WaitOptions): Promise<void>
366
+ declare function filterAndRemove<T>(array: T[], predicate: (item: T) => boolean): T[]
367
+ declare function cloneWithJson<T>(a: T): T
368
+ declare function unixTimestamp(optionalTimestamp?: number): number
369
+ declare function isoDate(optionalDate?: Date): string
370
+ declare function dateTimeSlug(optionalDate?: Date): string
371
+ declare function fromUtcString(string: string): Date
372
+ declare function fromMillis(millis: number): Date
373
+ declare function createTimeDigits(value: number): string
374
+ declare function normalizeTime(time: string): string
375
+ declare function humanizeTime(millis: number): string
376
+ declare function absoluteDays(date: Date | number): number
311
377
  interface TimestampLabels {
312
- today: (hour: number, minute: number, pm: boolean) => string;
313
- yesterday: () => string;
314
- monday: () => string;
315
- tuesday: () => string;
316
- wednesday: () => string;
317
- thursday: () => string;
318
- friday: () => string;
319
- saturday: () => string;
320
- sunday: () => string;
321
- weeks: (value: number) => string;
378
+ today: (hour: number, minute: number, pm: boolean) => string
379
+ yesterday: () => string
380
+ monday: () => string
381
+ tuesday: () => string
382
+ wednesday: () => string
383
+ thursday: () => string
384
+ friday: () => string
385
+ saturday: () => string
386
+ sunday: () => string
387
+ weeks: (value: number) => string
322
388
  }
323
389
  interface GetTimestampOptions {
324
- now?: number;
325
- labels?: TimestampLabels;
390
+ now?: number
391
+ labels?: TimestampLabels
326
392
  }
327
- declare function getTimestamp(date: Date | number, options?: GetTimestampOptions): string;
393
+ declare function getTimestamp(date: Date | number, options?: GetTimestampOptions): string
328
394
  interface TimeDeltaLabels {
329
- now: () => string;
330
- seconds: (value: number) => string;
331
- minutes: (value: number) => string;
332
- hours: (value: number) => string;
333
- days: (value: number) => string;
334
- weeks: (value: number) => string;
395
+ now: () => string
396
+ seconds: (value: number) => string
397
+ minutes: (value: number) => string
398
+ hours: (value: number) => string
399
+ days: (value: number) => string
400
+ weeks: (value: number) => string
335
401
  }
336
402
  interface TimeDeltaOptions {
337
- now?: number;
338
- labels?: TimeDeltaLabels;
403
+ now?: number
404
+ labels?: TimeDeltaLabels
339
405
  }
340
- declare function getTimeDelta(date: Date | number, options?: TimeDeltaOptions): string;
341
- declare function secondsToHumanTime(seconds: number, labels?: TimeDeltaLabels): string;
406
+ declare function getTimeDelta(date: Date | number, options?: TimeDeltaOptions): string
407
+ declare function secondsToHumanTime(seconds: number, labels?: TimeDeltaLabels): string
342
408
  type CountCyclesOptions = {
343
- precision?: number;
344
- now?: number;
345
- };
346
- declare function countCycles(since: number, cycleLength: number, options?: CountCyclesOptions): {
347
- cycles: number;
348
- remaining: number;
349
- };
350
- declare function throttle(identifier: string, millis: number): boolean;
351
- declare function timeSince(unit: 's' | 'm' | 'h' | 'd', a: Date | number, optionalB?: Date | number): number;
409
+ precision?: number
410
+ now?: number
411
+ }
412
+ declare function countCycles(
413
+ since: number,
414
+ cycleLength: number,
415
+ options?: CountCyclesOptions
416
+ ): {
417
+ cycles: number
418
+ remaining: number
419
+ }
420
+ declare function throttle(identifier: string, millis: number): boolean
421
+ declare function timeSince(unit: 's' | 'm' | 'h' | 'd', a: Date | number, optionalB?: Date | number): number
352
422
  interface Progress {
353
- deltaMs: number;
354
- progress: number;
355
- baseTimeMs: number;
356
- totalTimeMs: number;
357
- remainingTimeMs: number;
423
+ deltaMs: number
424
+ progress: number
425
+ baseTimeMs: number
426
+ totalTimeMs: number
427
+ remainingTimeMs: number
358
428
  }
359
- declare function getProgress(startedAt: number, current: number, total: number, now?: number): Progress;
429
+ declare function getProgress(startedAt: number, current: number, total: number, now?: number): Progress
360
430
  declare const dayNumberIndex: {
361
- readonly 0: "sunday";
362
- readonly 1: "monday";
363
- readonly 2: "tuesday";
364
- readonly 3: "wednesday";
365
- readonly 4: "thursday";
366
- readonly 5: "friday";
367
- readonly 6: "saturday";
368
- };
431
+ readonly 0: 'sunday'
432
+ readonly 1: 'monday'
433
+ readonly 2: 'tuesday'
434
+ readonly 3: 'wednesday'
435
+ readonly 4: 'thursday'
436
+ readonly 5: 'friday'
437
+ readonly 6: 'saturday'
438
+ }
369
439
  interface DayInfo {
370
- zeroBasedIndex: number;
371
- day: 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
440
+ zeroBasedIndex: number
441
+ day: 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday'
372
442
  }
373
- declare function mapDayNumber(zeroBasedIndex: keyof typeof dayNumberIndex): DayInfo;
374
- declare function getDayInfoFromDate(date: Date): DayInfo;
375
- declare function getDayInfoFromDateTimeString(dateTimeString: string): DayInfo;
376
- declare function seconds(value: number): number;
377
- declare function minutes(value: number): number;
378
- declare function hours(value: number): number;
379
- declare function days(value: number): number;
380
- declare function makeDate(numberWithUnit: string): number;
381
- declare function makeStorage(numberWithUnit: string): number;
382
- declare function getPreLine(string: string): string;
383
- declare function getCached<T>(key: string, ttlMillis: number, handler: () => Promise<T>): Promise<T>;
384
- declare function invalidateCache(key: string): void;
385
- declare function joinUrl(parts: unknown[], relativeToFile?: boolean): string;
386
- declare function replaceBetweenStrings(string: string, start: string, end: string, replacement: string, keepBoundaries?: boolean): string;
443
+ declare function mapDayNumber(zeroBasedIndex: keyof typeof dayNumberIndex): DayInfo
444
+ declare function getDayInfoFromDate(date: Date): DayInfo
445
+ declare function getDayInfoFromDateTimeString(dateTimeString: string): DayInfo
446
+ declare function seconds(value: number): number
447
+ declare function minutes(value: number): number
448
+ declare function hours(value: number): number
449
+ declare function days(value: number): number
450
+ declare function makeDate(numberWithUnit: string): number
451
+ declare function makeStorage(numberWithUnit: string): number
452
+ declare function getPreLine(string: string): string
453
+ declare function getCached<T>(key: string, ttlMillis: number, handler: () => Promise<T>): Promise<T>
454
+ declare function invalidateCache(key: string): void
455
+ declare function joinUrl(parts: unknown[], relativeToFile?: boolean): string
456
+ declare function replaceBetweenStrings(string: string, start: string, end: string, replacement: string, keepBoundaries?: boolean): string
387
457
  type MarkdownDescription = {
388
- type: 'p' | 'h1' | 'li';
389
- isCapitalized: boolean;
390
- hasPunctuation: boolean;
391
- endsWithColon: boolean;
392
- };
393
- declare function describeMarkdown(string: string): MarkdownDescription;
394
- declare function isBalanced(string: string, opening?: string, closing?: string): boolean;
395
- declare function textToFormat(text: string): string;
396
- declare function sortObject<T>(object: CafeObject<T>): CafeObject<T>;
397
- declare function sortArray<T>(array: T[]): T[];
398
- declare function sortAny(any: unknown): unknown;
399
- declare function deepEquals(a: unknown, b: unknown): boolean;
400
- declare function deepEqualsEvery(...values: unknown[]): boolean;
401
- declare function safeParse(stringable: string): CafeObject | null;
458
+ type: 'p' | 'h1' | 'li'
459
+ isCapitalized: boolean
460
+ hasPunctuation: boolean
461
+ endsWithColon: boolean
462
+ }
463
+ declare function describeMarkdown(string: string): MarkdownDescription
464
+ declare function isBalanced(string: string, opening?: string, closing?: string): boolean
465
+ declare function textToFormat(text: string): string
466
+ declare function sortObject<T>(object: CafeObject<T>): CafeObject<T>
467
+ declare function sortArray<T>(array: T[]): T[]
468
+ declare function sortAny(any: unknown): unknown
469
+ declare function deepEquals(a: unknown, b: unknown): boolean
470
+ declare function deepEqualsEvery(...values: unknown[]): boolean
471
+ declare function safeParse(stringable: string): CafeObject | null
402
472
  declare function createSequence(): {
403
- next: () => number;
404
- };
473
+ next: () => number
474
+ }
405
475
  declare function createOscillator<T>(values: T[]): {
406
- next: () => T;
407
- };
408
- declare function createStatefulToggle(desiredValue: unknown): (value: unknown) => boolean;
409
- declare function organiseWithLimits<T>(items: T[], limits: Record<string, number>, property: keyof T, defaultValue: string, sortFn?: (a: T, b: T) => number): Record<string, T[]>;
410
- declare function diffKeys(objectA: CafeObject, objectB: CafeObject): {
411
- uniqueToA: string[];
412
- uniqueToB: string[];
413
- };
414
- declare function pickRandomKey(object: CafeObject): string;
415
- declare function mapRandomKey<T>(object: CafeObject<T>, mapFunction: (value: T) => T): string;
416
- declare function fromObjectString<T>(string: string): T;
417
- declare function fromDecimals(number: string, decimals: number, unit?: string): string;
476
+ next: () => T
477
+ }
478
+ declare function createStatefulToggle(desiredValue: unknown): (value: unknown) => boolean
479
+ declare function organiseWithLimits<T>(items: T[], limits: Record<string, number>, property: keyof T, defaultValue: string, sortFn?: (a: T, b: T) => number): Record<string, T[]>
480
+ declare function diffKeys(
481
+ objectA: CafeObject,
482
+ objectB: CafeObject
483
+ ): {
484
+ uniqueToA: string[]
485
+ uniqueToB: string[]
486
+ }
487
+ declare function pickRandomKey(object: CafeObject): string
488
+ declare function mapRandomKey<T>(object: CafeObject<T>, mapFunction: (value: T) => T): string
489
+ declare function fromObjectString<T>(string: string): T
490
+ declare function fromDecimals(number: string, decimals: number, unit?: string): string
418
491
  interface NumberFormatOptions {
419
- precision?: number;
420
- longForm?: boolean;
421
- unit?: null | string;
492
+ precision?: number
493
+ longForm?: boolean
494
+ unit?: null | string
422
495
  }
423
- declare function formatNumber(number: number, options?: NumberFormatOptions): string;
424
- declare function makeNumber(numberWithUnit: string): number;
425
- declare function clamp(value: number, lower: number, upper: number): number;
426
- declare function increment(value: number, change: number, maximum: number): number;
427
- declare function decrement(value: number, change: number, minimum: number): number;
428
- declare function runOn<T>(object: T, callable: (object: T) => void): T;
429
- declare function ifPresent<T>(object: T, callable: (object: T) => void): void;
430
- declare function mergeArrays(target: CafeObject<unknown | unknown[]>, source: CafeObject<unknown | unknown[]>): void;
431
- declare function empty<T>(array: T[]): T[];
432
- declare function removeEmptyArrays(object: CafeObject): CafeObject;
433
- declare function removeEmptyValues(object: CafeObject): CafeObject;
434
- declare function filterObjectKeys<T>(object: CafeObject<T>, predicate: (key: string) => boolean): CafeObject<T>;
435
- declare function filterObjectValues<T>(object: CafeObject<T>, predicate: (value: T) => boolean): CafeObject<T>;
436
- declare function mapObject<T, K>(object: CafeObject<T>, mapper: (value: T) => K): CafeObject<K>;
437
- declare function mapIterable<T, K>(iterable: Iterable<T>, mapper: (value: T, index: number) => K): K[];
438
- declare function rethrow<T>(asyncFn: () => Promise<T>, throwable: Error): Promise<T>;
439
- declare function setSomeOnObject(object: CafeObject, key: string, value: unknown): void;
440
- declare function setSomeDeep(target: CafeObject, targetPath: string, source: CafeObject, sourcePath: string): void;
441
- declare function flip(object: Record<string, Indexable>): CafeObject;
442
- declare function getAllPermutations(object: CafeObject<unknown[]>): CafeObject[];
443
- declare function countTruthyValues(object: CafeObject): number;
444
- declare function flatten(object: CafeObject, arrays?: boolean, prefix?: string): CafeObject | Array<unknown>;
445
- declare function unflatten(object: CafeObject): CafeObject;
446
- declare function match(value: string, options: CafeObject<string>, fallback: string): string;
447
- declare function indexArray<T>(array: T[], keyFn: (item: T) => Indexable): CafeObject<T>;
448
- declare function indexArrayToCollection<T>(array: T[], keyFn: (item: T) => Indexable): CafeObject<T[]>;
449
- declare function splitBySize<T>(array: T[], size: number): T[][];
450
- declare function splitByCount<T>(array: T[], count: number): T[][];
451
- declare function tokenizeByLength(string: string, length: number): string[];
452
- declare function tokenizeByCount(string: string, count: number): string[];
453
- declare function makeUnique<T>(array: T[], fn: (item: T) => string): T[];
454
- declare function countUnique(array: string[], mapper?: (item: string) => string, plain?: boolean, sort?: boolean, reverse?: boolean): CafeObject<number> | string[];
455
- declare function sortObjectValues<T>(object: CafeObject<T>, compareFn: (a: [string, T], b: [string, T]) => number): CafeObject<T>;
456
- declare function transformToArray(objectOfArrays: CafeObject<unknown[]>): CafeObject[];
457
- declare function incrementMulti<T>(objects: T[], key: keyof T, step?: number): void;
458
- declare function setMulti<T, K extends keyof T>(objects: T[], key: K, value: T[K]): void;
459
- declare function group<T>(array: T[], groupFn: (current: T, previous: T) => boolean): T[][];
496
+ declare function formatNumber(number: number, options?: NumberFormatOptions): string
497
+ declare function makeNumber(numberWithUnit: string): number
498
+ declare function clamp(value: number, lower: number, upper: number): number
499
+ declare function increment(value: number, change: number, maximum: number): number
500
+ declare function decrement(value: number, change: number, minimum: number): number
501
+ declare function runOn<T>(object: T, callable: (object: T) => void): T
502
+ declare function ifPresent<T>(object: T, callable: (object: T) => void): void
503
+ declare function mergeArrays(target: CafeObject<unknown | unknown[]>, source: CafeObject<unknown | unknown[]>): void
504
+ declare function empty<T>(array: T[]): T[]
505
+ declare function removeEmptyArrays(object: CafeObject): CafeObject
506
+ declare function removeEmptyValues(object: CafeObject): CafeObject
507
+ declare function filterObjectKeys<T>(object: CafeObject<T>, predicate: (key: string) => boolean): CafeObject<T>
508
+ declare function filterObjectValues<T>(object: CafeObject<T>, predicate: (value: T) => boolean): CafeObject<T>
509
+ declare function mapObject<T, K>(object: CafeObject<T>, mapper: (value: T) => K): CafeObject<K>
510
+ declare function mapIterable<T, K>(iterable: Iterable<T>, mapper: (value: T, index: number) => K): K[]
511
+ declare function rethrow<T>(asyncFn: () => Promise<T>, throwable: Error): Promise<T>
512
+ declare function setSomeOnObject(object: CafeObject, key: string, value: unknown): void
513
+ declare function setSomeDeep(target: CafeObject, targetPath: string, source: CafeObject, sourcePath: string): void
514
+ declare function flip(object: Record<string, Indexable>): CafeObject
515
+ declare function getAllPermutations(object: CafeObject<unknown[]>): CafeObject[]
516
+ declare function countTruthyValues(object: CafeObject): number
517
+ declare function flatten(object: CafeObject, arrays?: boolean, prefix?: string): CafeObject | Array<unknown>
518
+ declare function unflatten(object: CafeObject): CafeObject
519
+ declare function match(value: string, options: CafeObject<string>, fallback: string): string
520
+ declare function indexArray<T>(array: T[], keyFn: (item: T) => Indexable): CafeObject<T>
521
+ declare function indexArrayToCollection<T>(array: T[], keyFn: (item: T) => Indexable): CafeObject<T[]>
522
+ declare function splitBySize<T>(array: T[], size: number): T[][]
523
+ declare function splitByCount<T>(array: T[], count: number): T[][]
524
+ declare function tokenizeByLength(string: string, length: number): string[]
525
+ declare function tokenizeByCount(string: string, count: number): string[]
526
+ declare function makeUnique<T>(array: T[], fn: (item: T) => string): T[]
527
+ declare function countUnique(array: string[], mapper?: (item: string) => string, plain?: boolean, sort?: boolean, reverse?: boolean): CafeObject<number> | string[]
528
+ declare function sortObjectValues<T>(object: CafeObject<T>, compareFn: (a: [string, T], b: [string, T]) => number): CafeObject<T>
529
+ declare function transformToArray(objectOfArrays: CafeObject<unknown[]>): CafeObject[]
530
+ declare function incrementMulti<T>(objects: T[], key: keyof T, step?: number): void
531
+ declare function setMulti<T, K extends keyof T>(objects: T[], key: K, value: T[K]): void
532
+ declare function group<T>(array: T[], groupFn: (current: T, previous: T) => boolean): T[][]
460
533
  interface TemporalData<T> {
461
- validUntil: number;
462
- data: T;
534
+ validUntil: number
535
+ data: T
463
536
  }
464
537
  interface BidirectionalMap<K, T> {
465
- map: Map<K, T>;
466
- keys: K[];
538
+ map: Map<K, T>
539
+ keys: K[]
467
540
  }
468
- declare function createBidirectionalMap<K, T>(): BidirectionalMap<K, T>;
469
- declare function createTemporalBidirectionalMap<K, T>(): BidirectionalMap<K, TemporalData<T>>;
470
- declare function pushToBidirectionalMap<K, T>(object: BidirectionalMap<K, T>, key: K, item: T, limit?: number): void;
471
- declare function unshiftToBidirectionalMap<K, T>(object: BidirectionalMap<K, T>, key: K, item: T, limit?: number): void;
472
- declare function addToTemporalBidirectionalMap<K, T>(object: BidirectionalMap<K, TemporalData<T>>, key: K, item: T, expiration: number, limit?: number): void;
473
- declare function getFromTemporalBidirectionalMap<K, T>(object: BidirectionalMap<K, TemporalData<T>>, key: K): T | null;
541
+ declare function createBidirectionalMap<K, T>(): BidirectionalMap<K, T>
542
+ declare function createTemporalBidirectionalMap<K, T>(): BidirectionalMap<K, TemporalData<T>>
543
+ declare function pushToBidirectionalMap<K, T>(object: BidirectionalMap<K, T>, key: K, item: T, limit?: number): void
544
+ declare function unshiftToBidirectionalMap<K, T>(object: BidirectionalMap<K, T>, key: K, item: T, limit?: number): void
545
+ declare function addToTemporalBidirectionalMap<K, T>(object: BidirectionalMap<K, TemporalData<T>>, key: K, item: T, expiration: number, limit?: number): void
546
+ declare function getFromTemporalBidirectionalMap<K, T>(object: BidirectionalMap<K, TemporalData<T>>, key: K): T | null
474
547
  export declare class Optional<T> {
475
- value: T | null | undefined;
476
- private constructor();
477
- static of<U>(value: U | null | undefined): Optional<U>;
478
- static empty<U>(): Optional<U>;
479
- map<K>(fn: (value: T) => K): Optional<K>;
480
- mapAsync<K>(fn: (value: T) => Promise<K>): Promise<Optional<K>>;
481
- ifPresent(fn: (value: T) => void): this;
482
- ifPresentAsync(fn: (value: T) => Promise<void>): Promise<this>;
483
- ifAbsent(fn: () => void): this;
484
- ifAbsentAsync(fn: () => Promise<void>): Promise<this>;
485
- getOrFallback(fn: () => T): T;
486
- getOrFallbackAsync(fn: () => Promise<T>): Promise<T>;
487
- getOrThrow(): T;
548
+ value: T | null | undefined
549
+ private constructor()
550
+ static of<U>(value: U | null | undefined): Optional<U>
551
+ static empty<U>(): Optional<U>
552
+ map<K>(fn: (value: T) => K): Optional<K>
553
+ mapAsync<K>(fn: (value: T) => Promise<K>): Promise<Optional<K>>
554
+ ifPresent(fn: (value: T) => void): this
555
+ ifPresentAsync(fn: (value: T) => Promise<void>): Promise<this>
556
+ ifAbsent(fn: () => void): this
557
+ ifAbsentAsync(fn: () => Promise<void>): Promise<this>
558
+ getOrFallback(fn: () => T): T
559
+ getOrFallbackAsync(fn: () => Promise<T>): Promise<T>
560
+ getOrThrow(): T
488
561
  }
489
562
  export declare class Lazy<T> {
490
- private readonly supplier;
491
- private value;
492
- constructor(supplier: () => T);
493
- get(): T;
563
+ private readonly supplier
564
+ private value
565
+ constructor(supplier: () => T)
566
+ get(): T
494
567
  }
495
568
  export declare class AsyncLazy<T> {
496
- private readonly supplier;
497
- private value;
498
- constructor(supplier: () => Promise<T>);
499
- get(): Promise<T>;
569
+ private readonly supplier
570
+ private value
571
+ constructor(supplier: () => Promise<T>)
572
+ get(): Promise<T>
500
573
  }
501
574
  interface Newable<T> extends Function {
502
- new (...args: any[]): T;
575
+ new (...args: any[]): T
503
576
  }
504
- declare function multicall(functions: (() => void)[]): () => void;
505
- declare function maxBy<T>(array: T[], fn: (item: T) => number): T;
506
- declare function findInstance<T, K extends T>(array: T[], type: Newable<K>): Optional<K>;
507
- declare function filterInstances<T, K extends T>(array: T[], type: Newable<K>): K[];
508
- declare function interleave<T, K>(arrayA: T[], arrayB: K[]): (T | K)[];
509
- declare function toggle<T>(array: T[], value: T): T[];
577
+ declare function multicall(functions: (() => void)[]): () => void
578
+ declare function maxBy<T>(array: T[], fn: (item: T) => number): T
579
+ declare function findInstance<T, K extends T>(array: T[], type: Newable<K>): Optional<K>
580
+ declare function filterInstances<T, K extends T>(array: T[], type: Newable<K>): K[]
581
+ declare function interleave<T, K>(arrayA: T[], arrayB: K[]): (T | K)[]
582
+ declare function toggle<T>(array: T[], value: T): T[]
510
583
  declare class Node<T> {
511
- value: T;
512
- children: Node<T>[];
513
- constructor(value: T);
584
+ value: T
585
+ children: Node<T>[]
586
+ constructor(value: T)
514
587
  }
515
- declare function createHierarchy<T>(items: T[], idKey: keyof T, parentKey: keyof T, sortKey: keyof T, reverse?: boolean): Node<T>[];
516
- declare function log2Reduce<T>(array: T[], reducer: (a: T, b: T) => T): T;
517
- declare function concatBytes(...arrays: Uint8Array[]): Uint8Array;
518
- declare function isPng(bytes: Uint8Array): boolean;
519
- declare function isJpg(bytes: Uint8Array): boolean;
520
- declare function isWebp(bytes: Uint8Array): boolean;
521
- declare function isImage(bytes: Uint8Array): boolean;
522
- declare function numberToUint8(number: number): Uint8Array;
523
- declare function uint8ToNumber(bytes: Uint8Array): number;
524
- declare function numberToUint16(number: number, endian: 'LE' | 'BE'): Uint8Array;
525
- declare function uint16ToNumber(bytes: Uint8Array, endian: 'LE' | 'BE'): number;
526
- declare function numberToUint32(number: number, endian: 'LE' | 'BE'): Uint8Array;
527
- declare function uint32ToNumber(bytes: Uint8Array, endian: 'LE' | 'BE'): number;
528
- declare function numberToUint64(number: bigint, endian: 'LE' | 'BE'): Uint8Array;
529
- declare function uint64ToNumber(bytes: Uint8Array, endian: 'LE' | 'BE'): bigint;
530
- declare function numberToUint256(number: bigint, endian: 'LE' | 'BE'): Uint8Array;
531
- declare function uint256ToNumber(bytes: Uint8Array, endian: 'LE' | 'BE'): bigint;
532
- declare function sliceBytes(bytes: Uint8Array, lengths: number[]): Uint8Array[];
533
- declare function partition(bytes: Uint8Array, size: number): Uint8Array[];
534
- declare function keccak256(bytes: Uint8Array): Uint8Array;
535
- declare function sha3_256(bytes: Uint8Array): Uint8Array;
536
- declare function proximity(one: Uint8Array, other: Uint8Array): number;
537
- declare function commonPrefix(one: Uint8Array, other: Uint8Array): Uint8Array;
538
- declare function setBit(bytes: Uint8Array, index: number, value: 0 | 1, endian: 'LE' | 'BE'): void;
539
- declare function getBit(bytes: Uint8Array, index: number, endian: 'LE' | 'BE'): 0 | 1;
540
- declare function binaryIndexOf(bytes: Uint8Array, value: Uint8Array, start?: number): number;
541
- declare function binaryPadStart(bytes: Uint8Array, size: number, paddingByte?: number): Uint8Array;
542
- declare function binaryPadStartToMultiple(bytes: Uint8Array, multiple: number, paddingByte?: number): Uint8Array;
543
- declare function binaryPadEnd(bytes: Uint8Array, size: number, paddingByte?: number): Uint8Array;
544
- declare function binaryPadEndToMultiple(bytes: Uint8Array, multiple: number, paddingByte?: number): Uint8Array;
545
- declare function xorCypher(bytes: Uint8Array, key: Uint8Array): Uint8Array;
546
- declare function isUtf8(bytes: Uint8Array): boolean;
547
- declare function binaryEquals(a: Uint8Array, b: Uint8Array): boolean;
548
- declare function privateKeyToPublicKey(privateKey: bigint): [bigint, bigint];
549
- declare function compressPublicKey(publicKey: [bigint, bigint]): Uint8Array;
550
- declare function publicKeyFromCompressed(compressed: Uint8Array): [bigint, bigint];
551
- declare function publicKeyToAddress(publicKey: [bigint, bigint]): Uint8Array;
552
- declare function checksumEncode(addressBytes: Uint8Array): string;
553
- declare function signMessage(message: Uint8Array, privateKey: bigint, nonce?: bigint): [bigint, bigint, 27n | 28n];
554
- declare function signHash(hash: bigint, privateKey: bigint, nonce?: bigint): [bigint, bigint, 27n | 28n];
555
- declare function recoverPublicKey(message: Uint8Array, r: bigint, s: bigint, v: 27n | 28n): [bigint, bigint];
556
- declare function verifySignature(message: Uint8Array, publicKey: [bigint, bigint], r: bigint, s: bigint): boolean;
588
+ declare function createHierarchy<T>(items: T[], idKey: keyof T, parentKey: keyof T, sortKey: keyof T, reverse?: boolean): Node<T>[]
589
+ declare function log2Reduce<T>(array: T[], reducer: (a: T, b: T) => T): T
590
+ declare function concatBytes(...arrays: Uint8Array[]): Uint8Array
591
+ declare function isPng(bytes: Uint8Array): boolean
592
+ declare function isJpg(bytes: Uint8Array): boolean
593
+ declare function isWebp(bytes: Uint8Array): boolean
594
+ declare function isImage(bytes: Uint8Array): boolean
595
+ declare function numberToUint8(number: number): Uint8Array
596
+ declare function uint8ToNumber(bytes: Uint8Array): number
597
+ declare function numberToUint16(number: number, endian: 'LE' | 'BE'): Uint8Array
598
+ declare function uint16ToNumber(bytes: Uint8Array, endian: 'LE' | 'BE'): number
599
+ declare function numberToUint32(number: number, endian: 'LE' | 'BE'): Uint8Array
600
+ declare function uint32ToNumber(bytes: Uint8Array, endian: 'LE' | 'BE'): number
601
+ declare function numberToUint64(number: bigint, endian: 'LE' | 'BE'): Uint8Array
602
+ declare function uint64ToNumber(bytes: Uint8Array, endian: 'LE' | 'BE'): bigint
603
+ declare function numberToUint256(number: bigint, endian: 'LE' | 'BE'): Uint8Array
604
+ declare function uint256ToNumber(bytes: Uint8Array, endian: 'LE' | 'BE'): bigint
605
+ declare function sliceBytes(bytes: Uint8Array, lengths: number[]): Uint8Array[]
606
+ declare function partition(bytes: Uint8Array, size: number): Uint8Array[]
607
+ declare function keccak256(bytes: Uint8Array): Uint8Array
608
+ declare function sha3_256(bytes: Uint8Array): Uint8Array
609
+ declare function proximity(one: Uint8Array, other: Uint8Array): number
610
+ declare function commonPrefix(one: Uint8Array, other: Uint8Array): Uint8Array
611
+ declare function setBit(bytes: Uint8Array, index: number, value: 0 | 1, endian: 'LE' | 'BE'): void
612
+ declare function getBit(bytes: Uint8Array, index: number, endian: 'LE' | 'BE'): 0 | 1
613
+ declare function binaryIndexOf(bytes: Uint8Array, value: Uint8Array, start?: number): number
614
+ declare function binaryPadStart(bytes: Uint8Array, size: number, paddingByte?: number): Uint8Array
615
+ declare function binaryPadStartToMultiple(bytes: Uint8Array, multiple: number, paddingByte?: number): Uint8Array
616
+ declare function binaryPadEnd(bytes: Uint8Array, size: number, paddingByte?: number): Uint8Array
617
+ declare function binaryPadEndToMultiple(bytes: Uint8Array, multiple: number, paddingByte?: number): Uint8Array
618
+ declare function xorCypher(bytes: Uint8Array, key: Uint8Array): Uint8Array
619
+ declare function isUtf8(bytes: Uint8Array): boolean
620
+ declare function binaryEquals(a: Uint8Array, b: Uint8Array): boolean
621
+ declare function privateKeyToPublicKey(privateKey: bigint): [bigint, bigint]
622
+ declare function compressPublicKey(publicKey: [bigint, bigint]): Uint8Array
623
+ declare function publicKeyFromCompressed(compressed: Uint8Array): [bigint, bigint]
624
+ declare function publicKeyToAddress(publicKey: [bigint, bigint]): Uint8Array
625
+ declare function checksumEncode(addressBytes: Uint8Array): string
626
+ declare function signMessage(message: Uint8Array, privateKey: bigint, nonce?: bigint): [bigint, bigint, 27n | 28n]
627
+ declare function signHash(hash: bigint, privateKey: bigint, nonce?: bigint): [bigint, bigint, 27n | 28n]
628
+ declare function recoverPublicKey(message: Uint8Array, r: bigint, s: bigint, v: 27n | 28n): [bigint, bigint]
629
+ declare function verifySignature(message: Uint8Array, publicKey: [bigint, bigint], r: bigint, s: bigint): boolean
557
630
  export declare class Uint8ArrayReader {
558
- cursor: number;
559
- buffer: Uint8Array;
560
- constructor(buffer: Uint8Array);
561
- read(size: number): Uint8Array;
562
- max(): number;
631
+ cursor: number
632
+ buffer: Uint8Array
633
+ constructor(buffer: Uint8Array)
634
+ read(size: number): Uint8Array
635
+ max(): number
563
636
  }
564
637
  export declare class Uint8ArrayWriter {
565
- cursor: number;
566
- buffer: Uint8Array;
567
- constructor(buffer: Uint8Array);
568
- write(reader: Uint8ArrayReader): number;
569
- max(): number;
638
+ cursor: number
639
+ buffer: Uint8Array
640
+ constructor(buffer: Uint8Array)
641
+ write(reader: Uint8ArrayReader): number
642
+ max(): number
570
643
  }
571
644
  export declare class Chunk {
572
- static hashFunction: (bytes: Uint8Array) => Uint8Array;
573
- span: bigint;
574
- writer: Uint8ArrayWriter;
575
- constructor(capacity: number, span?: bigint);
576
- build(): Uint8Array;
577
- hash(): Uint8Array;
645
+ static hashFunction: (bytes: Uint8Array) => Uint8Array
646
+ span: bigint
647
+ writer: Uint8ArrayWriter
648
+ constructor(capacity: number, span?: bigint)
649
+ build(): Uint8Array
650
+ hash(): Uint8Array
578
651
  }
579
652
  export declare class MerkleTree {
580
- static readonly NOOP: (_: Chunk) => Promise<void>;
581
- private capacity;
582
- private chunks;
583
- private counters;
584
- private onChunk;
585
- constructor(onChunk: (chunk: Chunk) => Promise<void>, capacity?: number);
586
- static root(data: Uint8Array, capacity?: number): Promise<Chunk>;
587
- append(data: Uint8Array, level?: number, spanIncrement?: bigint): Promise<void>;
588
- private elevate;
589
- finalize(level?: number): Promise<Chunk>;
653
+ static readonly NOOP: (_: Chunk) => Promise<void>
654
+ private capacity
655
+ private chunks
656
+ private counters
657
+ private onChunk
658
+ constructor(onChunk: (chunk: Chunk) => Promise<void>, capacity?: number)
659
+ static root(data: Uint8Array, capacity?: number): Promise<Chunk>
660
+ append(data: Uint8Array, level?: number, spanIncrement?: bigint): Promise<void>
661
+ private elevate
662
+ finalize(level?: number): Promise<Chunk>
590
663
  }
591
664
  export declare class FixedPointNumber {
592
- value: bigint;
593
- scale: number;
594
- constructor(value: bigint | string | number, scale: number);
595
- static fromDecimalString(decimalString: string, scale: number): FixedPointNumber;
596
- add(other: FixedPointNumber): FixedPointNumber;
597
- subtract(other: FixedPointNumber): FixedPointNumber;
598
- multiply(factor: bigint): FixedPointNumber;
599
- divmod(divisor: bigint): [FixedPointNumber, FixedPointNumber];
600
- exchange(direction: '*' | '/', rate: FixedPointNumber, targetScale: number): FixedPointNumber;
601
- compare(other: FixedPointNumber): 1 | 0 | -1;
602
- toDecimalString(): string;
603
- toString(): string;
604
- toJSON(): string;
605
- assertSameScale(other: FixedPointNumber): void;
665
+ value: bigint
666
+ scale: number
667
+ constructor(value: bigint | string | number, scale: number)
668
+ static fromDecimalString(decimalString: string, scale: number): FixedPointNumber
669
+ add(other: FixedPointNumber): FixedPointNumber
670
+ subtract(other: FixedPointNumber): FixedPointNumber
671
+ multiply(factor: bigint): FixedPointNumber
672
+ divmod(divisor: bigint): [FixedPointNumber, FixedPointNumber]
673
+ exchange(direction: '*' | '/', rate: FixedPointNumber, targetScale: number): FixedPointNumber
674
+ compare(other: FixedPointNumber): 1 | 0 | -1
675
+ toDecimalString(): string
676
+ toString(): string
677
+ toJSON(): string
678
+ assertSameScale(other: FixedPointNumber): void
606
679
  }
607
680
  type Playbook<T> = {
608
- ttl: number;
609
- ttlMax?: number;
610
- data: T;
611
- }[];
681
+ ttl: number
682
+ ttlMax?: number
683
+ data: T
684
+ }[]
612
685
  declare function tickPlaybook<T>(playbook: Playbook<T>): {
613
- progress: number;
614
- data: T;
615
- } | null;
616
- declare function getArgument(args: string[], key: string, env?: Record<string, string | undefined>, envKey?: string): string | null;
617
- declare function getNumberArgument(args: string[], key: string, env?: Record<string, string | undefined>, envKey?: string): number | null;
618
- declare function getBooleanArgument(args: string[], key: string, env?: Record<string, string | undefined>, envKey?: string): boolean | null;
619
- declare function requireStringArgument(args: string[], key: string, env?: Record<string, string | undefined>, envKey?: string): string;
620
- declare function requireNumberArgument(args: string[], key: string, env?: Record<string, string | undefined>, envKey?: string): number;
621
- declare function bringToFrontInPlace<T>(array: T[], index: number): void;
622
- declare function bringToFront<T>(array: T[], index: number): T[];
686
+ progress: number
687
+ data: T
688
+ } | null
689
+ declare function getArgument(args: string[], key: string, env?: Record<string, string | undefined>, envKey?: string): string | null
690
+ declare function getNumberArgument(args: string[], key: string, env?: Record<string, string | undefined>, envKey?: string): number | null
691
+ declare function getBooleanArgument(args: string[], key: string, env?: Record<string, string | undefined>, envKey?: string): boolean | null
692
+ declare function requireStringArgument(args: string[], key: string, env?: Record<string, string | undefined>, envKey?: string): string
693
+ declare function requireNumberArgument(args: string[], key: string, env?: Record<string, string | undefined>, envKey?: string): number
694
+ declare function bringToFrontInPlace<T>(array: T[], index: number): void
695
+ declare function bringToFront<T>(array: T[], index: number): T[]
623
696
  type Point = {
624
- x: number;
625
- y: number;
626
- };
697
+ x: number
698
+ y: number
699
+ }
627
700
  type Line = {
628
- start: Point;
629
- end: Point;
630
- };
631
- type Truthy = boolean | number;
632
- declare function addPoint(a: Point, b: Point): Point;
633
- declare function subtractPoint(a: Point, b: Point): Point;
634
- declare function multiplyPoint(point: Point, scalar: number): Point;
635
- declare function normalizePoint(point: Point): Point;
636
- declare function pushPoint(point: Point, angle: number, length: number): Point;
637
- declare function filterCoordinates(grid: Truthy[][], predicate: (x: number, y: number) => boolean, direction?: 'row-first' | 'column-first'): Point[];
638
- declare function findCorners(tiles: Truthy[][], tileSize: number, columns: number, rows: number): Point[];
639
- declare function findLines(grid: Truthy[][], tileSize: number): Line[];
640
- declare function getLineIntersectionPoint(line1Start: Point, line1End: Point, line2Start: Point, line2End: Point): Point | null;
641
- declare function raycast(origin: Point, lines: Line[], angle: number): Point | null;
642
- declare function raycastCircle(origin: Point, lines: Line[], corners: Point[]): Point[];
701
+ start: Point
702
+ end: Point
703
+ }
704
+ type Truthy = boolean | number
705
+ declare function addPoint(a: Point, b: Point): Point
706
+ declare function subtractPoint(a: Point, b: Point): Point
707
+ declare function multiplyPoint(point: Point, scalar: number): Point
708
+ declare function normalizePoint(point: Point): Point
709
+ declare function pushPoint(point: Point, angle: number, length: number): Point
710
+ declare function filterCoordinates(grid: Truthy[][], predicate: (x: number, y: number) => boolean, direction?: 'row-first' | 'column-first'): Point[]
711
+ declare function findCorners(tiles: Truthy[][], tileSize: number, columns: number, rows: number): Point[]
712
+ declare function findLines(grid: Truthy[][], tileSize: number): Line[]
713
+ declare function getLineIntersectionPoint(line1Start: Point, line1End: Point, line2Start: Point, line2End: Point): Point | null
714
+ declare function raycast(origin: Point, lines: Line[], angle: number): Point | null
715
+ declare function raycastCircle(origin: Point, lines: Line[], corners: Point[]): Point[]
643
716
  export declare class PubSubChannel<T> {
644
- private subscribers;
645
- subscribe(callback: (data: T) => void): () => void;
646
- publish(data: T): void;
647
- clear(): void;
648
- getSubscriberCount(): number;
717
+ private subscribers
718
+ subscribe(callback: (data: T) => void): () => void
719
+ publish(data: T): void
720
+ clear(): void
721
+ getSubscriberCount(): number
649
722
  }
650
723
  export declare class AsyncQueue {
651
- queue: (() => Promise<void>)[];
652
- concurrency: number;
653
- capacity: number;
654
- running: number;
655
- onProcessed: PubSubChannel<void>;
656
- onDrained: PubSubChannel<void>;
657
- constructor(concurrency: number, capacity: number);
658
- private process;
659
- enqueue(fn: () => Promise<void>): Promise<void>;
660
- drain(): Promise<void>;
724
+ queue: (() => Promise<void>)[]
725
+ concurrency: number
726
+ capacity: number
727
+ running: number
728
+ onProcessed: PubSubChannel<void>
729
+ onDrained: PubSubChannel<void>
730
+ constructor(concurrency: number, capacity: number)
731
+ private process
732
+ enqueue(fn: () => Promise<void>): Promise<void>
733
+ drain(): Promise<void>
661
734
  }
662
- type RouterFn<Q, S> = (request: Q, response: S, context: Map<string, string>) => Promise<void>;
735
+ type RouterFn<Q, S> = (request: Q, response: S, context: Map<string, string>) => Promise<void>
663
736
  export declare class TrieRouter<Q, S> {
664
- private forks;
665
- private handler?;
666
- private variableName?;
667
- insert(pathSegments: string[], handler: RouterFn<Q, S>): void;
668
- handle(pathSegments: string[], request: Q, response: S, context: Map<string, string>): Promise<boolean>;
737
+ private forks
738
+ private handler?
739
+ private variableName?
740
+ insert(pathSegments: string[], handler: RouterFn<Q, S>): void
741
+ handle(pathSegments: string[], request: Q, response: S, context: Map<string, string>): Promise<boolean>
669
742
  }
670
743
  export declare const Binary: {
671
- hexToUint8Array: typeof hexToUint8Array;
672
- uint8ArrayToHex: typeof uint8ArrayToHex;
673
- binaryToUint8Array: typeof binaryToUint8Array;
674
- uint8ArrayToBinary: typeof uint8ArrayToBinary;
675
- base64ToUint8Array: typeof base64ToUint8Array;
676
- uint8ArrayToBase64: typeof uint8ArrayToBase64;
677
- base32ToUint8Array: typeof base32ToUint8Array;
678
- uint8ArrayToBase32: typeof uint8ArrayToBase32;
679
- log2Reduce: typeof log2Reduce;
680
- partition: typeof partition;
681
- concatBytes: typeof concatBytes;
682
- numberToUint8: typeof numberToUint8;
683
- uint8ToNumber: typeof uint8ToNumber;
684
- numberToUint16: typeof numberToUint16;
685
- uint16ToNumber: typeof uint16ToNumber;
686
- numberToUint32: typeof numberToUint32;
687
- uint32ToNumber: typeof uint32ToNumber;
688
- numberToUint64: typeof numberToUint64;
689
- uint64ToNumber: typeof uint64ToNumber;
690
- numberToUint256: typeof numberToUint256;
691
- uint256ToNumber: typeof uint256ToNumber;
692
- sliceBytes: typeof sliceBytes;
693
- keccak256: typeof keccak256;
694
- sha3_256: typeof sha3_256;
695
- proximity: typeof proximity;
696
- commonPrefix: typeof commonPrefix;
697
- setBit: typeof setBit;
698
- getBit: typeof getBit;
699
- indexOf: typeof binaryIndexOf;
700
- equals: typeof binaryEquals;
701
- padStart: typeof binaryPadStart;
702
- padStartToMultiple: typeof binaryPadStartToMultiple;
703
- padEnd: typeof binaryPadEnd;
704
- padEndToMultiple: typeof binaryPadEndToMultiple;
705
- xorCypher: typeof xorCypher;
706
- isUtf8: typeof isUtf8;
707
- };
744
+ hexToUint8Array: typeof hexToUint8Array
745
+ uint8ArrayToHex: typeof uint8ArrayToHex
746
+ binaryToUint8Array: typeof binaryToUint8Array
747
+ uint8ArrayToBinary: typeof uint8ArrayToBinary
748
+ base64ToUint8Array: typeof base64ToUint8Array
749
+ uint8ArrayToBase64: typeof uint8ArrayToBase64
750
+ base32ToUint8Array: typeof base32ToUint8Array
751
+ uint8ArrayToBase32: typeof uint8ArrayToBase32
752
+ log2Reduce: typeof log2Reduce
753
+ partition: typeof partition
754
+ concatBytes: typeof concatBytes
755
+ numberToUint8: typeof numberToUint8
756
+ uint8ToNumber: typeof uint8ToNumber
757
+ numberToUint16: typeof numberToUint16
758
+ uint16ToNumber: typeof uint16ToNumber
759
+ numberToUint32: typeof numberToUint32
760
+ uint32ToNumber: typeof uint32ToNumber
761
+ numberToUint64: typeof numberToUint64
762
+ uint64ToNumber: typeof uint64ToNumber
763
+ numberToUint256: typeof numberToUint256
764
+ uint256ToNumber: typeof uint256ToNumber
765
+ sliceBytes: typeof sliceBytes
766
+ keccak256: typeof keccak256
767
+ sha3_256: typeof sha3_256
768
+ proximity: typeof proximity
769
+ commonPrefix: typeof commonPrefix
770
+ setBit: typeof setBit
771
+ getBit: typeof getBit
772
+ indexOf: typeof binaryIndexOf
773
+ equals: typeof binaryEquals
774
+ padStart: typeof binaryPadStart
775
+ padStartToMultiple: typeof binaryPadStartToMultiple
776
+ padEnd: typeof binaryPadEnd
777
+ padEndToMultiple: typeof binaryPadEndToMultiple
778
+ xorCypher: typeof xorCypher
779
+ isUtf8: typeof isUtf8
780
+ }
708
781
  export declare const Elliptic: {
709
- privateKeyToPublicKey: typeof privateKeyToPublicKey;
710
- compressPublicKey: typeof compressPublicKey;
711
- publicKeyFromCompressed: typeof publicKeyFromCompressed;
712
- publicKeyToAddress: typeof publicKeyToAddress;
713
- signMessage: typeof signMessage;
714
- signHash: typeof signHash;
715
- verifySignature: typeof verifySignature;
716
- recoverPublicKey: typeof recoverPublicKey;
717
- checksumEncode: typeof checksumEncode;
718
- };
782
+ privateKeyToPublicKey: typeof privateKeyToPublicKey
783
+ compressPublicKey: typeof compressPublicKey
784
+ publicKeyFromCompressed: typeof publicKeyFromCompressed
785
+ publicKeyToAddress: typeof publicKeyToAddress
786
+ signMessage: typeof signMessage
787
+ signHash: typeof signHash
788
+ verifySignature: typeof verifySignature
789
+ recoverPublicKey: typeof recoverPublicKey
790
+ checksumEncode: typeof checksumEncode
791
+ }
719
792
  export declare const Random: {
720
- intBetween: typeof intBetween;
721
- floatBetween: typeof floatBetween;
722
- chance: typeof chance;
723
- signed: typeof signedRandom;
724
- makeSeededRng: typeof makeSeededRng;
725
- point: typeof randomPoint;
726
- procs: typeof procs;
727
- };
793
+ intBetween: typeof intBetween
794
+ floatBetween: typeof floatBetween
795
+ chance: typeof chance
796
+ signed: typeof signedRandom
797
+ makeSeededRng: typeof makeSeededRng
798
+ point: typeof randomPoint
799
+ procs: typeof procs
800
+ }
728
801
  export declare const Arrays: {
729
- countUnique: typeof countUnique;
730
- makeUnique: typeof makeUnique;
731
- splitBySize: typeof splitBySize;
732
- splitByCount: typeof splitByCount;
733
- index: typeof indexArray;
734
- indexCollection: typeof indexArrayToCollection;
735
- onlyOrThrow: typeof onlyOrThrow;
736
- onlyOrNull: typeof onlyOrNull;
737
- firstOrThrow: typeof firstOrThrow;
738
- firstOrNull: typeof firstOrNull;
739
- shuffle: typeof shuffle;
740
- initialize: typeof initializeArray;
741
- initialize2D: typeof initialize2DArray;
742
- rotate2D: typeof rotate2DArray;
743
- containsShape: typeof containsShape;
744
- glue: typeof glue;
745
- pluck: typeof pluck;
746
- pick: typeof pick;
747
- pickMany: typeof pickMany;
748
- pickManyUnique: typeof pickManyUnique;
749
- pickWeighted: typeof pickWeighted;
750
- pickRandomIndices: typeof pickRandomIndices;
751
- pickGuaranteed: typeof pickGuaranteed;
752
- last: typeof last;
753
- pipe: typeof pipe;
754
- makePipe: typeof makePipe;
755
- sortWeighted: typeof sortWeighted;
756
- pushAll: typeof pushAll;
757
- unshiftAll: typeof unshiftAll;
758
- filterAndRemove: typeof filterAndRemove;
759
- merge: typeof mergeArrays;
760
- empty: typeof empty;
761
- pushToBucket: typeof pushToBucket;
762
- unshiftAndLimit: typeof unshiftAndLimit;
763
- atRolling: typeof atRolling;
764
- group: typeof group;
765
- createOscillator: typeof createOscillator;
766
- organiseWithLimits: typeof organiseWithLimits;
767
- tickPlaybook: typeof tickPlaybook;
768
- getArgument: typeof getArgument;
769
- getBooleanArgument: typeof getBooleanArgument;
770
- getNumberArgument: typeof getNumberArgument;
771
- requireStringArgument: typeof requireStringArgument;
772
- requireNumberArgument: typeof requireNumberArgument;
773
- bringToFront: typeof bringToFront;
774
- bringToFrontInPlace: typeof bringToFrontInPlace;
775
- findInstance: typeof findInstance;
776
- filterInstances: typeof filterInstances;
777
- interleave: typeof interleave;
778
- toggle: typeof toggle;
779
- createHierarchy: typeof createHierarchy;
780
- multicall: typeof multicall;
781
- maxBy: typeof maxBy;
782
- };
802
+ countUnique: typeof countUnique
803
+ makeUnique: typeof makeUnique
804
+ splitBySize: typeof splitBySize
805
+ splitByCount: typeof splitByCount
806
+ index: typeof indexArray
807
+ indexCollection: typeof indexArrayToCollection
808
+ onlyOrThrow: typeof onlyOrThrow
809
+ onlyOrNull: typeof onlyOrNull
810
+ firstOrThrow: typeof firstOrThrow
811
+ firstOrNull: typeof firstOrNull
812
+ shuffle: typeof shuffle
813
+ initialize: typeof initializeArray
814
+ initialize2D: typeof initialize2DArray
815
+ rotate2D: typeof rotate2DArray
816
+ containsShape: typeof containsShape
817
+ glue: typeof glue
818
+ pluck: typeof pluck
819
+ pick: typeof pick
820
+ pickMany: typeof pickMany
821
+ pickManyUnique: typeof pickManyUnique
822
+ pickWeighted: typeof pickWeighted
823
+ pickRandomIndices: typeof pickRandomIndices
824
+ pickGuaranteed: typeof pickGuaranteed
825
+ last: typeof last
826
+ pipe: typeof pipe
827
+ makePipe: typeof makePipe
828
+ sortWeighted: typeof sortWeighted
829
+ pushAll: typeof pushAll
830
+ unshiftAll: typeof unshiftAll
831
+ filterAndRemove: typeof filterAndRemove
832
+ merge: typeof mergeArrays
833
+ empty: typeof empty
834
+ pushToBucket: typeof pushToBucket
835
+ unshiftAndLimit: typeof unshiftAndLimit
836
+ atRolling: typeof atRolling
837
+ group: typeof group
838
+ createOscillator: typeof createOscillator
839
+ organiseWithLimits: typeof organiseWithLimits
840
+ tickPlaybook: typeof tickPlaybook
841
+ getArgument: typeof getArgument
842
+ getBooleanArgument: typeof getBooleanArgument
843
+ getNumberArgument: typeof getNumberArgument
844
+ requireStringArgument: typeof requireStringArgument
845
+ requireNumberArgument: typeof requireNumberArgument
846
+ bringToFront: typeof bringToFront
847
+ bringToFrontInPlace: typeof bringToFrontInPlace
848
+ findInstance: typeof findInstance
849
+ filterInstances: typeof filterInstances
850
+ interleave: typeof interleave
851
+ toggle: typeof toggle
852
+ createHierarchy: typeof createHierarchy
853
+ multicall: typeof multicall
854
+ maxBy: typeof maxBy
855
+ }
783
856
  export declare const System: {
784
- sleepMillis: typeof sleepMillis;
785
- forever: typeof forever;
786
- scheduleMany: typeof scheduleMany;
787
- waitFor: typeof waitFor;
788
- expandError: typeof expandError;
789
- runAndSetInterval: typeof runAndSetInterval;
790
- whereAmI: typeof whereAmI;
791
- };
857
+ sleepMillis: typeof sleepMillis
858
+ forever: typeof forever
859
+ scheduleMany: typeof scheduleMany
860
+ waitFor: typeof waitFor
861
+ expandError: typeof expandError
862
+ runAndSetInterval: typeof runAndSetInterval
863
+ whereAmI: typeof whereAmI
864
+ }
792
865
  export declare const Numbers: {
793
- make: typeof makeNumber;
794
- sum: typeof sum;
795
- average: typeof average;
796
- median: typeof median;
797
- getDistanceFromMidpoint: typeof getDistanceFromMidpoint;
798
- clamp: typeof clamp;
799
- range: typeof range;
800
- interpolate: typeof interpolate;
801
- createSequence: typeof createSequence;
802
- increment: typeof increment;
803
- decrement: typeof decrement;
804
- format: typeof formatNumber;
805
- fromDecimals: typeof fromDecimals;
806
- makeStorage: typeof makeStorage;
807
- asMegabytes: typeof asMegabytes;
808
- convertBytes: typeof convertBytes;
809
- hexToRgb: typeof hexToRgb;
810
- rgbToHex: typeof rgbToHex;
811
- haversineDistanceToMeters: typeof haversineDistanceToMeters;
812
- roundToNearest: typeof roundToNearest;
813
- formatDistance: typeof formatDistance;
814
- triangularNumber: typeof triangularNumber;
815
- searchFloat: typeof searchFloat;
816
- };
866
+ make: typeof makeNumber
867
+ sum: typeof sum
868
+ average: typeof average
869
+ median: typeof median
870
+ getDistanceFromMidpoint: typeof getDistanceFromMidpoint
871
+ clamp: typeof clamp
872
+ range: typeof range
873
+ interpolate: typeof interpolate
874
+ createSequence: typeof createSequence
875
+ increment: typeof increment
876
+ decrement: typeof decrement
877
+ format: typeof formatNumber
878
+ fromDecimals: typeof fromDecimals
879
+ makeStorage: typeof makeStorage
880
+ asMegabytes: typeof asMegabytes
881
+ convertBytes: typeof convertBytes
882
+ hexToRgb: typeof hexToRgb
883
+ rgbToHex: typeof rgbToHex
884
+ haversineDistanceToMeters: typeof haversineDistanceToMeters
885
+ roundToNearest: typeof roundToNearest
886
+ formatDistance: typeof formatDistance
887
+ triangularNumber: typeof triangularNumber
888
+ searchFloat: typeof searchFloat
889
+ }
817
890
  export declare const Promises: {
818
- raceFulfilled: typeof raceFulfilled;
819
- invert: typeof invertPromise;
820
- runInParallelBatches: typeof runInParallelBatches;
821
- };
891
+ raceFulfilled: typeof raceFulfilled
892
+ invert: typeof invertPromise
893
+ runInParallelBatches: typeof runInParallelBatches
894
+ }
822
895
  export declare const Dates: {
823
- getTimestamp: typeof getTimestamp;
824
- getTimeDelta: typeof getTimeDelta;
825
- secondsToHumanTime: typeof secondsToHumanTime;
826
- countCycles: typeof countCycles;
827
- isoDate: typeof isoDate;
828
- throttle: typeof throttle;
829
- timeSince: typeof timeSince;
830
- dateTimeSlug: typeof dateTimeSlug;
831
- unixTimestamp: typeof unixTimestamp;
832
- fromUtcString: typeof fromUtcString;
833
- fromMillis: typeof fromMillis;
834
- getProgress: typeof getProgress;
835
- humanizeTime: typeof humanizeTime;
836
- humanizeProgress: typeof humanizeProgress;
837
- createTimeDigits: typeof createTimeDigits;
838
- mapDayNumber: typeof mapDayNumber;
839
- getDayInfoFromDate: typeof getDayInfoFromDate;
840
- getDayInfoFromDateTimeString: typeof getDayInfoFromDateTimeString;
841
- seconds: typeof seconds;
842
- minutes: typeof minutes;
843
- hours: typeof hours;
844
- days: typeof days;
845
- make: typeof makeDate;
846
- normalizeTime: typeof normalizeTime;
847
- absoluteDays: typeof absoluteDays;
848
- };
896
+ getTimestamp: typeof getTimestamp
897
+ getTimeDelta: typeof getTimeDelta
898
+ secondsToHumanTime: typeof secondsToHumanTime
899
+ countCycles: typeof countCycles
900
+ isoDate: typeof isoDate
901
+ throttle: typeof throttle
902
+ timeSince: typeof timeSince
903
+ dateTimeSlug: typeof dateTimeSlug
904
+ unixTimestamp: typeof unixTimestamp
905
+ fromUtcString: typeof fromUtcString
906
+ fromMillis: typeof fromMillis
907
+ getProgress: typeof getProgress
908
+ humanizeTime: typeof humanizeTime
909
+ humanizeProgress: typeof humanizeProgress
910
+ createTimeDigits: typeof createTimeDigits
911
+ mapDayNumber: typeof mapDayNumber
912
+ getDayInfoFromDate: typeof getDayInfoFromDate
913
+ getDayInfoFromDateTimeString: typeof getDayInfoFromDateTimeString
914
+ seconds: typeof seconds
915
+ minutes: typeof minutes
916
+ hours: typeof hours
917
+ days: typeof days
918
+ make: typeof makeDate
919
+ normalizeTime: typeof normalizeTime
920
+ absoluteDays: typeof absoluteDays
921
+ }
849
922
  export declare const Objects: {
850
- safeParse: typeof safeParse;
851
- deleteDeep: typeof deleteDeep;
852
- getDeep: typeof getDeep;
853
- setDeep: typeof setDeep;
854
- incrementDeep: typeof incrementDeep;
855
- ensureDeep: typeof ensureDeep;
856
- replaceDeep: typeof replaceDeep;
857
- getFirstDeep: typeof getFirstDeep;
858
- deepMergeInPlace: typeof deepMergeInPlace;
859
- deepMerge2: typeof deepMerge2;
860
- deepMerge3: typeof deepMerge3;
861
- mapAllAsync: typeof mapAllAsync;
862
- cloneWithJson: typeof cloneWithJson;
863
- sortObject: typeof sortObject;
864
- sortArray: typeof sortArray;
865
- sortAny: typeof sortAny;
866
- deepEquals: typeof deepEquals;
867
- deepEqualsEvery: typeof deepEqualsEvery;
868
- runOn: typeof runOn;
869
- ifPresent: typeof ifPresent;
870
- zip: typeof zip;
871
- zipSum: typeof zipSum;
872
- removeEmptyArrays: typeof removeEmptyArrays;
873
- removeEmptyValues: typeof removeEmptyValues;
874
- flatten: typeof flatten;
875
- unflatten: typeof unflatten;
876
- match: typeof match;
877
- sort: typeof sortObjectValues;
878
- map: typeof mapObject;
879
- mapIterable: typeof mapIterable;
880
- filterKeys: typeof filterObjectKeys;
881
- filterValues: typeof filterObjectValues;
882
- rethrow: typeof rethrow;
883
- setSomeOnObject: typeof setSomeOnObject;
884
- setSomeDeep: typeof setSomeDeep;
885
- flip: typeof flip;
886
- getAllPermutations: typeof getAllPermutations;
887
- countTruthyValues: typeof countTruthyValues;
888
- transformToArray: typeof transformToArray;
889
- setMulti: typeof setMulti;
890
- incrementMulti: typeof incrementMulti;
891
- createBidirectionalMap: typeof createBidirectionalMap;
892
- createTemporalBidirectionalMap: typeof createTemporalBidirectionalMap;
893
- pushToBidirectionalMap: typeof pushToBidirectionalMap;
894
- unshiftToBidirectionalMap: typeof unshiftToBidirectionalMap;
895
- addToTemporalBidirectionalMap: typeof addToTemporalBidirectionalMap;
896
- getFromTemporalBidirectionalMap: typeof getFromTemporalBidirectionalMap;
897
- createStatefulToggle: typeof createStatefulToggle;
898
- diffKeys: typeof diffKeys;
899
- pickRandomKey: typeof pickRandomKey;
900
- mapRandomKey: typeof mapRandomKey;
901
- fromObjectString: typeof fromObjectString;
902
- toQueryString: typeof toQueryString;
903
- parseQueryString: typeof parseQueryString;
904
- hasKey: typeof hasKey;
905
- selectMax: typeof selectMax;
906
- reposition: typeof reposition;
907
- unwrapSingleKey: typeof unwrapSingleKey;
908
- parseKeyValues: typeof parseKeyValues;
909
- };
923
+ safeParse: typeof safeParse
924
+ deleteDeep: typeof deleteDeep
925
+ getDeep: typeof getDeep
926
+ setDeep: typeof setDeep
927
+ incrementDeep: typeof incrementDeep
928
+ ensureDeep: typeof ensureDeep
929
+ replaceDeep: typeof replaceDeep
930
+ getFirstDeep: typeof getFirstDeep
931
+ deepMergeInPlace: typeof deepMergeInPlace
932
+ deepMerge2: typeof deepMerge2
933
+ deepMerge3: typeof deepMerge3
934
+ mapAllAsync: typeof mapAllAsync
935
+ cloneWithJson: typeof cloneWithJson
936
+ sortObject: typeof sortObject
937
+ sortArray: typeof sortArray
938
+ sortAny: typeof sortAny
939
+ deepEquals: typeof deepEquals
940
+ deepEqualsEvery: typeof deepEqualsEvery
941
+ runOn: typeof runOn
942
+ ifPresent: typeof ifPresent
943
+ zip: typeof zip
944
+ zipSum: typeof zipSum
945
+ removeEmptyArrays: typeof removeEmptyArrays
946
+ removeEmptyValues: typeof removeEmptyValues
947
+ flatten: typeof flatten
948
+ unflatten: typeof unflatten
949
+ match: typeof match
950
+ sort: typeof sortObjectValues
951
+ map: typeof mapObject
952
+ mapIterable: typeof mapIterable
953
+ filterKeys: typeof filterObjectKeys
954
+ filterValues: typeof filterObjectValues
955
+ rethrow: typeof rethrow
956
+ setSomeOnObject: typeof setSomeOnObject
957
+ setSomeDeep: typeof setSomeDeep
958
+ flip: typeof flip
959
+ getAllPermutations: typeof getAllPermutations
960
+ countTruthyValues: typeof countTruthyValues
961
+ transformToArray: typeof transformToArray
962
+ setMulti: typeof setMulti
963
+ incrementMulti: typeof incrementMulti
964
+ createBidirectionalMap: typeof createBidirectionalMap
965
+ createTemporalBidirectionalMap: typeof createTemporalBidirectionalMap
966
+ pushToBidirectionalMap: typeof pushToBidirectionalMap
967
+ unshiftToBidirectionalMap: typeof unshiftToBidirectionalMap
968
+ addToTemporalBidirectionalMap: typeof addToTemporalBidirectionalMap
969
+ getFromTemporalBidirectionalMap: typeof getFromTemporalBidirectionalMap
970
+ createStatefulToggle: typeof createStatefulToggle
971
+ diffKeys: typeof diffKeys
972
+ pickRandomKey: typeof pickRandomKey
973
+ mapRandomKey: typeof mapRandomKey
974
+ fromObjectString: typeof fromObjectString
975
+ toQueryString: typeof toQueryString
976
+ parseQueryString: typeof parseQueryString
977
+ hasKey: typeof hasKey
978
+ selectMax: typeof selectMax
979
+ reposition: typeof reposition
980
+ unwrapSingleKey: typeof unwrapSingleKey
981
+ parseKeyValues: typeof parseKeyValues
982
+ }
910
983
  export declare const Types: {
911
- isFunction: typeof isFunction;
912
- isObject: typeof isObject;
913
- isStrictlyObject: typeof isStrictlyObject;
914
- isEmptyArray: typeof isEmptyArray;
915
- isEmptyObject: typeof isEmptyObject;
916
- isUndefined: typeof isUndefined;
917
- isString: typeof isString;
918
- isNumber: typeof isNumber;
919
- isBoolean: typeof isBoolean;
920
- isDate: typeof isDate;
921
- isBlank: typeof isBlank;
922
- isId: typeof isId;
923
- isIntegerString: typeof isIntegerString;
924
- isHexString: typeof isHexString;
925
- isUrl: typeof isUrl;
926
- isNullable: typeof isNullable;
927
- asString: typeof asString;
928
- asHexString: typeof asHexString;
929
- asSafeString: typeof asSafeString;
930
- asIntegerString: typeof asIntegerString;
931
- asNumber: typeof asNumber;
932
- asFunction: typeof asFunction;
933
- asInteger: typeof asInteger;
934
- asBoolean: typeof asBoolean;
935
- asDate: typeof asDate;
936
- asNullableString: typeof asNullableString;
937
- asEmptiableString: typeof asEmptiableString;
938
- asId: typeof asId;
939
- asTime: typeof asTime;
940
- asArray: typeof asArray;
941
- asObject: typeof asObject;
942
- asNullableObject: typeof asNullableObject;
943
- asStringMap: typeof asStringMap;
944
- asNumericDictionary: typeof asNumericDictionary;
945
- asUrl: typeof asUrl;
946
- asNullable: typeof asNullable;
947
- asOptional: typeof asOptional;
948
- enforceObjectShape: typeof enforceObjectShape;
949
- enforceArrayShape: typeof enforceArrayShape;
950
- isPng: typeof isPng;
951
- isJpg: typeof isJpg;
952
- isWebp: typeof isWebp;
953
- isImage: typeof isImage;
954
- };
984
+ isFunction: typeof isFunction
985
+ isObject: typeof isObject
986
+ isStrictlyObject: typeof isStrictlyObject
987
+ isEmptyArray: typeof isEmptyArray
988
+ isEmptyObject: typeof isEmptyObject
989
+ isUndefined: typeof isUndefined
990
+ isString: typeof isString
991
+ isNumber: typeof isNumber
992
+ isBoolean: typeof isBoolean
993
+ isDate: typeof isDate
994
+ isBlank: typeof isBlank
995
+ isId: typeof isId
996
+ isIntegerString: typeof isIntegerString
997
+ isHexString: typeof isHexString
998
+ isUrl: typeof isUrl
999
+ isNullable: typeof isNullable
1000
+ asString: typeof asString
1001
+ asHexString: typeof asHexString
1002
+ asSafeString: typeof asSafeString
1003
+ asIntegerString: typeof asIntegerString
1004
+ asNumber: typeof asNumber
1005
+ asFunction: typeof asFunction
1006
+ asInteger: typeof asInteger
1007
+ asBoolean: typeof asBoolean
1008
+ asDate: typeof asDate
1009
+ asNullableString: typeof asNullableString
1010
+ asEmptiableString: typeof asEmptiableString
1011
+ asId: typeof asId
1012
+ asTime: typeof asTime
1013
+ asArray: typeof asArray
1014
+ asObject: typeof asObject
1015
+ asNullableObject: typeof asNullableObject
1016
+ asStringMap: typeof asStringMap
1017
+ asNumericDictionary: typeof asNumericDictionary
1018
+ asUrl: typeof asUrl
1019
+ asNullable: typeof asNullable
1020
+ asOptional: typeof asOptional
1021
+ enforceObjectShape: typeof enforceObjectShape
1022
+ enforceArrayShape: typeof enforceArrayShape
1023
+ isPng: typeof isPng
1024
+ isJpg: typeof isJpg
1025
+ isWebp: typeof isWebp
1026
+ isImage: typeof isImage
1027
+ }
955
1028
  export declare const Strings: {
956
- tokenizeByCount: typeof tokenizeByCount;
957
- tokenizeByLength: typeof tokenizeByLength;
958
- searchHex: typeof searchHex;
959
- searchSubstring: typeof searchSubstring;
960
- randomHex: typeof randomHexString;
961
- randomLetter: typeof randomLetterString;
962
- randomAlphanumeric: typeof randomAlphanumericString;
963
- randomRichAscii: typeof randomRichAsciiString;
964
- randomUnicode: typeof randomUnicodeString;
965
- includesAny: typeof includesAny;
966
- slugify: typeof slugify;
967
- normalForm: typeof normalForm;
968
- enumify: typeof enumify;
969
- escapeHtml: typeof escapeHtml;
970
- decodeHtmlEntities: typeof decodeHtmlEntities;
971
- after: typeof after;
972
- afterLast: typeof afterLast;
973
- before: typeof before;
974
- beforeLast: typeof beforeLast;
975
- betweenWide: typeof betweenWide;
976
- betweenNarrow: typeof betweenNarrow;
977
- getPreLine: typeof getPreLine;
978
- containsWord: typeof containsWord;
979
- containsWords: typeof containsWords;
980
- joinUrl: typeof joinUrl;
981
- getFuzzyMatchScore: typeof getFuzzyMatchScore;
982
- sortByFuzzyScore: typeof sortByFuzzyScore;
983
- splitOnce: typeof splitOnce;
984
- splitAll: typeof splitAll;
985
- randomize: typeof randomize;
986
- expand: typeof expand;
987
- shrinkTrim: typeof shrinkTrim;
988
- capitalize: typeof capitalize;
989
- decapitalize: typeof decapitalize;
990
- csvEscape: typeof csvEscape;
991
- parseCsv: typeof parseCsv;
992
- surroundInOut: typeof surroundInOut;
993
- getExtension: typeof getExtension;
994
- getBasename: typeof getBasename;
995
- normalizeEmail: typeof normalizeEmail;
996
- normalizeFilename: typeof normalizeFilename;
997
- parseFilename: typeof parseFilename;
998
- camelToTitle: typeof camelToTitle;
999
- slugToTitle: typeof slugToTitle;
1000
- slugToCamel: typeof slugToCamel;
1001
- joinHumanly: typeof joinHumanly;
1002
- findWeightedPair: typeof findWeightedPair;
1003
- extractBlock: typeof extractBlock;
1004
- extractAllBlocks: typeof extractAllBlocks;
1005
- replaceBlocks: typeof replaceBlocks;
1006
- indexOfEarliest: typeof indexOfEarliest;
1007
- lastIndexOfBefore: typeof lastIndexOfBefore;
1008
- parseHtmlAttributes: typeof parseHtmlAttributes;
1009
- readNextWord: typeof readNextWord;
1010
- readWordsAfterAll: typeof readWordsAfterAll;
1011
- resolveVariables: typeof resolveVariables;
1012
- resolveVariableWithDefaultSyntax: typeof resolveVariableWithDefaultSyntax;
1013
- resolveRemainingVariablesWithDefaults: typeof resolveRemainingVariablesWithDefaults;
1014
- isLetter: typeof isLetter;
1015
- isDigit: typeof isDigit;
1016
- isLetterOrDigit: typeof isLetterOrDigit;
1017
- isValidObjectPathCharacter: typeof isValidObjectPathCharacter;
1018
- insert: typeof insertString;
1019
- indexOfRegex: typeof indexOfRegex;
1020
- allIndexOf: typeof allIndexOf;
1021
- lineMatches: typeof lineMatches;
1022
- linesMatchInOrder: typeof linesMatchInOrder;
1023
- represent: typeof represent;
1024
- resolveMarkdownLinks: typeof resolveMarkdownLinks;
1025
- buildUrl: typeof buildUrl;
1026
- isChinese: typeof isChinese;
1027
- replaceBetweenStrings: typeof replaceBetweenStrings;
1028
- describeMarkdown: typeof describeMarkdown;
1029
- isBalanced: typeof isBalanced;
1030
- textToFormat: typeof textToFormat;
1031
- splitFormatting: typeof splitFormatting;
1032
- splitHashtags: typeof splitHashtags;
1033
- splitUrls: typeof splitUrls;
1034
- route: typeof route;
1035
- explodeReplace: typeof explodeReplace;
1036
- generateVariants: typeof generateVariants;
1037
- replaceWord: typeof replaceWord;
1038
- replacePascalCaseWords: typeof replacePascalCaseWords;
1039
- stripHtml: typeof stripHtml;
1040
- breakLine: typeof breakLine;
1041
- measureTextWidth: typeof measureTextWidth;
1042
- toLines: typeof toLines;
1043
- levenshteinDistance: typeof levenshteinDistance;
1044
- findCommonPrefix: typeof findCommonPrefix;
1045
- findCommonDirectory: typeof findCommonDirectory;
1046
- };
1029
+ tokenizeByCount: typeof tokenizeByCount
1030
+ tokenizeByLength: typeof tokenizeByLength
1031
+ searchHex: typeof searchHex
1032
+ searchSubstring: typeof searchSubstring
1033
+ randomHex: typeof randomHexString
1034
+ randomLetter: typeof randomLetterString
1035
+ randomAlphanumeric: typeof randomAlphanumericString
1036
+ randomRichAscii: typeof randomRichAsciiString
1037
+ randomUnicode: typeof randomUnicodeString
1038
+ includesAny: typeof includesAny
1039
+ slugify: typeof slugify
1040
+ normalForm: typeof normalForm
1041
+ enumify: typeof enumify
1042
+ escapeHtml: typeof escapeHtml
1043
+ decodeHtmlEntities: typeof decodeHtmlEntities
1044
+ after: typeof after
1045
+ afterLast: typeof afterLast
1046
+ before: typeof before
1047
+ beforeLast: typeof beforeLast
1048
+ betweenWide: typeof betweenWide
1049
+ betweenNarrow: typeof betweenNarrow
1050
+ getPreLine: typeof getPreLine
1051
+ containsWord: typeof containsWord
1052
+ containsWords: typeof containsWords
1053
+ joinUrl: typeof joinUrl
1054
+ getFuzzyMatchScore: typeof getFuzzyMatchScore
1055
+ sortByFuzzyScore: typeof sortByFuzzyScore
1056
+ splitOnce: typeof splitOnce
1057
+ splitAll: typeof splitAll
1058
+ randomize: typeof randomize
1059
+ expand: typeof expand
1060
+ shrinkTrim: typeof shrinkTrim
1061
+ capitalize: typeof capitalize
1062
+ decapitalize: typeof decapitalize
1063
+ csvEscape: typeof csvEscape
1064
+ parseCsv: typeof parseCsv
1065
+ surroundInOut: typeof surroundInOut
1066
+ getExtension: typeof getExtension
1067
+ getBasename: typeof getBasename
1068
+ normalizeEmail: typeof normalizeEmail
1069
+ normalizeFilename: typeof normalizeFilename
1070
+ parseFilename: typeof parseFilename
1071
+ camelToTitle: typeof camelToTitle
1072
+ slugToTitle: typeof slugToTitle
1073
+ slugToCamel: typeof slugToCamel
1074
+ joinHumanly: typeof joinHumanly
1075
+ findWeightedPair: typeof findWeightedPair
1076
+ extractBlock: typeof extractBlock
1077
+ extractAllBlocks: typeof extractAllBlocks
1078
+ replaceBlocks: typeof replaceBlocks
1079
+ indexOfEarliest: typeof indexOfEarliest
1080
+ lastIndexOfBefore: typeof lastIndexOfBefore
1081
+ parseHtmlAttributes: typeof parseHtmlAttributes
1082
+ readNextWord: typeof readNextWord
1083
+ readWordsAfterAll: typeof readWordsAfterAll
1084
+ resolveVariables: typeof resolveVariables
1085
+ resolveVariableWithDefaultSyntax: typeof resolveVariableWithDefaultSyntax
1086
+ resolveRemainingVariablesWithDefaults: typeof resolveRemainingVariablesWithDefaults
1087
+ isLetter: typeof isLetter
1088
+ isDigit: typeof isDigit
1089
+ isLetterOrDigit: typeof isLetterOrDigit
1090
+ isValidObjectPathCharacter: typeof isValidObjectPathCharacter
1091
+ insert: typeof insertString
1092
+ indexOfRegex: typeof indexOfRegex
1093
+ allIndexOf: typeof allIndexOf
1094
+ lineMatches: typeof lineMatches
1095
+ linesMatchInOrder: typeof linesMatchInOrder
1096
+ represent: typeof represent
1097
+ resolveMarkdownLinks: typeof resolveMarkdownLinks
1098
+ buildUrl: typeof buildUrl
1099
+ isChinese: typeof isChinese
1100
+ replaceBetweenStrings: typeof replaceBetweenStrings
1101
+ describeMarkdown: typeof describeMarkdown
1102
+ isBalanced: typeof isBalanced
1103
+ textToFormat: typeof textToFormat
1104
+ splitFormatting: typeof splitFormatting
1105
+ splitHashtags: typeof splitHashtags
1106
+ splitUrls: typeof splitUrls
1107
+ route: typeof route
1108
+ explodeReplace: typeof explodeReplace
1109
+ generateVariants: typeof generateVariants
1110
+ replaceWord: typeof replaceWord
1111
+ replacePascalCaseWords: typeof replacePascalCaseWords
1112
+ stripHtml: typeof stripHtml
1113
+ breakLine: typeof breakLine
1114
+ measureTextWidth: typeof measureTextWidth
1115
+ toLines: typeof toLines
1116
+ levenshteinDistance: typeof levenshteinDistance
1117
+ findCommonPrefix: typeof findCommonPrefix
1118
+ findCommonDirectory: typeof findCommonDirectory
1119
+ }
1047
1120
  export declare const Assertions: {
1048
- asEqual: typeof asEqual;
1049
- asTrue: typeof asTrue;
1050
- asTruthy: typeof asTruthy;
1051
- asFalse: typeof asFalse;
1052
- asFalsy: typeof asFalsy;
1053
- asEither: typeof asEither;
1054
- };
1121
+ asEqual: typeof asEqual
1122
+ asTrue: typeof asTrue
1123
+ asTruthy: typeof asTruthy
1124
+ asFalse: typeof asFalse
1125
+ asFalsy: typeof asFalsy
1126
+ asEither: typeof asEither
1127
+ }
1055
1128
  export declare const Cache: {
1056
- get: typeof getCached;
1057
- invalidate: typeof invalidateCache;
1058
- };
1129
+ get: typeof getCached
1130
+ invalidate: typeof invalidateCache
1131
+ }
1059
1132
  export declare const Vector: {
1060
- addPoint: typeof addPoint;
1061
- subtractPoint: typeof subtractPoint;
1062
- multiplyPoint: typeof multiplyPoint;
1063
- normalizePoint: typeof normalizePoint;
1064
- pushPoint: typeof pushPoint;
1065
- filterCoordinates: typeof filterCoordinates;
1066
- findCorners: typeof findCorners;
1067
- findLines: typeof findLines;
1068
- raycast: typeof raycast;
1069
- raycastCircle: typeof raycastCircle;
1070
- getLineIntersectionPoint: typeof getLineIntersectionPoint;
1071
- };
1072
- export {};
1133
+ addPoint: typeof addPoint
1134
+ subtractPoint: typeof subtractPoint
1135
+ multiplyPoint: typeof multiplyPoint
1136
+ normalizePoint: typeof normalizePoint
1137
+ pushPoint: typeof pushPoint
1138
+ filterCoordinates: typeof filterCoordinates
1139
+ findCorners: typeof findCorners
1140
+ findLines: typeof findLines
1141
+ raycast: typeof raycast
1142
+ raycastCircle: typeof raycastCircle
1143
+ getLineIntersectionPoint: typeof getLineIntersectionPoint
1144
+ }
1145
+ export {}