import type { ReadonlyDeep } from "type-fest"; import { type AnyParams, type AnyValidators, type CacheSpec, type ConsumerDirectives } from "../index.js"; import type { NormalizedProducerResultResource } from "../types/06_Normalization.js"; type AnyNormalizedProducerResultResource = NormalizedProducerResultResource; /** * Returns the moment when the resource's value was generated _by the origin_. * This may be different from the date that the NormalizedProducerResultResource * was created, if the NormalizedProducerResultResource was created by a cache * that had already been holding the origin's result for some time. */ export declare function birthDate(it: AnyNormalizedProducerResultResource): Date; /** * Returns the amount of time between the time when the resource was generated * _at the origin_ and the provided date. */ export declare function age(it: AnyNormalizedProducerResultResource, at: Date): number; /** * How many seconds remain until the entry could not even potentially satisfy * an incoming request. This will often be infinite, because the consumer can * request arbitrarily stale entries (via maxStale). */ export declare function potentiallyUsefulFor(it: AnyNormalizedProducerResultResource, at: Date): number; /** * Returns whether the entry has data that can be used for revalidation. */ export declare function isValidatable(it: AnyNormalizedProducerResultResource): boolean; export declare function isFresh(it: AnyNormalizedProducerResultResource, at: Date): boolean; export declare const EntryClassification: { readonly Usable: "Usable"; readonly UsableWhileRevalidate: "UsableWhileRevalidate"; readonly UsableIfError: "UsableIfError"; readonly Unusable: "Unusable"; }; /** * Returns a results applicability/usability, for a set of consumer directives, * and at a given date, based on its stored age etc. * * Note: this does **not** factor in the entry's `id` or `vary` value; its * assumed that the entry is a valid candidate for the request's params. */ export declare function classify(entry: AnyNormalizedProducerResultResource, consumerDirs: ReadonlyDeep, at: Date): "Usable" | "UsableWhileRevalidate" | "UsableIfError" | "Unusable"; export {}; //# sourceMappingURL=normalizedProducerResultResourceHelpers.d.ts.map