UNPKG

@readium/shared

Version:

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

102 lines (101 loc) 3.44 kB
import { BelongsTo } from './BelongsTo'; import { Contributors } from './Contributor'; import { LocalizedString } from './LocalizedString'; import { ReadingProgression } from './ReadingProgression'; import { Subjects } from './Subject'; /** * https://readium.org/webpub-manifest/schema/metadata.schema.json * * readingProgression : This contains the reading progression as declared in the * publication, so it might be [auto]. To lay out the content, use [effectiveReadingProgression] * to get the calculated reading progression from the declared direction and the language. * otherMetadata Additional metadata for extensions, as a JSON dictionary. */ export declare class Metadata { title: LocalizedString; typeUri?: string; identifier?: string; subtitle?: LocalizedString; sortAs?: LocalizedString; artists?: Contributors; authors?: Contributors; colorists?: Contributors; contributors?: Contributors; editors?: Contributors; illustrators?: Contributors; inkers?: Contributors; letterers?: Contributors; narrators?: Contributors; pencilers?: Contributors; translators?: Contributors; languages?: Array<string>; description?: string; publishers?: Contributors; imprints?: Contributors; published?: Date; modified?: Date; subjects?: Subjects; belongsTo?: BelongsTo; belongsToCollections?: Contributors; belongsToSeries?: Contributors; readingProgression?: ReadingProgression; duration?: number; numberOfPages?: number; otherMetadata?: { [key: string]: any; }; /**All metadata not in otherMetadata */ private static readonly mappedProperties; /** Creates [Metadata] object */ constructor(values: { title: LocalizedString; typeUri?: string; identifier?: string; subtitle?: LocalizedString; sortAs?: LocalizedString; artists?: Contributors; authors?: Contributors; colorists?: Contributors; contributors?: Contributors; editors?: Contributors; illustrators?: Contributors; inkers?: Contributors; letterers?: Contributors; narrators?: Contributors; pencilers?: Contributors; translators?: Contributors; languages?: Array<string>; description?: string; publishers?: Contributors; imprints?: Contributors; published?: Date; modified?: Date; subjects?: Subjects; belongsTo?: BelongsTo; belongsToCollections?: Contributors; belongsToSeries?: Contributors; readingProgression?: ReadingProgression; duration?: number; numberOfPages?: number; otherMetadata?: { [key: string]: any; }; }); /** * Parses a [Metadata] from its RWPM JSON representation. * * If the metadata can't be parsed, a warning will be logged with [warnings]. */ static deserialize(json: any): Metadata | undefined; /** * Serializes a [Metadata] to its RWPM JSON representation. */ serialize(): any; /** * Computes a [ReadingProgression] when the value of [readingProgression] is set to * auto, using the publication language. * * See this issue for more details: https://github.com/readium/architecture/issues/113 */ get effectiveReadingProgression(): ReadingProgression; }