UNPKG

@readium/shared

Version:

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

57 lines (56 loc) 1.66 kB
import { Links } from './Link'; import { LocalizedString } from './LocalizedString'; /** * https://github.com/readium/webpub-manifest/tree/master/contexts/default#subjects */ export declare class Subject { /** Subject name. */ readonly name: LocalizedString; /** Provides a string that a machine can sort. */ readonly sortAs?: string; /** EPUB 3.1 opf:term. */ readonly code?: string; /** EPUB 3.1 opf:authority. */ readonly scheme?: string; /** PUsed to retrieve similar publications for the given subjects. */ readonly links?: Links; /** Creates a [Subject]. */ constructor(values: { name: LocalizedString; sortAs?: string; code?: string; scheme?: string; links?: Links; }); /** * Parses a [Subject] from its RWPM JSON representation. * * A [Subject] can be parsed from a single string, or a full-fledged object. */ static deserialize(json: any): Subject | undefined; /** * Serializes a [Subject] to its RWPM JSON representation. */ serialize(): any; } /** * https://github.com/readium/webpub-manifest/blob/master/schema/subject.schema.json * * Collection of [Subject] */ export declare class Subjects { /** * Array of [Subject] items. */ readonly items: Array<Subject>; /** Creates an Array of [Subject]. */ constructor(items: Array<Subject>); /** * Parses a [Subjects] from its RWPM JSON representation. */ static deserialize(json: any): Subjects | undefined; /** * Serializes a [Subjects] to its RWPM JSON representation. */ serialize(): any; }