/**
* Link - PDF hyperlink and navigation
*
* This module provides 100% API compatibility with MicroPDF's link operations.
* Handles hyperlinks, page navigation, and external URIs.
*/
import { Rect, type RectLike, type PointLike } from './geometry.js';
/**
* Link destination types
*/
export declare enum LinkDestinationType {
URI = 0,// External URI
Page = 1,// Internal page number
XYZ = 2,// Go to position on page
Fit = 3,// Fit page to window
FitH = 4,// Fit horizontally
FitV = 5,// Fit vertically
FitR = 6,// Fit rectangle
FitB = 7,// Fit bounding box
FitBH = 8,// Fit bounding box horizontally
FitBV = 9
}
/**
* A PDF hyperlink
*/
export declare class Link {
private _rect;
private _uri;
private _pageNumber;
private _refCount;
private _destType;
constructor(rect: RectLike | null, uri?: string, pageNumber?: number);
/**
* Create a new link
*/
static create(rect: RectLike, uri?: string, pageNumber?: number): Link;
/**
* Create a URI link
*/
static createURI(rect: RectLike, uri: string): Link;
/**
* Create a page link
*/
static createPage(rect: RectLike, pageNumber: number): Link;
keep(): this;
drop(): void;
/**
* Clone this link
*/
clone(): Link;
get rect(): Rect;
set rect(r: RectLike);
get uri(): string;
set uri(uri: string);
get pageNumber(): number;
/**
* Get rect (method alias for property getter)
*/
getRect(): Rect;
/**
* Set rect (method alias for property setter)
*/
setRect(r: RectLike): void;
/**
* Get URI (method alias for property getter)
*/
getUri(): string;
/**
* Set URI (method alias for property setter)
*/
setUri(uri: string): void;
/**
* Get page number (method alias for property getter)
*/
getPageNumber(): number;
/**
* Check if link is external (URI)
*/
isExternal(): boolean;
/**
* Check if link is a page link
*/
isPageLink(): boolean;
/**
* Check if link is a page link (alias for isPageLink)
*/
isPage(): boolean;
/**
* Get destination type
*/
get destinationType(): LinkDestinationType;
/**
* Check if link is valid
*/
isValid(): boolean;
/**
* Check if two links are equal
*/
equals(other: Link): boolean;
}
/**
* A list of links for a page
*/
export declare class LinkList {
private _links;
constructor();
/**
* Create a new link list
*/
static create(): LinkList;
/**
* Clone this link list
*/
clone(): LinkList;
/**
* Add a link to the list
*/
add(link: Link): void;
/**
* Count number of links
*/
count(): number;
/**
* Check if list is empty
*/
isEmpty(): boolean;
/**
* Get first link
*/
first(): Link | undefined;
/**
* Get link by index
*/
get(index: number): Link | undefined;
/**
* Get all links
*/
getAll(): Link[];
/**
* Find link at a point
*/
findAtPoint(point: PointLike): Link | undefined;
/**
* Find all links at a point
*/
findAllAtPoint(point: PointLike): Link[];
/**
* Find links in a rect
*/
findInRect(rect: RectLike): Link[];
/**
* Clear all links
*/
clear(): void;
/**
* Remove a specific link
*/
remove(link: Link): boolean;
/**
* Remove link at index
*/
removeAt(index: number): boolean;
/**
* Get all external (URI) links
*/
getExternalLinks(): Link[];
/**
* Get all page links
*/
getPageLinks(): Link[];
/**
* Get links by page number
*/
getLinksToPage(pageNumber: number): Link[];
/**
* Iterate over links
*/
[Symbol.iterator](): Generator;
/**
* For each link
*/
forEach(callback: (link: Link, index: number) => void): void;
/**
* Map links
*/
map(callback: (link: Link, index: number) => T): T[];
/**
* Filter links
*/
filter(predicate: (link: Link, index: number) => boolean): Link[];
}
//# sourceMappingURL=link.d.ts.map