// Generated by dts-bundle-generator v8.0.1 import * as P4 from '@iiif/parser/presentation-4/types'; import React from 'react'; /** * Where an annotation points, read from any form of Presentation 4 target: * * - a URI, `canvas#xywh=x,y,w,h` or `canvas#t=start,end`; * - a reference, `{ id, type }`, whose id carries the same fragments (what the upgrader * makes of a Presentation 3 string target); * - a `SpecificResource`, `{ source, selector }`, with a `FragmentSelector`, * `PointSelector` or `SvgSelector` (or an array of them, of which the first that * applies wins); * - several of these, as Presentation 4 groups them (`Independents`, `List`, * `Composite`, which the upgrader makes of a Presentation 3 array), of which this reads * the first; `annotationTargets` (`components/Canvas/track.ts`, with the hotspots that * follow a recording) reads them all. * * A fragment may give a region and a time at once (`xywh=…&t=…`, both dimensions of a * Media Fragment): the region through that stretch of a recording. */ export interface ParsedAnnotationTarget { /** The Canvas (or other resource) targeted, without its fragment. */ id: string; point?: { x: number; y: number; }; rect?: { x: number; y: number; w: number; h: number; }; svg?: string; /** A media fragment's time, as written: `start` or `start,end`. */ t?: string; } /** * IIIF language maps as text: the closest language to the reader's, and that language's * tag, so the text can carry a `lang` attribute. */ export type LanguageMapLike = string | Record | null | undefined; /** * What an annotation says: its text bodies (plain, HTML or Markdown, as their `format` * says), its images (Cookbook 0377) and its named places (Cookbook 0139), each read too * where a `SpecificResource` holds it as its `source` (Cookbook 0045: a comment's words, * given a `styleClass`). Caption files belong to the media transcript, so are left out. * Light, for the Canvas's caption as well as the lists. */ export interface AnnotationBodyEntry { /** `TextualBody` text, as published: plain, or IIIF's limited HTML. */ value?: string; format?: string; language?: string; /** An image body (Cookbook 0377): its URL. */ image?: string; /** * An image body's label, else its annotation's: the image's text alternative. A place's * name, its feature's `label`, else its annotation's. */ label?: LanguageMapLike; /** * A place, a GeoJSON `Feature` (Cookbook 0139: a map on the page, tagged with where it * shows): named by its `label`, which the Map draws it under too. */ place?: true; /** * One item of a `Choice` (Cookbook 0346: the same words in English and in Japanese), by * the choice's place among the annotation's: of each, one shows, the one in the reader's * language (`bodyInLanguage`, `core/annotation-name.ts`). */ choice?: number; } export type Presentation4Canvas = P4.Canvas; 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; /** * Annotations to read and to point at: everything a Manifest's Canvases carry in their * `annotations` (comments, tags, transcriptions, descriptions), and pages a host adds. * Painting annotations are the picture, not commentary, and caption files belong to the * media transcript, so neither is listed here. * * A set is one AnnotationPage. Sets are memoized on the Manifest and the added pages, so * the same arrays come back while nothing changes. */ export interface AnnotationEntry { id: string; /** The set it came from. */ setId: string; /** The Canvas it targets. */ canvasId: string; target: ParsedAnnotationTarget; motivation: string[]; bodies: AnnotationBodyEntry[]; /** The annotation as published, for a host's own rendering. */ annotation: Record; /** * A Range's region (`range-regions.ts`): its place among the Range's parts, "1 of 4", * which its hotspot shows after its name. */ place?: { index: number; total: number; }; /** * An annotation of one image of a `Choice` (Cookbook 0326: an X-ray's tag), not of the * Canvas: the choice's key (`core/choice-key.ts`), the item's place in it, and the * image's id. It is drawn while that item is the one chosen, and its `target` is given * here in the Canvas's terms, placed through the image's painting. */ layer?: { key: string; item: number; image: string; }; } /** An annotation page a Canvas names: by id, its Canvas, and whether it is fetched. */ export interface AnnotationPageRef { id: string; canvasId: string; fetched: boolean; } /** * Annotations walked as one whole, as a viewer walks a Collection's members: the * AnnotationPage or AnnotationCollection given as the content (James Turner's tags across * Manifests, all in hand), else an AnnotationCollection the Manifest's annotation pages * are part of (Cookbook 0309: layout markup across a newspaper's pages, managed as one * whole), whose pages load as the reader reaches them. */ export interface AnnotationCollection { id: string; type: "AnnotationPage" | "AnnotationCollection"; label?: LanguageMapLike; /** The number of its annotations, where it says. */ total?: number; /** * The Manifest's pages of it, in the Canvases' order, so a listing loads them as the * reader reaches them (`usePagesReached`, `clover.fetchAnnotationPages`). None for the * content's, whose annotations are all in hand. */ pages: AnnotationPageRef[]; /** Its annotations on the Manifest's Canvases, in their order, as far as fetched. */ entries: AnnotationEntry[]; } /** * 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 `