import { ByteVector } from "../byteVector"; import { File } from "../file"; import { OggPageHeader } from "./oggPageHeader"; export default class OggPage { private readonly _header; private readonly _packets; private constructor(); /** * Constructs and initializes a new instance by reading a raw Ogg page from a specified * position in a specified file. * @param file File to read the new instance from * @param position Offset in the file where the page begins. */ static fromFile(file: File, position: number): OggPage; /** * Constructs and initializes a new instance with a specified header and list of packets. * @param header Header of the page * @param packets Packets contained in the page */ static fromPackets(header: OggPageHeader, packets: ByteVector[]): OggPage; /** * Gets the header of the current instance. */ get header(): OggPageHeader; /** * Gets the packets contained in the current instance. */ get packets(): ByteVector[]; /** * Gets the total size of the current instance as it appears on disk. */ get size(): number; /** * Overwrites all page headers in a file starting at a specified position, shifting the page * sequence numbers a set amount. * @remarks * When the number of pages in a stream changes, all subsequent pages in the stream * need to have their page sequence numbers updated in order to remain valid. Additionally, * when the page sequence number changes, the page needs to have its checksum recomputed. * This makes for a costly calculation if large comment data is added. * @param file File to update * @param position Offset into the file to begin updating * @param shiftTable Map where the key is the serial number of the stream to update and the * value is the amount to offset the page sequence numbers in the stream * @internal */ static overwriteSequenceNumbers(file: File, position: number, shiftTable: Map): void; /** * Renders the current instance as a raw Ogg page. */ render(): ByteVector; }