// Generated by dts-bundle-generator v8.0.1 import * as P4 from '@iiif/parser/presentation-4/types'; import { Annotation, IIIFExternalWebResource, InternationalString, MetadataItem } from '@iiif/presentation-3'; import React from 'react'; import { CSSProperties, ReactNode } 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; export interface LocalizedValue { text: string; /** The tag the text is in; undefined for `none` (no language) or plain strings. */ lang?: string; } export declare function localize(value: LanguageMapLike, language?: string, separator?: string): LocalizedValue; /** * 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; } /** * 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; /** * 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; }; } /** * The set of the regions the Manifest's Ranges name (`range-regions.ts`), drawn as * annotations, listed by Contents. */ export declare const CONTENTS_SET_ID = "contents"; export interface AnnotationSet { id: string; label?: LanguageMapLike; /** * Where it came from: the Manifest's Canvases, the host, a Content Search, or the * regions the Manifest's Ranges name (`contentsSet`). */ source: "manifest" | "added" | "search" | "contents"; entries: AnnotationEntry[]; /** The AnnotationCollection its page is `partOf`, by id (Cookbook 0309). */ collection?: string; /** * The AnnotationPage or AnnotationCollection it was given as, where it is the Root's * content (James Turner's tags across Manifests), walked as one whole. */ content?: { id: string; type: "AnnotationPage" | "AnnotationCollection"; label?: LanguageMapLike; }; } /** 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 `