-
-
Notifications
You must be signed in to change notification settings - Fork 341
/
expose.ts
32 lines (32 loc) · 794 Bytes
/
expose.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import LRUCache from '../../index'
export const exposeStatics = (LRU: typeof LRUCache) => {
return LRU as unknown as {
AbortController: any
AbortSignal: any
}
}
export const expose = (cache: LRUCache<any, any>) => {
return cache as unknown as {
isBackgroundFetch: (v: any) => boolean
backgroundFetch: (
v: any,
index: number,
options: { [k: string]: any },
context?: any
) => Promise<any>
valList: any[]
keyList: any[]
free: number[]
keyMap: Map<any, number>
starts: number[]
ttls: number[]
sizes: number[]
indexes: (...a: any[]) => Iterable<number>
rindexes: (...a: any[]) => Iterable<number>
next: number[]
prev: number[]
head: number
tail: number
moveToTail: (i: number) => void
}
}