Skip to content

Commit 6e64931

Browse files
committed
fix: ts errors
1 parent 6204e95 commit 6e64931

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/core/request/const.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import config from 'config';
1111
import { memoize } from 'core/promise/sync';
1212
import { toQueryString } from 'core/url';
1313

14-
import { Cache, RestrictedCache, NeverCache, AbstractCache } from 'core/cache';
14+
import { Cache, RestrictedCache, NeverCache, AbstractCache, AbstractAsyncCache } from 'core/cache';
1515
import type { AsyncStorage } from 'core/kv-storage';
1616

1717
import engine from 'core/request/engines';
@@ -44,7 +44,9 @@ export const
4444
caches = new Set<AbstractCache>(),
4545
pendingCache = new Cache<RequestResponse>();
4646

47-
export const cache: Record<Exclude<CacheStrategy, AbstractCache | Promise<AbstractCache>>, AbstractCache> = {
47+
export const cache: Record<Exclude<
48+
CacheStrategy, AbstractCache | Promise<AbstractCache> | AbstractAsyncCache
49+
>, AbstractCache> = {
4850
queue: new RestrictedCache(),
4951
forever: new Cache(),
5052
never: new NeverCache()

src/core/request/interface.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import type { EventEmitter2 as EventEmitter } from 'eventemitter2';
10-
import type { AbstractCache } from 'core/cache';
10+
import type { AbstractAsyncCache, AbstractCache } from 'core/cache';
1111

1212
import type Data from 'core/data';
1313
import type { ModelMethod } from 'core/data';
@@ -43,6 +43,7 @@ export type CacheStrategy =
4343
'forever' |
4444
'never' |
4545
AbstractCache |
46+
AbstractAsyncCache |
4647
Promise<AbstractCache>;
4748

4849
export type CacheType =

0 commit comments

Comments
 (0)