/** Pages, 1-based and inclusive; one page has `from === to`. */ export type PageSpan = { readonly from: number; readonly to: number; }; /** Seconds from the start; no `to` means to the end. */ export type TimeSpan = { readonly from: number; readonly to?: number; }; /** A rectangle in percent of the whole: left, top, width, height. */ export type Region = { readonly x: number; readonly y: number; readonly w: number; readonly h: number; }; /** Where in a source a look was: a page span, a time span, a region of the picture, or several together. `formatFragment` and * `parseFragment` write and read the `#page=`, `#t=` and `#xywh=` forms of a citation. */ export type Fragment = { readonly page?: PageSpan; readonly t?: TimeSpan; readonly xywh?: Region; }; /** The fragment without its `#`, such as `page=1-37` or `t=60,90&xywh=percent:0,0,50,50`, with seconds and percent * rounded to the thousandth. Throws on a fragment that names nothing or holds an impossible value once rounded (page * 0, a window that ends before it starts or within a millisecond of it, a region off the whole or with no size), so * what this writes always reads back. */ export declare function formatFragment(fragment: Fragment): string; /** `path#fragment`, the form a receipt and an answer cite. */ export declare const citation: (path: string, fragment: Fragment) => string; /** A fragment, with or without its `#`; null for anything this module would not write: an unknown or repeated key, * a malformed or impossible value, a spatial fragment in pixels. `t` also takes Media Fragments' `npt:` prefix and an * open start (`t=,90`, from 0). */ export declare function parseFragment(text: string): Fragment | null; /** A citation split at its last `#` that starts a fragment, so a `#` inside a file name stays in the path. A path * with no fragment comes back with `fragment: null`. */ export declare function parseCitation(text: string): { path: string; fragment: Fragment | null; };