import type { ReadonlyDeep } from "type-fest"; import type { CacheSpec, SpecForId } from "../types/00_CacheSpec.js"; import type { AnyParams, AnyValidators, ConsumerRequest, NormalizedVary, ProducerResultResource, RequestPairedProducerResult, Vary } from "../types/index.js"; import type { MakeKeysOptional } from "../types/utils.js"; export type PartialConsumerRequest = ReadonlyDeep, "directives" | "params">>; /** * Replace undefined params + directives w/ empty objects */ export declare function completeRequest(req: PartialConsumerRequest): ReadonlyDeep>; /** * Splits a `RequestPairedProducerResult` into a flat list of resources to be * stored: the primary resource (with the request's id stamped on) followed by * any supplemental resources. * * The returned array contains entries for all spec variants in `Spec`, since * supplemental resources may correspond to any variant -- not just the one * matching the request's id. * * The user-facing (id, content) correlation backstop comes from the * `RequestPairedProducer` *signature* (which, in multi-id-type * mode, makes the producer generic over the request's specific id). This * helper's job is just to build the runtime store input. TS can't see * through the conditional/distributive types involved here, so the * construction needs an unsafe cast; the cast is sound because we don't * synthesize id/content -- we just spread fields the producer already * paired correctly. */ export declare function requestPairedProducerResultToResources(result: RequestPairedProducerResult, reqId: Id): ProducerResultResource[]; /** * Builds a normalized `ProducerResultResource` for the primary resource of a * `RequestPairedProducerResult` (i.e., excluding supplemental resources). The * id is taken from the request, and the result's content is narrowed to the * spec variants compatible with that id. * * Like {@link requestPairedProducerResultToResources}, this takes `Id extends * Spec["id"]` so the construction can be expressed against the * spec-narrowed `ProducerResultResource, ...>`. The * actual cast is unsafe (TS can't follow the conditional types), but is * sound because the runtime data is just spread/forwarded from the * producer's already-correlated output. */ export declare function primaryNormalizedResultResourceFromRequestPairedProducerResult(normalizeVaryBound: (vary: Vary) => NormalizedVary, result: RequestPairedProducerResult, reqId: Id): import("../types/06_Normalization.js").NormalizedProducerResultResource, Validators, Params>; //# sourceMappingURL=requestPairedProducerUtils.d.ts.map