Birb / Cache
Class: Cache<K, T>
Type parameters
Name | Type |
---|---|
K | string |
T | any |
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new Cache<K
, T
>(client
)
Type parameters
Name | Type |
---|---|
K | string |
T | any |
Parameters
Name | Type |
---|---|
client | Birb |
Defined in
src/classes/Cache.ts:14
Properties
client
• client: Birb
The Birb client.
Defined in
src/classes/Cache.ts:8
Methods
entries
▸ entries(): IterableIterator
<[K
, T
]>
Returns
IterableIterator
<[K
, T
]>
Defined in
src/classes/Cache.ts:61
filter
▸ filter(fn
): Pair
<K
, T
>[]
Parameters
Name | Type |
---|---|
fn | (e : Pair <K , T >) => boolean |
Returns
Pair
<K
, T
>[]
Defined in
src/classes/Cache.ts:27
find
▸ find(fn
): undefined
| Pair
<K
, T
>
Parameters
Name | Type |
---|---|
fn | (e : Pair <K , T >) => boolean |
Returns
undefined
| Pair
<K
, T
>
Defined in
src/classes/Cache.ts:23
get
▸ get(key
): undefined
| T
Parameters
Name | Type |
---|---|
key | K |
Returns
undefined
| T
Defined in
src/classes/Cache.ts:19
has
▸ has(key
): boolean
Parameters
Name | Type |
---|---|
key | K |
Returns
boolean
Defined in
src/classes/Cache.ts:35
keys
▸ keys(): IterableIterator
<K
>
Returns
IterableIterator
<K
>
Defined in
src/classes/Cache.ts:53
remove
▸ remove(key
): void
Parameters
Name | Type |
---|---|
key | K |
Returns
void
Defined in
src/classes/Cache.ts:39
set
▸ set(key
, value
): void
Parameters
Name | Type |
---|---|
key | K |
value | T |
Returns
void
Defined in
src/classes/Cache.ts:31
size
▸ size(): number
Returns
number
Defined in
src/classes/Cache.ts:49
take
▸ take(key
): undefined
| T
Parameters
Name | Type |
---|---|
key | K |
Returns
undefined
| T
Defined in
src/classes/Cache.ts:43
toArray
▸ toArray(): Pair
<K
, T
>[]
Returns
Pair
<K
, T
>[]
Defined in
src/classes/Cache.ts:65
values
▸ values(): IterableIterator
<T
>
Returns
IterableIterator
<T
>
Defined in
src/classes/Cache.ts:57