// Generated by dts-bundle-generator v8.0.1 import * as P4 from '@iiif/parser/presentation-4/types'; import React from 'react'; /** * 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 Presentation4Collection = P4.Collection; /** * 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; /** * A IIIF resource as JSON, read loosely. One declaration for the modules whose `Json` * reaches Clover's types: the bundled declarations (`build:types`) would hold one per * module, under the one name, which TypeScript rejects. */ export type Json = Record; /** * Whether a Manifest has anything to put on a map: navPlace on the Collection, Manifest, * a Canvas or an annotation, a GeoJSON annotation body, or a georeferencing annotation. * Only a look, never a read: the panel asks it to offer a Map tab, and the reading * (`core/geo.ts`) belongs to the map entry, so an app without a map carries none of it. */ export declare function hasMapData(manifest: Manifest | null, collection?: Presentation4Collection | null): boolean; /** * Whether a Canvas has anything of its own to put on a map: its navPlace, an annotation's * on it, a GeoJSON annotation body, or a georeferencing annotation, as far as its pages * are loaded. Only a look, as `hasMapData`'s, which asks it of each Canvas. */ export declare function canvasHasMapData(canvas: unknown): boolean; /** * Where a IIIF resource is, read for a map: navPlace (on a Collection, Manifest, Canvas * or Annotation, and annotation bodies that are GeoJSON), and Georeference Extension * annotations, reduced to what a basic overlay needs. Framework-free and small: the map * itself, and MapLibre, load only when a `Map` is shown. * * - navPlace: https://iiif.io/api/extension/navplace/ * - Georeference: https://iiif.io/api/extension/georef/ */ export type Position = [ number, number ]; export interface GeoGeometry { type: string; coordinates?: unknown; geometries?: GeoGeometry[]; } export interface MapFeature { type: "Feature"; id?: string | number; geometry: GeoGeometry; /** * Flat, for MapLibre (which turns nested objects into strings): the text to show and * its language, the Canvas it belongs to, and any simplestyle keys it carried (`fill`, * `stroke`, …). */ properties: Record & { title?: string; titleLang?: string; canvasId?: string; /** The annotation it is a body of (Cookbook 0139), which a press on it selects. */ annotationId?: string; /** The Collection's member it locates (Cookbook 0318), which a press on it opens. */ manifestId?: string; /** Its owner's `navDate`, as written, shown with its name (Cookbook 0318). */ navDate?: string; /** * What its owner's picture is made from (`pictureOf`, as JSON, MapLibre's properties * being flat), shown over its name: the Manifest's, Canvas's or Collection member's * own `thumbnail`, else its first image (Mat, 2026-11-08). */ thumbnail?: string; }; } export interface MapFeatureCollection { type: "FeatureCollection"; features: MapFeature[]; } /** A georeferenced image, reduced to an affine overlay. */ export interface Georeference { id: string; /** The Canvas it georeferences, when it targets one. */ canvasId?: string; /** Ground control points: image pixel [x, y] ↔ [longitude, latitude]. */ points: Array<{ resource: Position; geo: Position; }>; /** * How the points are fitted: `helmert` (scale, rotation and shift, from two points or * more), as the annotation's `transformation` asks; else `polynomial`, a first-order * polynomial (affine) from three or more, which also stands in for the transformations * a basic overlay cannot warp (higher orders, thin plate spline). Left out, `polynomial`. */ transformation?: "helmert" | "polynomial"; /** The extent the points are measured in: the Canvas, or the image service. */ width: number; height: number; /** The part of the image that is map (an SvgSelector polygon), in the same units. */ mask?: Position[]; /** Its name: the annotation's label, or the Canvas's. */ label?: LanguageMapLike; /** What to draw: an image body (or a bare image service), sized by `overlayImageUrl`. */ image: Record; } /** * Every navPlace feature of the Root's resource: the Collection's, each of its members' * (Cookbook 0318: a Collection of Manifests, each where it is), the Manifest's, each * Canvas's, and each loaded annotation's (its `navPlace`, or a GeoJSON body as Cookbook * 0139 has). A feature from a member names that member, the open one's place its own * Manifest's where it gives one, in the member's place in the Collection's order; one * from a Canvas or annotation names that Canvas. Memoized on the Manifest (and the * Collection), so the same collection comes back while nothing changes. While a member * loads, its Manifest put away, the Collection's places stay, each its member's own. */ export declare function navPlaceOf(manifest: Manifest | null, collection?: Presentation4Collection | null, language?: string): MapFeatureCollection; /** * One Georeference Extension annotation as an overlay: its control points, the extent * they are measured in, its mask, and the image to draw (the Canvas's painted image, or * the image service it targets directly). Null when it cannot be drawn: too few points * for its transformation (two for `helmert`, else three), no extent, or nothing to draw. */ export declare function readGeoreference(annotation: Json, canvas?: Json): Georeference | null; /** * The georeferenced images of the Manifest's Canvases, from their loaded annotation pages. * Memoized on the Manifest: embedding a fetched page makes a new one. */ export declare function georeferencesOf(manifest: Manifest | null): Georeference[]; /** * The first-order polynomial (affine) transform that best fits the control points, image * pixels to [longitude, latitude], by least squares in Web Mercator. Exact for three * points. Null when the points are collinear. */ export declare function affineTransform(points: Georeference["points"]): ((pixel: Position) => Position) | null; /** * Where the image's corners land, in the order MapLibre's image and canvas sources take * them: top left, top right, bottom right, bottom left. Null when the points do not fix * a transform. */ export declare function cornersOf(georeference: Georeference): [ Position, Position, Position, Position ] | null; /** The [[west, south], [east, north]] that holds the features and the overlays. */ export declare function boundsOf(features: MapFeature[], overlays?: Georeference[]): [ Position, Position ] | null; /** * 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 `