/** * Per-(language, version) content-decoding helpers shared by the two * content-bearing reverse-projection families: pages (`project-pages.ts`) * and content items (`project-content.ts`). Both fan a per-language read * (`getItemPerLanguageBatch`) plus a historic per-version read * (`getItemAtVersionsBatch`) into one round trip each, then decode the * resulting snapshots into the recipe's `{ fieldName → ContentFieldValue }` * shape bucketed by storage axis. * * See `../read-current.ts` for the module-level contract. */ import type { AuthoringApiClient, RemoteItem } from "../../api/client.js"; import type { ContentFieldValue } from "../../schema/recipe.js"; import { type GuidHandleIndex, type TemplateFieldShapes } from "./helpers.js"; /** * Decode the per-(lang, version) authorable field values for one snapshot * into the recipe's `{ fieldName → ContentFieldValue }` shape. Fields whose * name doesn't resolve to a known shape (template hasn't been walked, or * a non-template field) are skipped — we'd be guessing the shape. */ export declare const decodeVersionedFieldsOf: (snapshot: RemoteItem, shapes: TemplateFieldShapes, guidIndex: GuidHandleIndex) => Record; /** * Decode the item-level `storage: shared` fields. Aggregated across pass 1's * results — shared values are language-agnostic, so the first occurrence * wins. (`storage: unversioned` is treated as `versioned` from the recipe's * perspective: it lives per-language and round-trips as a translation/version * field, not a shared one.) */ export declare const collectSharedFields: (populated: ReadonlyArray<{ item: RemoteItem | null; }>, shapes: TemplateFieldShapes, guidIndex: GuidHandleIndex) => Record; /** Read the per-version `__Created` date and decode to ISO datetime. */ export declare const dateOfSnapshot: (snapshot: RemoteItem) => string | undefined; /** * Per-(language, version) historic snapshot fan-out. Requests every version * below each language's latest (the latest came back in pass 1) in a single * batched round trip, then indexes the results by `language|version`. */ export declare const fetchHistoricSnapshots: (item: RemoteItem, populated: ReadonlyArray<{ language: string; versions: number[]; }>, client: AuthoringApiClient) => Promise>;