maniiifest
Version:
Typesafe IIIF presentation v3 manifest and collection parsing without external dependencies
559 lines (558 loc) • 16 kB
TypeScript
/**
* Public-facing types for IIIF Presentation API v3.
*
* These types are automatically generated from specification.ts with
* discriminated union structures flattened to represent post-adapter data.
*
* Key transformations:
* - Discriminated unions: { kind: 'T1', value: TypeT } becomes TypeT
* - Type references: TypeT becomes Type (remove 'T' suffix)
* - Structure preserved: Same properties and relationships as specification.ts
*
* ⚠️ AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
* Generated by: npm run generate-public-types
* Source: src/specification.ts (with discriminated unions flattened)
*
* To regenerate after ATD changes:
* 1. Update specification.atd
* 2. Regenerate specification.ts with atdgen
* 3. Run: npm run generate-public-types
*/
export declare type BehaviorT = string;
export declare type FormatT = string;
export declare type IdT = string;
export declare type LanguageT = LanguageT1 | LanguageT2;
export declare type MotivationT = MotivationT1 | MotivationT2;
export declare type NavDateT = string;
export declare type RightsT = string;
export declare type TypeT = string;
export declare type AccessibilityT = string;
export declare type AccompanyingCanvasT = {
id: IdT;
type: TypeT;
label?: LabelT;
height?: HeightT;
width?: WidthT;
duration?: DurationT;
metadata?: MetadataT[];
summary?: SummaryT;
requiredStatement?: RequiredStatementT;
rendering?: RenderingT[];
rights?: RightsT;
navDate?: NavDateT;
navPlace?: NavPlaceT;
provider?: ProviderT[];
seeAlso?: SeeAlsoT[];
service?: ServiceT;
thumbnail?: ThumbnailT[];
homepage?: HomepageT[];
behavior?: BehaviorT[];
partOf?: PartOfT[];
items?: AnnotationPageT[];
annotations?: AnnotationPageT[];
};
export declare type AnnotationBodyItemsT = AnnotationBodyT0 | AnnotationBodyT1 | AnnotationBodyT2 | AnnotationBodyT3 | AnnotationBodyT4 | AnnotationBodyT5 | AnnotationBodyT6;
export declare type AnnotationBodyT = AnnotationBodyT0 | AnnotationBodyT1 | AnnotationBodyT2 | AnnotationBodyT3 | AnnotationBodyT4 | AnnotationBodyT5 | AnnotationBodyT6 | AnnotationBodyT7;
export declare type AnnotationBodyT0 = {
id?: IdT;
label?: LabelT;
format?: FormatT;
profile?: ProfileT;
language?: LanguageT;
value?: ValueT;
};
export declare type AnnotationBodyT1 = string;
export declare type AnnotationBodyT2 = {
id: IdT;
type: TypeT;
label?: LabelT;
format?: FormatT;
profile?: ProfileT;
width?: WidthT;
height?: HeightT;
duration?: DurationT;
language?: LanguageT;
rendering?: RenderingT[];
thumbnail?: ThumbnailT[];
service?: ServiceT;
annotations?: AnnotationPageT[];
};
export declare type AnnotationBodyT3 = {
id?: IdT;
type?: TypeT;
format?: FormatT;
accessibility?: AccessibilityT;
source: SourceT;
selector?: SelectorT;
language?: LanguageT;
};
export declare type AnnotationBodyT4 = {
type: TypeT;
language?: LanguageT;
format?: FormatT;
value?: ValueT;
creator?: CreatorT;
};
export declare type AnnotationBodyT5 = {
id?: IdT;
type?: TypeT;
properties?: PropertiesT;
geometry?: GeometryT;
};
export declare type AnnotationBodyT6 = {
id?: IdT;
type: TypeT;
features?: FeatureT[];
transformation?: TransformationT;
};
export declare type AnnotationBodyT7 = {
type?: TypeT;
items: AnnotationBodyItemsT[];
};
export declare type AnnotationCollectionT = {
context?: ContextT;
id: IdT;
type: TypeT;
label?: LabelT;
rendering?: RenderingT[];
partOf?: PartOfT;
total?: TotalT;
first?: FirstT;
last?: LastT;
service?: ServiceT;
thumbnail?: ThumbnailT[];
items?: AnnotationT[];
};
export declare type AnnotationPageT = {
context?: ContextT;
id?: IdT;
type: TypeT;
label?: LabelT;
partOf?: PartOfT;
next?: NextT;
startIndex?: StartIndexT;
rendering?: RenderingT[];
service?: ServiceT;
thumbnail?: ThumbnailT[];
items?: AnnotationT[];
};
export declare type AnnotationT = {
context?: ContextT;
id: IdT;
type: TypeT;
service?: ServiceT;
thumbnail?: ThumbnailT[];
rendering?: RenderingT[];
motivation?: MotivationT;
created?: CreatedT;
creator?: CreatorT;
modified?: ModifiedT;
body?: BodyT;
target?: TargetT;
};
export declare type AnnotationTargetT = AnnotationTargetT1 | AnnotationTargetT2 | AnnotationTargetT3 | AnnotationTargetT4;
export declare type AnnotationTargetT1 = string;
export declare type AnnotationTargetT2 = {
source: IdT;
scope: IdT;
language?: LanguageT;
};
export declare type AnnotationTargetT3 = SpecificResourceT;
export declare type AnnotationTargetT4 = {
id: IdT;
partOf?: PartOfT;
language?: LanguageT;
};
export declare type BodyT = AnnotationBodyT | AnnotationBodyT[];
export declare type CanvasCoreT = {
id: IdT;
type: TypeT;
label?: LabelT;
height?: HeightT;
width?: WidthT;
duration?: DurationT;
metadata?: MetadataT[];
summary?: SummaryT;
requiredStatement?: RequiredStatementT;
rendering?: RenderingT[];
rights?: RightsT;
navDate?: NavDateT;
navPlace?: NavPlaceT;
provider?: ProviderT[];
seeAlso?: SeeAlsoT[];
service?: ServiceT;
thumbnail?: ThumbnailT[];
homepage?: HomepageT[];
behavior?: BehaviorT[];
partOf?: PartOfT[];
items?: AnnotationPageT[];
annotations?: AnnotationPageT[];
};
export declare type CanvasT = {
id: IdT;
type: TypeT;
label?: LabelT;
height?: HeightT;
width?: WidthT;
duration?: DurationT;
metadata?: MetadataT[];
summary?: SummaryT;
requiredStatement?: RequiredStatementT;
rendering?: RenderingT[];
rights?: RightsT;
navDate?: NavDateT;
navPlace?: NavPlaceT;
provider?: ProviderT[];
seeAlso?: SeeAlsoT[];
service?: ServiceT;
thumbnail?: ThumbnailT[];
homepage?: HomepageT[];
behavior?: BehaviorT[];
partOf?: PartOfT[];
items?: AnnotationPageT[];
annotations?: AnnotationPageT[];
placeholderCanvas?: PlaceholderCanvasT;
accompanyingCanvas?: AccompanyingCanvasT;
};
export declare type ClassT = {
id: IdT;
type: TypeT;
label?: LabelT;
};
export declare type ConformsToT = string;
export declare type ContextT = ContextT1 | ContextT2;
export declare type ContextT1 = string;
export declare type ContextT2 = string[];
export declare type CreatedT = string;
export declare type CreatorItemT = CreatorItemT1 | CreatorItemT2;
export declare type CreatorItemT1 = string;
export declare type CreatorItemT2 = {
id?: IdT;
type?: TypeT;
name?: NameT;
nickname?: NicknameT;
email?: EmailStringsT;
email_sha1?: EmailSha1StringsT;
homepage?: HomepageStringsT;
};
export declare type CreatorT = CreatorItemT | CreatorItemT[];
export declare type DefaultT = string;
export declare type DimensonT = number;
export declare type DurationT = number;
export declare type EmailSha1StringsT = StringsT;
export declare type EmailStringsT = StringsT;
export declare type ExactT = string;
export declare type ExternalT = {
id: IdT;
type: TypeT;
label?: LabelT;
format?: FormatT;
profile?: ProfileT;
};
export declare type FeatureCollectionT = {
id?: IdT;
type: TypeT;
features?: FeatureT[];
transformation?: TransformationT;
};
export declare type FeatureT = {
id?: IdT;
type?: TypeT;
properties?: PropertiesT;
geometry?: GeometryT;
};
export declare type FirstT = FirstT1 | FirstT2;
export declare type FirstT1 = string;
export declare type FirstT2 = {
id: IdT;
type: TypeT;
label?: LabelT;
startIndex?: StartIndexT;
thumbnail?: ThumbnailT[];
next?: NextT;
items?: AnnotationT[];
};
export declare type GeometriesT = GeometryT1 | GeometryT2 | GeometryT3 | GeometryT4 | GeometryT5 | GeometryT6;
export declare type GeometryT = GeometryT1 | GeometryT2 | GeometryT3 | GeometryT4 | GeometryT5 | GeometryT6 | GeometryT7;
export declare type GeometryT1 = {
type?: TypeT;
coordinates?: PointCoordinatesT[];
};
export declare type GeometryT2 = {
type?: TypeT;
coordinates?: MultiPointCoordinatesT[];
};
export declare type GeometryT3 = {
type?: TypeT;
coordinates?: LinestringCoordinatesT[];
};
export declare type GeometryT4 = {
type?: TypeT;
coordinates?: MultiLinestringCoordinatesT[];
};
export declare type GeometryT5 = {
type?: TypeT;
coordinates?: PolygonT[];
};
export declare type GeometryT6 = {
type?: TypeT;
coordinates?: MultiPolygonT[];
};
export declare type GeometryT7 = {
type?: TypeT;
geometries: GeometriesT[];
};
export declare type HeightT = number;
export declare type HomepageStringsT = StringsT;
export declare type HomepageT = {
id: IdT;
type: TypeT;
label?: LabelT;
format?: FormatT;
language?: LanguageT[];
};
export declare type LabelT = LabelT1 | LabelT2;
export declare type LabelT1 = string;
export declare type LabelT2 = LngStringT;
export declare type LanguageT1 = string;
export declare type LanguageT2 = string[];
export declare type LastT = string;
export declare type LinestringCoordinatesT = number[];
export declare type LngStringT = [string, string[]][];
export declare type LogoT = ResourceT;
export declare type MetadataT = {
label: LngStringT;
value: LngStringT;
};
export declare type ModifiedT = string;
export declare type MotivationT1 = string;
export declare type MotivationT2 = string[];
export declare type MultiLinestringCoordinatesT = number[][];
export declare type MultiPointCoordinatesT = [number, number];
export declare type MultiPolygonT = [number, number][][];
export declare type NameT = string;
export declare type NavPlaceT = {
id?: IdT;
type: TypeT;
features?: FeatureT[];
};
export declare type NextT = string;
export declare type NicknameT = string;
export declare type OptionsT = {
order?: OrderT;
};
export declare type OrderT = number;
export declare type PartOfT = PartOfT1 | PartOfT2;
export declare type PartOfT1 = string;
export declare type PartOfT2 = {
id: IdT;
type?: TypeT;
label?: LabelT;
total?: TotalT;
};
export declare type PatternT = string;
export declare type PlaceholderCanvasT = {
id: IdT;
type: TypeT;
label?: LabelT;
height?: HeightT;
width?: WidthT;
duration?: DurationT;
metadata?: MetadataT[];
summary?: SummaryT;
requiredStatement?: RequiredStatementT;
rendering?: RenderingT[];
rights?: RightsT;
navDate?: NavDateT;
navPlace?: NavPlaceT;
provider?: ProviderT[];
seeAlso?: SeeAlsoT[];
service?: ServiceT;
thumbnail?: ThumbnailT[];
homepage?: HomepageT[];
behavior?: BehaviorT[];
partOf?: PartOfT[];
items?: AnnotationPageT[];
annotations?: AnnotationPageT[];
};
export declare type PointCoordinatesT = number;
export declare type PolygonT = [number, number][];
export declare type PrefixT = string;
export declare type ProfileT = string;
export declare type PropertiesT = {
label?: LabelT;
};
export declare type ProviderT = {
id: IdT;
type: TypeT;
label?: LabelT;
homepage?: HomepageT[];
logo?: LogoT[];
seeAlso?: SeeAlsoT[];
};
export declare type QualityT = string;
export declare type RangeItemsT = SpecificResourceT | CanvasT | RangeT;
export declare type RangeT = {
id: IdT;
type: TypeT;
label?: LabelT;
rendering?: RenderingT[];
supplementary?: AnnotationCollectionT;
service?: ServiceT;
placeholderCanvas?: PlaceholderCanvasT;
accompanyingCanvas?: AccompanyingCanvasT;
annotations?: AnnotationPageT[];
thumbnail?: ThumbnailT[];
navPlace?: NavPlaceT;
items: RangeItemsT[];
};
export declare type RegionT = string;
export declare type RenderingT = ExternalT;
export declare type RequiredStatementT = {
label: LngStringT;
value: LngStringT;
};
export declare type ResourceSelectorT = ResourceSelectorT1 | ResourceSelectorT2 | ResourceSelectorT3 | ResourceSelectorT4 | ResourceSelectorT5 | ResourceSelectorT6;
export declare type ResourceSelectorT1 = string;
export declare type ResourceSelectorT2 = {
type: TypeT;
t?: DurationT;
x_?: DimensonT;
y?: DimensonT;
};
export declare type ResourceSelectorT3 = {
type: TypeT;
conformsTo?: ConformsToT;
value: ValueT;
};
export declare type ResourceSelectorT4 = {
type: TypeT;
value: ValueT;
};
export declare type ResourceSelectorT5 = {
type: TypeT;
region?: RegionT;
size?: SizeT;
rotation?: RotatationT;
quality?: QualityT;
format?: FormatT;
};
export declare type ResourceSelectorT6 = {
type: TypeT;
prefix?: PrefixT;
exact: ExactT;
suffix?: SuffixT;
};
export declare type ResourceT = {
id: IdT;
type: TypeT;
label?: LabelT;
format?: FormatT;
profile?: ProfileT;
width?: WidthT;
height?: HeightT;
duration?: DurationT;
language?: LanguageT;
rendering?: RenderingT[];
thumbnail?: ThumbnailT[];
service?: ServiceT;
annotations?: AnnotationPageT[];
};
export declare type RotatationT = string;
export declare type SeeAlsoT = ExternalT;
export declare type SelectorT = ResourceSelectorT | ResourceSelectorT[];
export declare type ServiceItemT = ServiceItemT1 | ServiceItemT2;
export declare type ServiceItemT1 = {
id: IdT;
type: TypeT;
label?: LabelT;
profile?: ProfileT;
service?: ServiceT;
};
export declare type ServiceItemT2 = {
id: IdT;
type: TypeT;
label?: LabelT;
profile?: ProfileT;
service?: ServiceT;
};
export declare type ServiceT = ServiceItemT | ServiceItemT[];
export declare type SizeT = string;
export declare type SourceT = SourceT1 | SourceT2;
export declare type SourceT1 = IdT;
export declare type SourceT2 = ClassT;
export declare type SpecificResourceT = {
id?: IdT;
type?: TypeT;
format?: FormatT;
accessibility?: AccessibilityT;
source: SourceT;
selector?: SelectorT;
language?: LanguageT;
};
export declare type StartIndexT = number;
export declare type StartT = ClassT;
export declare type StringsT = string | string[];
export declare type SuffixT = string;
export declare type SummaryT = LngStringT;
export declare type TargetT = AnnotationTargetT | AnnotationTargetT[];
export declare type ThumbnailT = ResourceT;
export declare type TotalT = number;
export declare type TransformationT = {
type?: TypeT;
options?: OptionsT;
};
export declare type ValueT = string;
export declare type ViewingDirectionT = string;
export declare type WidthT = number;
export declare type CollectionT = {
context?: ContextT;
id: IdT;
type: TypeT;
label: LabelT;
metadata?: MetadataT[];
summary?: SummaryT;
requiredStatement?: RequiredStatementT;
thumbnail?: ThumbnailT[];
rendering?: RenderingT[];
rights?: RightsT;
seeAlso?: SeeAlsoT[];
homepage?: HomepageT[];
provider?: ProviderT[];
navDate?: NavDateT;
behavior?: BehaviorT[];
partOf?: PartOfT[];
service?: ServiceT;
services?: ServiceT;
placeholderCanvas?: PlaceholderCanvasT;
accompanyingCanvas?: AccompanyingCanvasT;
navPlace?: NavPlaceT;
items?: SpecificationT[];
};
export declare type ManifestT = {
context?: ContextT;
id: IdT;
type: TypeT;
label: LabelT;
metadata?: MetadataT[];
service?: ServiceT;
services?: ServiceT;
requiredStatement?: RequiredStatementT;
summary?: SummaryT;
thumbnail?: ThumbnailT[];
rendering?: RenderingT[];
viewingDirection?: ViewingDirectionT;
behavior?: BehaviorT[];
navDate?: NavDateT;
navPlace?: NavPlaceT;
rights?: RightsT;
seeAlso?: SeeAlsoT[];
homepage?: HomepageT[];
provider?: ProviderT[];
partOf?: PartOfT[];
start?: StartT;
items?: CanvasT[];
structures?: RangeT[];
annotations?: AnnotationPageT[];
};
export declare type SpecificationT = ManifestT | CollectionT;