import { type PdfDocument } from "./PdfDocument"; import { type PdfPage } from "./PdfPage"; import { PdfCollection } from "./PdfCollection"; /** * Represents a collection of pages that make up a PDF document. **/ export declare class PdfPageCollection extends PdfCollection { get count(): number; getAt(index: number): PdfPage; setAt(index: number, page: PdfPage): void; insert(index: number, page: PdfPage): void; contains(page: PdfPage): boolean; remove(page: PdfPage): boolean; removeAt(index: number): void; clear(): void; /** * Gets the owner PdfDocument. **/ get doc(): PdfDocument; /** * Adds a new PdfPage to the end of the collection. * @returns A PdfPage object added to the collection. **/ addNew(): PdfPage; /** * Creates a new PdfPage with the specified size and adds it to the end of the collection. * @param width The width of the new page, in points. * @param height The height of the new page, in points. * @returns A PdfPage object added to the collection. * * @example * const doc = new PdfDocument(); * const page = doc.pages.addNew(500, 350); * page.context.drawEllipse(100, 100, 300, 150, { * fillColor: "MediumAquamarine", * lineColor: "Teal", * lineWidth: 10 * }); * const res: Uint8Array = doc.savePdf(); **/ addNew(width: number, height: number): PdfPage; /** * Inserts a new PdfPage at a specific position in the collection. * @param index The position where the new page will be inserted. * @returns A PdfPage object inserted in the collection. **/ insertNew(index: number): PdfPage; /** * Creates a new PdfPage with the specified size and inserts it at a specific position in the collection. * @param index The position where the new page will be inserted. * @param width The width of the new page, in points. * @param height The height of the new page, in points. * @returns A PdfPage object inserted in the collection. **/ insertNew(index: number, width: number, height: number): PdfPage; /** * Moves a page specified by its 0-based index to another position in the page collection. * @param sourceIndex The current index of the page to move. * @param destinationIndex The new index of the page. **/ move(sourceIndex: number, destinationIndex: number): void; /** * Clones a page at a specified index (sourceIndex) and inserts it at a specified position (destinationIndex). * @param sourceIndex The index of the page to clone. * @param destinationIndex The destination index. * @param cloneAnnotations Indicates whether to clone page annotations. * @param cloneFields Indicates whether to clone fields existing on the source page. **/ clone(sourceIndex: number, destinationIndex: number, cloneAnnotations?: boolean, cloneFields?: boolean): void; /** * Swaps two pages specified by their 0-based indices. * @param pageIndex1 The index of the first page to swap. * @param pageIndex2 The index of the second page to swap. **/ swap(pageIndex1: number, pageIndex2: number): void; }