UNPKG

@readium/shared

Version:

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

96 lines (95 loc) 3.14 kB
import { EPUBLayout } from '../epub/EPUBLayout'; /** * Suggested orientation for the device when displaying the linked resource. */ export declare enum Orientation { auto = "auto", landscape = "landscape", portrait = "portrait" } /** * Suggested method for handling overflow while displaying the linked resource. */ export declare enum Overflow { auto = "auto", clipped = "clipped", paginated = "paginated", scrolled = "scrolled" } /** * Indicates how the linked resource should be displayed in a reading environment that displays * synthetic spreads. */ export declare enum Page { left = "left", right = "right", center = "center" } /** * Indicates the condition to be met for the linked resource to be rendered within a synthetic * spread. */ export declare enum Spread { auto = "auto", both = "both", none = "none", landscape = "landscape" } /** * Suggested method for constraining a resource inside the viewport. */ export declare enum Fit { contain = "contain", cover = "cover", width = "width", height = "height" } /** The Presentation Hints extension defines a number of hints for User Agents about the way content * should be presented to the user. * * https://readium.org/webpub-manifest/extensions/presentation.html * https://readium.org/webpub-manifest/schema/extensions/presentation/metadata.schema.json * * These properties can be undefined to avoid having default values when it doesn't make sense for a * given `Publication`. If a navigator needs a default value when not specified, * `Presentation.defaultX` and `Presentation.X.default` can be used. */ export declare class Presentation { /** Specifies whether or not the parts of a linked resource that flow out of the viewport are clipped */ clipped?: boolean; /** Suggested method for constraining a resource inside the viewport. */ fit?: Fit; /** Suggested orientation for the device when displaying the linked resource. */ orientation?: Orientation; /** Indicates the condition to be met for the linked resource to be rendered * within a synthetic spread */ spread?: Spread; /** Hint about the nature of the layout for the linked resources (EPUB extension). */ layout?: EPUBLayout; /** Indicates how the progression between resources from the [readingOrder] should be handled */ continuous?: boolean; /** Indicates if the overflow of linked resources from the `readingOrder` or `resources` should * be handled using dynamic pagination or scrolling. */ overflow?: Overflow; /** Creates a [Presentation]. */ constructor(values: { clipped?: boolean; continuous?: boolean; fit?: Fit; orientation?: Orientation; overflow?: Overflow; spread?: Spread; layout?: EPUBLayout; }); /** * Parses a [Presentation] from its RWPM JSON representation. * */ static deserialize(json: any): Presentation | undefined; /** * Serializes a [Presentation] to its RWPM JSON representation. */ serialize(): any; }