|
- import type { OneOrMore, OneOrMoreIncluding, ZeroOrMore } from './multiplicity-utils.js';
- /**
- * A Web Annotation object.
- *
- * This is an interpretation of the Web Annotation Data Model:
- * <https://www.w3.org/TR/2017/REC-annotation-model-20170223/>
- *
- * TODO Deal more systemically with ‘relations’, i.e. values that could be
- * either a nested object or a URI referring to such an object.
- */
- export interface WebAnnotation {
- '@context': OneOrMoreIncluding<string, 'http://www.w3.org/ns/anno.jsonld'>;
- type: OneOrMoreIncluding<string, 'Annotation'>;
- id: string;
- target: OneOrMore<Target>;
- creator?: OneOrMore<Agent>;
- created?: UtcDateTime;
- generator?: OneOrMore<Agent>;
- generated?: UtcDateTime;
- modified?: UtcDateTime;
- motivation?: OneOrMore<Motivation>;
- audience?: ZeroOrMore<Audience>;
- rights?: ZeroOrMore<string>;
- canonical?: string;
- via?: ZeroOrMore<string>;
- body?: BodyChoice | OneOrMore<Body>;
- bodyValue?: string;
- }
- /**
- * A slightly stricter type for WebAnnotation, not allowing both a body and bodyValue.
- */
- export declare type WebAnnotationStrict = WebAnnotation & (WithBody | WithBodyValue | WithoutBody);
- interface WithBody {
- body: BodyChoice | OneOrMore<Body>;
- bodyValue?: undefined;
- }
- interface WithBodyValue {
- body?: undefined;
- bodyValue: string;
- }
- interface WithoutBody {
- body?: undefined;
- bodyValue?: undefined;
- }
- export declare type Body = string | BodyObject;
- export declare type BodyObject = {
- creator?: OneOrMore<Agent>;
- created?: UtcDateTime;
- modified?: UtcDateTime;
- purpose?: OneOrMore<Motivation>;
- } & (TextualBody | SpecificResource | ExternalResource);
- export declare type Target = string | SpecificResource | ExternalResource;
- export declare type Agent = string | {
- id?: string;
- type?: OneOrMore<'Person' | 'Organization' | 'Software'>;
- name?: OneOrMore<string>;
- nickname?: OneOrMore<string>;
- email?: OneOrMore<string>;
- email_sha1?: OneOrMore<string>;
- homepage?: OneOrMore<string>;
- };
- export declare type Audience = string | {
- id?: string;
- type?: string;
- };
- export interface BodyChoice {
- type: 'Choice';
- items: Body[];
- }
- export interface TextualBody extends Omit<ExternalResource, 'id' | 'type'> {
- id?: string;
- type: 'TextualBody';
- value: string;
- }
- export interface SpecificResource {
- id?: string;
- type?: 'SpecificResource';
- source: string;
- selector?: string | OneOrMore<Selector>;
- accessibility?: AccessibilityFeatures;
- rights?: ZeroOrMore<string>;
- canonical?: string;
- via?: ZeroOrMore<string>;
- }
- export interface Selector {
- type?: string;
- refinedBy?: Selector;
- }
- export interface ExternalResource {
- id: string;
- type?: OneOrMore<'Dataset' | 'Image' | 'Video' | 'Sound' | 'Text'>;
- format?: OneOrMore<string>;
- language?: OneOrMore<string>;
- processingLanguage?: string;
- textDirection?: 'ltr' | 'rtl' | 'auto';
- accessibility?: AccessibilityFeatures;
- rights?: ZeroOrMore<string>;
- canonical?: string;
- via?: ZeroOrMore<string>;
- }
- export declare type Motivation = 'assessing' | 'bookmarking' | 'classifying' | 'commenting' | 'describing' | 'editing' | 'highlighting' | 'identifying' | 'linking' | 'moderating' | 'questioning' | 'replying' | 'tagging';
- declare type UtcDateTime = `${string}Z`;
- declare global {
- interface Date {
- toISOString(): UtcDateTime;
- }
- }
- export declare type AccessibilityFeatures = ZeroOrMore<AccessibilityFeature> | 'none' | ['none'];
- export declare type AccessibilityFeature = 'annotations' | 'ARIA' | 'bookmarks' | 'index' | 'printPageNumbers' | 'readingOrder' | 'structuralNavigation' | 'tableOfContents' | 'taggedPDF' | 'alternativeText' | 'audioDescription' | 'captions' | 'describedMath' | 'longDescription' | 'rubyAnnotations' | 'signLanguage' | 'transcript' | 'displayTransformability' | 'synchronizedAudioText' | 'timingControl' | 'unlocked' | 'ChemML' | 'latex' | 'MathML' | 'ttsMarkup' | 'highContrastAudio' | 'highContrastDisplay' | 'largePrint' | 'braille' | 'tactileGraphic' | 'tactileObject';
- export {};
|