UNPKG

@daiso-tech/core

Version:

The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.

55 lines (54 loc) 1.73 kB
/** * @module Cache */ import { type Key } from "../../namespace/_module.js"; /** * The error is thrown when a key is not found * * IMPORT_PATH: `"@daiso-tech/core/cache/contracts"` * @group Errors */ export declare class KeyNotFoundCacheError extends Error { static create(key: Key, cause?: unknown): KeyNotFoundCacheError; /** * Note: Do not instantiate `KeyNotFoundCacheError` directly via the constructor. Use the static `create()` factory method instead. * The constructor remains public only to maintain compatibility with errorPolicy types and prevent type errors. * @internal */ constructor(message: string, cause?: unknown); } /** * The error is thrown when a key is not found * * IMPORT_PATH: `"@daiso-tech/core/cache/contracts"` * @group Errors */ export declare class KeyExistsCacheError extends Error { static create(key: Key, cause?: unknown): KeyExistsCacheError; /** * Note: Do not instantiate `KeyExistsCacheError` directly via the constructor. Use the static `create()` factory method instead. * The constructor remains public only to maintain compatibility with errorPolicy types and prevent type errors. * @internal */ constructor(message: string, cause?: unknown); } /** * * IMPORT_PATH: `"@daiso-tech/core/cache/contracts"` * @group Errors */ export declare const CACHE_ERRORS: { readonly KeyNotFound: typeof KeyNotFoundCacheError; }; /** * * IMPORT_PATH: `"@daiso-tech/core/cache/contracts"` * @group Errors */ export type AllCacheErrors = KeyNotFoundCacheError; /** * * IMPORT_PATH: `"@daiso-tech/core/cache/contracts"` * @group Errors */ export declare function isCacheError(value: unknown): value is AllCacheErrors;