/** * @file Fetch and parse an OCI/Docker image manifest. `getManifest` issues * `GET /v2//manifests/` with a bearer token and an * `Accept` set covering BOTH the OCI (`application/vnd.oci.image.manifest. * v1+json`, index `...image.index.v1+json`) and Docker v2 * (`...distribution.manifest.v2+json`, list `...manifest.list.v2+json`) media * types, returning the parsed body plus its canonical * `Docker-Content-Digest`. Pure helpers (`parseManifest`, `isManifestIndex`, * `pickPlatformManifestDigest`) carry the multi-arch logic so a manifest * index can be resolved to a concrete platform manifest; single-artifact * (one-layer) pulls stay simple. */ import type { OciHttpOptions, OciManifest, OciManifestResult, OciPlatform } from './types.js'; export declare const OCI_MANIFEST_MEDIA_TYPE = "application/vnd.oci.image.manifest.v1+json"; export declare const OCI_INDEX_MEDIA_TYPE = "application/vnd.oci.image.index.v1+json"; export declare const DOCKER_MANIFEST_MEDIA_TYPE = "application/vnd.docker.distribution.manifest.v2+json"; export declare const DOCKER_MANIFEST_LIST_MEDIA_TYPE = "application/vnd.docker.distribution.manifest.list.v2+json"; /** * The `Accept` header offered on a manifest GET, covering single manifests and * multi-arch indexes in both the OCI and Docker v2 media-type families. */ export declare const MANIFEST_ACCEPT: string; /** * Build the manifest URL for a repository reference, either a tag or a digest. */ export declare function buildManifestUrl(registry: string, repository: string, reference: string): string; /** * Fetch one manifest by tag or digest reference. Returns the parsed manifest, * its canonical `Docker-Content-Digest` that a caller pins, and the served * media type. Fails loud on a non-2xx response or an unparseable body. */ export declare function getManifest(registry: string, repository: string, reference: string, token: string, options: OciHttpOptions): Promise; /** * Return `true` when a manifest body is a multi-arch index / list rather than a * single image manifest. */ export declare function isManifestIndex(manifest: OciManifest): boolean; /** * Parse a raw manifest JSON response into a typed `OciManifest`. Returns * `undefined` when the input is not an object. */ export declare function parseManifest(raw: unknown): OciManifest | undefined; /** * Choose a concrete platform manifest digest from an index. Prefers an explicit * `platform` match (default `linux/amd64`), then any real (non-`unknown`) * platform, then the first entry. Returns `undefined` for an empty index. */ export declare function pickPlatformManifestDigest(manifest: OciManifest, platform?: OciPlatform | undefined): string | undefined;