/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { Bytes, Crypto, IdentifiedHashAlgorithm, MatterError } from "@matter/general"; import { OtaImageHeader } from "./OtaImageHeader.js"; export declare class OtaImageError extends MatterError { constructor(message: string, options?: ErrorOptions); } /** * Reader for OTA image files in Matter/DCL format. * Supports reading header information, validating payload digest, and extracting payload data. */ export declare class OtaImageReader { #private; /** Read only the OTA image header from the stream and returns the parsed header data. */ static header(streamReader: ReadableStreamDefaultReader): Promise; /** Read and validate the full OTA image file from the stream and returns the header data on success. */ static file(streamReader: ReadableStreamDefaultReader, crypto: Crypto, expectedTotalSize?: number | bigint, options?: { /** Calculate full file checksum to validate the full checksum against DCL information (default: true) */ calculateFullChecksum?: boolean; /** Expected checksum type for the full checksum (default: SHA-256) */ checksumType?: IdentifiedHashAlgorithm; /** Expected full file checksum to validate against, usually provided by the DCL */ expectedChecksum?: string; }): Promise; /** * Read and validate OTA file, extracting payload to a writable stream. * Returns the header information after successful validation and extraction. */ static extractPayload(streamReader: ReadableStreamDefaultReader, payloadWriter: WritableStreamDefaultWriter, crypto: Crypto, expectedTotalSize?: number | bigint): Promise; constructor(streamReader: ReadableStreamDefaultReader, crypto?: Crypto); get totalSize(): bigint | undefined; } //# sourceMappingURL=OtaImageReader.d.ts.map