UNPKG

@readium/shared

Version:

Shared models to be used across other Readium projects and implementations in Typescript

71 lines (70 loc) 2.43 kB
import { Links } from "./Link"; export interface Clip { audioResource: string; fragmentId?: string; start?: number; end?: number; } /** * Guided Navigation Document * https://readium.org/guided-navigation/schema/document.schema.json */ export declare class GuidedNavigationDocument { readonly links?: Links; readonly guided?: GuidedNavigationObject[]; constructor(values: { links?: Links; guided?: GuidedNavigationObject[]; }); static deserialize(json: any): GuidedNavigationDocument | undefined; serialize(): any; } /** * Guided Navigation Object * https://github.com/readium/guided-navigation/blob/main/schema/object.schema.json */ export declare class GuidedNavigationObject { /** References an audio resource or a fragment of it. */ readonly audioref?: string; /** Items that are children of the containing Guided Navigation Object. */ readonly children?: GuidedNavigationObject[]; /** References an image or a fragment of it. */ readonly imgref?: string; /** Convey the structural semantics of a publication. */ readonly role?: Set<string>; /** Textual equivalent of the resources or fragment of the resources referenced by the current Guided Navigation Object. */ readonly text?: string; /** References a textual resource or a fragment of it. */ readonly textref?: string; /** * Creates a [GuidedNavigation] object. */ constructor(values: { audioref?: string; children?: GuidedNavigationObject[]; imgref?: string; role?: Set<string>; text?: string; textref?: string; }); /** * Parses a [GuidedNavigationObject] from its RWPM JSON representation. * * A GuidedNavigationObject can be parsed from a single string, or a full-fledged object. */ static deserialize(json: any): GuidedNavigationObject | undefined; /** * Parses a [GuidedNavigationObject] array from its RWPM JSON representation. */ static deserializeArray(json: any): GuidedNavigationObject[] | undefined; /** * Serializes a [GuidedNavigationObject] to its RWPM JSON representation. */ serialize(): any; get audioFile(): string | undefined; get audioTime(): string | undefined; get textFile(): string | undefined; get fragmentId(): string | undefined; get clip(): Clip | undefined; private parseTimer; }