import { Manifest, ManifestStore } from '@contentauth/c2pa-types'; import { C2pa } from './c2pa.js'; import { Context } from '@contentauth/c2pa-utilities'; export declare const MAX_SIZE_IN_BYTES: number; /** * The `Reader` class supports reading C2PA data out of an asset. * * @example Getting an asset's active manifest: * ``` * const reader = await Reader.fromBlob(c2pa, blob.type, blob); * const activeManifest = await reader.activeManifest(); * ``` */ export declare class Reader { #private; private constructor(); /** * Create a {@link Reader} from an asset's format and a blob of its bytes. * * @param c2pa The `C2pa` instance (from {@link createC2pa}) to create this reader on. * @param format Asset format (MIME type or extension), typically `blob.type`. If omitted * or empty, the native library will attempt to detect the format from the asset's bytes instead. * Always provide the format if known, and only omit this when the caller has no way to determine * the asset's format otherwise. * @param blob Blob of asset bytes. * @param context Optional `Context` configuring this reader's behavior. * @returns A {@link Reader} object or null if no C2PA metadata was found. * @throws If the asset is too large, or if the `Context` sets an invalid `maxSizeInBytes`. */ static fromBlob(c2pa: C2pa, format: string | undefined, blob: Blob, context?: Context): Promise; /** * Create a {@link Reader} from an initial fragment and a subsequent fragment. * * @param c2pa The `C2pa` instance (from {@link createC2pa}) to create this reader on. * @param format Asset format (MIME type or extension). Unlike {@link fromBlob}, fragmented * assets cannot be auto-detected from their bytes, so a format must be supplied. * @param init Blob of initial fragment bytes. * @param fragment Blob of fragment bytes. * @param context Optional `Context` configuring this reader's behavior. * @returns A {@link Reader} object or null if no C2PA metadata was found. * @throws If the asset is too large, or if the `Context` sets an invalid `maxSizeInBytes`. */ static fromBlobFragment(c2pa: C2pa, format: string, init: Blob, fragment: Blob, context?: Context): Promise; /** * @returns The label of the active manifest. */ activeLabel(): Promise; /** * @returns The asset's full {@link ManifestStore} containing all its manifests, validation statuses, and the URI of the active manifest. */ manifestStore(): Promise; /** * @returns The asset's active {@link Manifest}. */ activeManifest(): Promise; /** * @returns The asset's full {@link ManifestStore}. * * @deprecated Use {@link manifestStore} instead. */ json(): Promise; /** * @returns The asset's manifest store as crJSON. */ crJson(): Promise; /** * Resolves a URI reference to a binary object (e.g. a thumbnail) in the resource store. * * @param uri URI of the binary object to resolve. * @returns A Uint8Array of the resource's bytes. * * @example Retrieving a thumbnail from the resource store: * ``` * const reader = await Reader.fromBlob(c2pa, blob.type, blob); * const activeManifest = await reader.activeManifest(); * const thumbnailBuffer = await reader.resourceToBytes(activeManifest.thumbnail!.identifier); * ``` */ resourceToBytes(uri: string): Promise>; /** * Dispose of this Reader, freeing the memory it occupied and preventing further use. * Call this whenever the Reader is no longer needed. */ free(): Promise; } //# sourceMappingURL=reader.d.ts.map