UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

100 lines 5.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Transition = void 0; class Transition { constructor(data) { let autoScrollDefault = false; this.autoScroll = typeof (data === null || data === void 0 ? void 0 : data.autoScroll) !== "undefined" ? data === null || data === void 0 ? void 0 : data.autoScroll : autoScrollDefault; let autoScrollTimeDefault = 0; this.autoScrollTime = typeof (data === null || data === void 0 ? void 0 : data.autoScrollTime) !== "undefined" ? data === null || data === void 0 ? void 0 : data.autoScrollTime : autoScrollTimeDefault; let directionDefault = "none"; this.direction = typeof (data === null || data === void 0 ? void 0 : data.direction) !== "undefined" ? data === null || data === void 0 ? void 0 : data.direction : directionDefault; let durationDefault = 1; this.duration = typeof (data === null || data === void 0 ? void 0 : data.duration) !== "undefined" ? data === null || data === void 0 ? void 0 : data.duration : durationDefault; let flyAreaOpaqueDefault = false; this.flyAreaOpaque = typeof (data === null || data === void 0 ? void 0 : data.flyAreaOpaque) !== "undefined" ? data === null || data === void 0 ? void 0 : data.flyAreaOpaque : flyAreaOpaqueDefault; let flyScaleDefault = 1; this.flyScale = typeof (data === null || data === void 0 ? void 0 : data.flyScale) !== "undefined" ? data === null || data === void 0 ? void 0 : data.flyScale : flyScaleDefault; let pagesDefault = ""; this.pages = typeof (data === null || data === void 0 ? void 0 : data.pages) !== "undefined" ? data === null || data === void 0 ? void 0 : data.pages : pagesDefault; let styleDefault = "none"; this.style = typeof (data === null || data === void 0 ? void 0 : data.style) !== "undefined" ? data === null || data === void 0 ? void 0 : data.style : styleDefault; } static getAutoScrollDefault() { return false; } static getAutoScrollDescription() { return "If true, the next page to be automatically shown completely in full screen presentation mode after a specific time."; } static getAutoScrollTimeDefault() { return 0; } static getAutoScrollTimeDescription() { return "The time it will take for the next page to be automatically shown completely in full screen presentation mode."; } static getAutoScrollTimeMin() { return 0; } static getDirectionDefault() { return "none"; } static getDirectionDescription() { return "The direction of the transition animation (provided that it can be applied to the animation).\n\n* leftToRight = From left to right\n* bottomToTop = From bottom to top\n* rightToLeft = From right to left\n* topToBottom = From top to bottom\n* topLeftToBottomRight = From top left to bottom right\n* none = Use the default value for the animation"; } static getDurationDefault() { return 1; } static getDurationDescription() { return "The page transition animation's duration, in seconds. Make sure to avoid excessively high values, as certain reader programs will force the entire animation to be displayed without any option for interrupting it. Moreover, an excessively long animation can result in display and execution errors in the reader program. Values under 10 seconds are recommendable."; } static getDurationMin() { return 0; } static getFlyAreaOpaqueDefault() { return false; } static getFlyAreaOpaqueDescription() { return "Option for the \"fly\" animation style - used to define whether the page background for the page that flies in should be transparent initially."; } static getFlyScaleDefault() { return 1; } static getFlyScaleDescription() { return "Option for the \"fly\" animation style - used to define the starting scale for the page that flies in. The page will smoothly be scaled from this starting scale all the way to the size of the page being displayed."; } static getPagesDefault() { return ""; } static getPagesDescription() { return "Used to define the page number or page range (e.g., \"1,5-6,9\") to which the transition animation should be applied."; } static getStyleDefault() { return "none"; } static getStyleDescription() { return "The style of transition animation.\n\n* blinds = Crossfades\n* box = Crossfades in a rectangular pattern\n* cover = Covers\n* dissolve = Dissolves\n* fade = Fades\n* fly = Page flies in\n* glitter = Page dissolves and is replaced\n* push = Page is pushed out\n* split = Splits page\n* uncover = Uncovers page\n* wipe = Wipes page\n* none = No special effect"; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new Transition(data); } toJson() { return { 'autoScroll': this.autoScroll, 'autoScrollTime': this.autoScrollTime, 'direction': this.direction, 'duration': this.duration, 'flyAreaOpaque': this.flyAreaOpaque, 'flyScale': this.flyScale, 'pages': this.pages, 'style': this.style, }; } clone() { return Transition.fromJson(this.toJson()); } } exports.Transition = Transition; //# sourceMappingURL=Transition.js.map