Axios Cache Interceptor Types (util/types.ts)

axios-cache-interceptor · src/util/types.ts · typescript · MIT
infra, integration, database, lang:typescript

TypeScript definitions and type guards for configuring request caching, predicates, and server-client location contexts in Axios. Use when customizing HTTP cache behavior.

// Source: https://github.com/arthurfiorette/axios-cache-interceptor | License: MIT | Copyright 2021-present Arthur Fiorette & Contributors
// Provided via justclaw.it.com; keep this notice with the code.
import type { CacheAxiosResponse, CacheRequestConfig } from '../cache/axios.ts';
import type {
  CachedResponseMeta,
  CachedStorageValue,
  LoadingStorageValue,
  StorageValue
} from '../storage/types.ts';

export type CachePredicate<R = unknown, D = unknown> = NonNullable<
  CachePredicateObject<R, D> | CachePredicateObject<R, D>['responseMatch']
>;

/**
 * A hint to the library about where the axios instance is being used.
 *
 * Used to make decisions like whether to handle `Cache-Control: private`.
 *
 * @default typeof window === 'undefined' ? 'server' : 'client'
 * @see https://axio

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key