UNPKG

@allmaps/iiif-parser

Version:

Allmaps IIIF parser

39 lines (38 loc) 2.7 kB
import { z } from 'zod'; import { PossibleLanguageValue2Schema, Metadata2Schema, MetadataItem2Schema, Thumbnail2Schema, Rendering2Schema, Related2Schema, Attribution2Schema } from '../schemas/presentation.2.js'; import { LanguageValue3Schema, Metadata3Schema, MetadataItem3Schema } from '../schemas/presentation.3.js'; import type { LanguageString, Metadata, MetadataItem, RequiredStatement, Thumbnail, Rendering, Homepage } from './types.js'; type Metadata2 = z.infer<typeof Metadata2Schema>; type MetadataItem2 = z.infer<typeof MetadataItem2Schema>; type Metadata3 = z.infer<typeof Metadata3Schema>; type MetadataItem3 = z.infer<typeof MetadataItem3Schema>; export declare const LanguageString3Schema: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>; export declare const MetadataStringItem3Schema: z.ZodObject<{ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>; value: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>; }, "strip", z.ZodTypeAny, { value?: Record<string, string[]> | undefined; label?: Record<string, string[]> | undefined; }, { value?: Record<string, string[]> | undefined; label?: Record<string, string[]> | undefined; }>; type LanguageValue3 = z.infer<typeof LanguageValue3Schema>; type PossibleLanguageValue2 = z.infer<typeof PossibleLanguageValue2Schema>; type Thumbnail2 = z.infer<typeof Thumbnail2Schema>; type Rendering2 = z.infer<typeof Rendering2Schema>; type Related2 = z.infer<typeof Related2Schema>; type Attribution2 = z.infer<typeof Attribution2Schema>; export declare function ensureArray<T>(val: T | T[]): T[] | undefined; export declare function parseVersion2String(str?: PossibleLanguageValue2): LanguageString | undefined; export declare function parseVersion3String(str?: LanguageValue3): LanguageString | undefined; export declare function parseMetadata2Item(item?: MetadataItem2): MetadataItem | undefined; export declare function parseMetadata3Item(item?: MetadataItem3): MetadataItem | undefined; export declare function isValidMetadataItem(item?: MetadataItem): item is MetadataItem; export declare function parseVersion2Metadata(metadata?: Metadata2): Metadata | undefined; export declare function parseVersion3Metadata(metadata?: Metadata3): Metadata | undefined; export declare function parseVersion2Attribution(attribution?: Attribution2): RequiredStatement | undefined; export declare function parseVersion2Thumbnail(thumbnail2?: Thumbnail2): Thumbnail | undefined; export declare function parseVersion2Rendering(rendering2?: Rendering2): Rendering | undefined; export declare function parseVersion2Related(related?: Related2): Homepage | undefined; export {};