@allmaps/annotation
Version:
Functions for generating and parsing IIIF georeference annotations
64 lines (63 loc) • 3.26 kB
TypeScript
import { z } from 'zod';
export declare function ensureArray<T>(val: T | T[]): T[] | undefined;
export declare const LanguageValueSchema: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">>;
export declare const PointSchema: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
export declare const PointGeometrySchema: z.ZodObject<{
type: z.ZodLiteral<"Point">;
coordinates: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
}, "strip", z.ZodTypeAny, {
type: "Point";
coordinates: [number, number];
}, {
type: "Point";
coordinates: [number, number];
}>;
export declare const ResourceMaskSchema: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">;
export declare const ImageServiceSchema: z.ZodEnum<["ImageService1", "ImageService2", "ImageService3"]>;
export declare const ResourceTypeSchema: z.ZodEnum<["ImageService1", "ImageService2", "ImageService3", "Canvas"]>;
declare const basePartOfItemSchema: z.ZodObject<{
id: z.ZodString;
type: z.ZodString;
label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">>>;
}, "strip", z.ZodTypeAny, {
id: string;
type: string;
label?: Record<string, (string | number | boolean)[]> | undefined;
}, {
id: string;
type: string;
label?: Record<string, (string | number | boolean)[]> | undefined;
}>;
type PartOfItem = z.infer<typeof basePartOfItemSchema> & {
partOf?: PartOfItem[];
};
export declare const PartOfItemSchema: z.ZodType<PartOfItem>;
export declare const PartOfSchema: z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodType<PartOfItem, z.ZodTypeDef, PartOfItem>, "many">, z.ZodType<PartOfItem, z.ZodTypeDef, PartOfItem>]>, PartOfItem[] | undefined, PartOfItem | PartOfItem[]>;
export declare const TransformationSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
type: z.ZodEnum<["helmert", "polynomial", "thinPlateSpline", "projective", "straight", "linear"]>;
options: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
}, "strip", z.ZodTypeAny, {
type: "helmert" | "polynomial" | "thinPlateSpline" | "projective" | "straight" | "linear";
options?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
}, {
type: "helmert" | "polynomial" | "thinPlateSpline" | "projective" | "straight" | "linear";
options?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
}>, z.ZodUnknown]>, {
type: "helmert" | "polynomial" | "thinPlateSpline" | "projective" | "straight" | "linear";
options?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
} | undefined, unknown>;
export declare const ProjectionSchema: z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
definition: z.ZodUnion<[z.ZodString, z.ZodUnknown]>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
name?: string | undefined;
definition?: unknown;
}, {
id?: string | undefined;
name?: string | undefined;
definition?: unknown;
}>;
export declare const ContextSchema: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>;
export {};