import { type FactoryWithInput, type Getter } from './getter'; /** * Getter that returns a cached value. */ export type CachedGetter = Getter & { /** * Sets the value in the cache. * * @param value */ set(value: T): void; /** * Resets/clears the cache. */ reset(): void; /** * Re-initializes the getter and reloads the value from the source. */ init(): void; }; /** * A cached factory that stores the result of the first call and returns it on subsequent calls. * Supports optional input arguments for the initial factory call. */ export type CachedFactoryWithInput = CachedGetter & FactoryWithInput & { /** * Re-initializes the cache using the factory function. * * @param input */ init(input?: A): void; }; /** * Creates a CachedGetter from the input factory function. * The value is retrieved once on first call and cached permanently. * Use `reset()` to clear the cache and `init()` to reload. * * @param getter - the factory or getter function whose result will be cached * @returns A CachedFactoryWithInput that caches the first result */ export declare function cachedGetter(getter: Getter): CachedFactoryWithInput; export declare function cachedGetter(factory: FactoryWithInput): CachedFactoryWithInput;