import { ByteVector } from "../byteVector"; import { File } from "../file"; /** * Indicates the special properties of a {@link OggPageHeader}. */ export declare enum OggPageFlags { /** The page is a normal page. */ None = 0, /** The first packet of the page is continued from the previous page. */ FirstPacketContinued = 1, /** The page is the first page of the stream. */ FirstPageOfStream = 2, /** The page is the last page of the stream. */ LastPageOfStream = 4 } /** * This structure provides a representation of an Ogg page header. */ export declare class OggPageHeader { static readonly HEADER_IDENTIFIER: ByteVector; static readonly MINIMUM_SIZE = 27; static readonly NO_PACKETS_END_IN_PAGE: ByteVector; private _absoluteGranularPosition; private _dataSize; private _flags; private _lastPacketComplete; private _packetSizes; private _pageSequenceNumber; private _size; private _streamSerialNumber; private _version; private constructor(); /** * Constructs and initializes a new instance by reading a raw Ogg page header from a specified * position in a specified file. * @param file File from which the contents of the new instance are to be read * @param position Position in the file where the header begins */ static fromFile(file: File, position: number): OggPageHeader; /** * Constructs and initializes a new instance with a given stream serial number, page number, * and flags. * @param streamSerialNumber Serial number for the stream containing the page described by the * new instance * @param pageNumber Index of the page described by the new instance in the stream * @param flags Flags that apply to the new instance. */ static fromInfo(streamSerialNumber: number, pageNumber: number, flags: OggPageFlags): OggPageHeader; /** * Constructs and initializes a new instance by copying the values from another instance, * offsetting the page number and applying new flags. * @param original Object to copy values from * @param offset How much to offset the page sequence number in the new instance * @param flags Flags to use in the new instance */ static fromPageHeader(original: OggPageHeader, offset: number, flags: OggPageFlags): OggPageHeader; /** * Gets the absolute granular position of the page described by the current instance. */ get absoluteGranularPosition(): ByteVector; /** * Gets the size of the data portion of the page described by the current instance as it * appeared on disk. */ get dataSize(): number; /** * Gets the flags for the page described by the current instance. */ get flags(): OggPageFlags; /** * Gets whether the final packet is continued on the next page. If `true`, the final * packet is complete and not continued on the next page. */ get lastPacketComplete(): boolean; /** * Gets the sizes for the packets in the page described by the current instance. */ get packetSizes(): number[]; /** * Sets the sizes for the packets in the page described by the current instnace. * @internal */ set packetSizes(value: number[]); /** * Gets the sequence number of the page described by the current instance. */ get pageSequenceNumber(): number; /** * Gets the size of the header as it appeared on disk. */ get size(): number; /** * Gets the serial number of the stream that the current instance belongs to. */ get streamSerialNumber(): number; render(): ByteVector; }