cafe-utility 33.8.0 → 33.10.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 +6 -0
- package/index.js +470 -455
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -468,6 +468,7 @@ declare function makeStorage(numberWithUnit: string, conversionMultiplier?: numb
|
|
|
468
468
|
declare function getPreLine(string: string): string
|
|
469
469
|
declare function getCached<T>(key: string, ttlMillis: number, handler: () => Promise<T>): Promise<T>
|
|
470
470
|
declare function deleteFromCache(key: string): void
|
|
471
|
+
declare function clearCache(): void
|
|
471
472
|
declare function deleteExpiredFromCache(): void
|
|
472
473
|
declare function cacheSize(): number
|
|
473
474
|
declare function joinUrl(parts: unknown[], relativeToFile?: boolean): string
|
|
@@ -594,6 +595,8 @@ interface Newable<T> extends Function {
|
|
|
594
595
|
}
|
|
595
596
|
declare function multicall(functions: (() => void)[]): () => void
|
|
596
597
|
declare function maxBy<T>(array: T[], fn: (item: T) => number): T
|
|
598
|
+
declare function minBy<T>(array: T[], fn: (item: T) => number): T
|
|
599
|
+
declare function allArrayIndexOf<T>(array: T[], predicate: (item: T) => boolean): number[]
|
|
597
600
|
declare function findInstance<T, K extends T>(array: T[], type: Newable<K>): Optional<K>
|
|
598
601
|
declare function filterInstances<T, K extends T>(array: T[], type: Newable<K>): K[]
|
|
599
602
|
declare function interleave<T, K>(arrayA: T[], arrayB: K[]): (T | K)[]
|
|
@@ -917,6 +920,8 @@ export declare const Arrays: {
|
|
|
917
920
|
createHierarchy: typeof createHierarchy
|
|
918
921
|
multicall: typeof multicall
|
|
919
922
|
maxBy: typeof maxBy
|
|
923
|
+
minBy: typeof minBy
|
|
924
|
+
allIndexOf: typeof allArrayIndexOf
|
|
920
925
|
}
|
|
921
926
|
export declare const System: {
|
|
922
927
|
sleepMillis: typeof sleepMillis
|
|
@@ -1202,6 +1207,7 @@ export declare const Cache: {
|
|
|
1202
1207
|
delete: typeof deleteFromCache
|
|
1203
1208
|
deleteExpired: typeof deleteExpiredFromCache
|
|
1204
1209
|
size: typeof cacheSize
|
|
1210
|
+
clear: typeof clearCache
|
|
1205
1211
|
}
|
|
1206
1212
|
export declare const Vector: {
|
|
1207
1213
|
addPoint: typeof addPoint
|