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.
- package/index.d.ts +1067 -994
- package/index.js +1858 -2693
- 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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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>(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
declare function
|
|
46
|
-
declare function
|
|
47
|
-
declare function
|
|
48
|
-
declare function
|
|
49
|
-
declare function
|
|
50
|
-
declare function
|
|
51
|
-
declare function
|
|
52
|
-
declare function
|
|
53
|
-
declare function
|
|
54
|
-
declare function
|
|
55
|
-
declare function
|
|
56
|
-
declare function
|
|
57
|
-
declare function
|
|
58
|
-
declare function
|
|
59
|
-
declare function
|
|
60
|
-
declare function
|
|
61
|
-
declare function
|
|
62
|
-
declare function
|
|
63
|
-
declare function
|
|
64
|
-
declare function
|
|
65
|
-
declare function
|
|
66
|
-
declare function
|
|
67
|
-
declare function
|
|
68
|
-
declare function
|
|
69
|
-
declare function
|
|
70
|
-
declare function
|
|
71
|
-
declare function
|
|
72
|
-
declare function
|
|
73
|
-
declare function
|
|
74
|
-
declare function
|
|
75
|
-
declare function
|
|
76
|
-
declare function
|
|
77
|
-
declare function
|
|
78
|
-
declare function
|
|
79
|
-
declare function
|
|
80
|
-
declare function
|
|
81
|
-
declare function
|
|
82
|
-
declare function
|
|
83
|
-
declare function
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
declare function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
declare function
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
declare function
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
declare function
|
|
156
|
-
declare function
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
declare function
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
declare function
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
declare function
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
declare function
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
declare function
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
declare function
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
declare function
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
declare function
|
|
205
|
-
declare function
|
|
206
|
-
|
|
207
|
-
|
|
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
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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
|
-
|
|
226
|
-
|
|
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
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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
|
-
|
|
248
|
-
|
|
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
|
-
|
|
264
|
-
|
|
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
|
-
|
|
273
|
-
|
|
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
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
declare function
|
|
305
|
-
declare function
|
|
306
|
-
declare function
|
|
307
|
-
declare function
|
|
308
|
-
declare function
|
|
309
|
-
declare function
|
|
310
|
-
declare function
|
|
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
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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
|
-
|
|
325
|
-
|
|
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
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
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
|
-
|
|
338
|
-
|
|
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
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
declare function countCycles(
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
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
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
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
|
-
|
|
371
|
-
|
|
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
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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
|
-
|
|
404
|
-
}
|
|
473
|
+
next: () => number
|
|
474
|
+
}
|
|
405
475
|
declare function createOscillator<T>(values: T[]): {
|
|
406
|
-
|
|
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(
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
declare function
|
|
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
|
-
|
|
420
|
-
|
|
421
|
-
|
|
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
|
-
|
|
462
|
-
|
|
534
|
+
validUntil: number
|
|
535
|
+
data: T
|
|
463
536
|
}
|
|
464
537
|
interface BidirectionalMap<K, T> {
|
|
465
|
-
|
|
466
|
-
|
|
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
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
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
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
563
|
+
private readonly supplier
|
|
564
|
+
private value
|
|
565
|
+
constructor(supplier: () => T)
|
|
566
|
+
get(): T
|
|
494
567
|
}
|
|
495
568
|
export declare class AsyncLazy<T> {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
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
|
-
|
|
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
|
-
|
|
512
|
-
|
|
513
|
-
|
|
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
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
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
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
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
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
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
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
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
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
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
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
}[]
|
|
681
|
+
ttl: number
|
|
682
|
+
ttlMax?: number
|
|
683
|
+
data: T
|
|
684
|
+
}[]
|
|
612
685
|
declare function tickPlaybook<T>(playbook: Playbook<T>): {
|
|
613
|
-
|
|
614
|
-
|
|
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
|
-
|
|
625
|
-
|
|
626
|
-
}
|
|
697
|
+
x: number
|
|
698
|
+
y: number
|
|
699
|
+
}
|
|
627
700
|
type Line = {
|
|
628
|
-
|
|
629
|
-
|
|
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
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
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
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
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
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
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
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
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
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
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
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
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
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
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
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
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
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
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
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
}
|
|
891
|
+
raceFulfilled: typeof raceFulfilled
|
|
892
|
+
invert: typeof invertPromise
|
|
893
|
+
runInParallelBatches: typeof runInParallelBatches
|
|
894
|
+
}
|
|
822
895
|
export declare const Dates: {
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
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
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
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
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
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
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
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
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
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
|
-
|
|
1057
|
-
|
|
1058
|
-
}
|
|
1129
|
+
get: typeof getCached
|
|
1130
|
+
invalidate: typeof invalidateCache
|
|
1131
|
+
}
|
|
1059
1132
|
export declare const Vector: {
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
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 {}
|