mirror of
https://github.com/arthurfiorette/axios-cache-interceptor.git
synced 2025-12-08 17:36:16 +00:00
refactor: prefer unknown instead of any
This commit is contained in:
parent
38a5ecd365
commit
d0b0e2fb6c
2
src/cache/cache.ts
vendored
2
src/cache/cache.ts
vendored
@ -10,7 +10,7 @@ import type { CacheAxiosResponse, CacheRequestConfig } from './axios';
|
||||
* @template R The type returned by this response
|
||||
* @template D The type for the request body
|
||||
*/
|
||||
export type CacheProperties<R = any, D = any> = {
|
||||
export type CacheProperties<R = unknown, D = unknown> = {
|
||||
/**
|
||||
* The time until the cached value is expired in milliseconds.
|
||||
*
|
||||
|
||||
@ -5,12 +5,12 @@ import type {
|
||||
StorageValue
|
||||
} from '../storage/types';
|
||||
|
||||
export type CachePredicate<R = any, D = any> = Exclude<
|
||||
export type CachePredicate<R = unknown, D = unknown> = Exclude<
|
||||
CachePredicateObject<R, D> | CachePredicateObject<R, D>['responseMatch'],
|
||||
undefined
|
||||
>;
|
||||
|
||||
export type CachePredicateObject<R = any, D = any> = {
|
||||
export type CachePredicateObject<R = unknown, D = unknown> = {
|
||||
/** Matches if this function returned true. */
|
||||
statusCheck?: (status: number) => boolean;
|
||||
|
||||
@ -29,7 +29,7 @@ export type CachePredicateObject<R = any, D = any> = {
|
||||
};
|
||||
|
||||
/** A simple function that receives a cache request config and should return a string id for it. */
|
||||
export type KeyGenerator = <R = any, D = any>(
|
||||
export type KeyGenerator = <R = unknown, D = unknown>(
|
||||
options: CacheRequestConfig<R, D>
|
||||
) => string;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user