/** @packageDocumentation OGG page header parser for the OGG container format. */ import type { offset_t } from "../toolkit/types.js"; import { IOStream } from "../toolkit/ioStream.js"; /** * Represents an OGG page header. Each OGG page begins with a 27-byte fixed * header followed by the segment table. */ export declare class OggPageHeader { /** Whether this page header was successfully parsed and validated. */ private _valid; /** Header type flags byte (0x01 = continuation, 0x02 = BOS, 0x04 = EOS). */ private _headerType; /** Granule position encoded in the page header (codec-specific time stamp). */ private _granulePosition; /** Serial number identifying the logical bitstream to which this page belongs. */ private _serialNumber; /** Monotonically increasing page sequence number within the bitstream. */ private _sequenceNumber; /** CRC-32 checksum stored in the page header. */ private _checksum; /** Raw segment table bytes (one byte per segment, values 0–255). */ private _segmentTable; /** Total size of the page payload in bytes, derived from the segment table. */ private _dataSize; /** Sizes of each logical packet (or partial packet) carried in this page. */ private _packetSizes; /** Whether this page header was successfully parsed and validated. */ get isValid(): boolean; /** Page is a continuation of a previous packet. */ get isContinuation(): boolean; /** First page of the logical bitstream (BOS). */ get isFirstPage(): boolean; /** Last page of the logical bitstream (EOS). */ get isLastPage(): boolean; /** The granule position encoded in this page, used to compute stream duration. */ get granulePosition(): bigint; /** Serial number of the logical bitstream to which this page belongs. */ get serialNumber(): number; /** Monotonically increasing sequence number of this page within its bitstream. */ get sequenceNumber(): number; /** Size of the page header including the segment table. */ get headerSize(): number; /** Total size of the page data (payload). */ get dataSize(): number; /** Total size of the entire page (header + payload). */ get totalSize(): number; /** Raw segment table bytes (one byte per segment, values 0–255). */ get segmentTable(): Uint8Array; /** * Derive packet sizes from the segment table. * * Each segment value is 0–255. A packet spans consecutive segments; * a segment value < 255 terminates the packet. If the last segment * value is exactly 255, the packet continues on the next page. */ get packetSizes(): number[]; /** * Parse an OGG page header from the given stream at the specified offset. * Returns `null` if the data at offset is not a valid OGG page. */ static parse(stream: IOStream, offset: offset_t): Promise; } //# sourceMappingURL=oggPageHeader.d.ts.map