// Generated by dts-bundle-generator v8.0.1 import * as P4 from '@iiif/parser/presentation-4/types'; /** * Clover's one data shape: IIIF Presentation 4. * * Every resource is upgraded to Presentation 4 on the way in, so no part is written for * several shapes. Presentation 2.1 and 3.0 are upgraded by `@iiif/parser`; Presentation 4 * passes through untouched. The upgrader is imported on demand, so it costs nothing until * the first resource that needs it arrives, and its reader of Presentation 2 only with * the first resource in 2. */ export type Manifest = P4.Manifest; export type Presentation4Canvas = P4.Canvas; export type Presentation4Collection = P4.Collection; export type Presentation4Scene = P4.Scene; export type Presentation4Timeline = P4.Timeline; /** * A IIIF resource Clover can show directly, a Manifest's item: a Canvas (`Canvas`), a * Timeline (`Timeline`, sound) or a Scene (`Scene`, 3D). */ export type Container = Presentation4Canvas | Presentation4Timeline | Presentation4Scene; /** * `resource` as Presentation 4: a Manifest, Collection, Canvas, Timeline or Scene from any * supported version. Presentation 4 input is returned as it is; the rest is upgraded as * `upgrade.ts` reads it, loaded with the upgrader. */ export declare function toPresentation4(resource: unknown): Promise; /** * IIIF Content State: a link that opens a resource at a place — a Canvas, a region of it, * a moment in it. Clover reads the forms the spec gives (an annotation with the * `contentState` motivation, or its bare target) as JSON or base64url-encoded, and turns * them into what to load and where to go once it has (`content-state-reader.ts`, loaded * only for one), and writes where the reader is as one (here). * * @see https://iiif.io/api/content-state/ */ /** Where to go once a resource has loaded. Consumed once it has been applied. */ export interface Target { canvasId: string; /** In the Canvas's own coordinates. */ region?: { x: number; y: number; w: number; h: number; }; /** Seconds into a time-based Canvas. */ time?: number; /** Start playback on arrival (auto-advance from the previous Canvas). */ autoplay?: boolean; } /** A content state as a link carries it: base64url of the URI-encoded JSON, unpadded. */ export declare function encodeContentState(json: unknown): string; export interface ContentStateOutput { /** The content state annotation. */ json: Record; /** The same, encoded for a URL. */ encoded: string; } /** * Where the reader is, as a content state: the Canvas (or Presentation 4's Timeline or * Scene, by its `type`) within its Manifest, and the visible region (`xywh=`) or the * media time (`t=`) when there is one. Regions are rounded to whole pixels. A Canvas * shown on its own, outside a Manifest (one made around it carries its id, `loneCanvas`), * is named without a `partOf`. */ export declare function buildContentState({ manifestId, canvasId, type, region, time, }: { manifestId?: string | null; canvasId: string; type?: string; region?: { x: number; y: number; w: number; h: number; } | null; time?: number | null; }): ContentStateOutput; /** * How Clover asks for things: one setting for every request it makes — the IIIF resource, * referenced annotation pages, `info.json`, tiles, captions and HLS segments. * * A `