import { TrustResolutionMetadata, TrustErrorCode, TrustResolutionCache, TrustResolution } from '../types.js'; /** * Builds metadata for a trust resolution process. * * If no error code is provided, the status is set to `RESOLVED`. * Otherwise, it is set to `ERROR`, including the error details. * * @param errorCode - Optional error code indicating a trust validation failure. * @param errorMessage - Optional descriptive error message. * @returns The metadata containing the resolution status and error details if applicable. */ export declare function buildMetadata(errorCode: TrustErrorCode, errorMessage: string): TrustResolutionMetadata; /** * Fetches and returns JSON data from a given URL. * * Performs an HTTP request and attempts to parse the response as JSON. * If the request fails, it throws a `TrustError` with relevant details. * * @template T - The expected structure of the JSON response. * @param url - The URL to fetch the data from. * @returns A promise resolving to the parsed JSON data. * @throws {TrustError} If the HTTP request fails. */ export declare function fetchJson(url: string): Promise; /** * Fetches and returns the raw text content from a given URL. * * This is useful when byte-level integrity of the response matters, * such as when verifying SRI digests against the original content. * * @param url - The URL to fetch the data from. * @returns A promise resolving to the raw response text. * @throws {TrustError} If the HTTP request fails. */ export declare function fetchText(url: string): Promise; /** * In-memory implementation of `TrustResolutionCache` backed by a `Map`. * * Useful for avoiding redundant resolutions within the same process lifetime. * For persistent or distributed caching, provide your own `TrustResolutionCache` implementation (e.g. Redis). */ export declare class InMemoryCache implements TrustResolutionCache> { private map; private ttlMs; constructor(ttlMs?: number); get(key: string): Promise | undefined; set(key: string, value: Promise): void; delete(key: string): void; clear(): void; }