UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

100 lines 5.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MetadataTransition = void 0; class MetadataTransition { 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 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 objectKeyDefault = ""; this.objectKey = typeof (data === null || data === void 0 ? void 0 : data.objectKey) !== "undefined" ? data === null || data === void 0 ? void 0 : data.objectKey : objectKeyDefault; let pageDefault = 0; this.page = typeof (data === null || data === void 0 ? void 0 : data.page) !== "undefined" ? data === null || data === void 0 ? void 0 : data.page : pageDefault; 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 "Whether or not the page is automatically flipped after a short period."; } 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 "Selects the duration in seconds, that the animation shall be played for."; } static getDurationMin() { return 0; } static getFlyAreaOpaqueDefault() { return false; } static getFlyAreaOpaqueDescription() { return "For a fly animation, this determines whether or not the opacity shall stay constantly opaque during the animation."; } static getFlyScaleDefault() { return 1; } static getFlyScaleDescription() { return "For a fly animation, this determines the initial scale of the page, when flying in."; } static getObjectKeyDefault() { return ""; } static getObjectKeyDescription() { return "The object ID of the transition definition. **Info:** A PDF object ID consists of two numbers, where the first number selects the object's number and the second the \"generation\" of the object. The object ID shall always be unique within the context of the document and can be used to select a specific object."; } static getPageDefault() { return 0; } static getPageDescription() { return "The page a transition shall be defined for."; } static getPageMin() { return 0; } 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 MetadataTransition(data); } toJson() { return { 'autoScroll': this.autoScroll, 'direction': this.direction, 'duration': this.duration, 'flyAreaOpaque': this.flyAreaOpaque, 'flyScale': this.flyScale, 'objectKey': this.objectKey, 'page': this.page, 'style': this.style, }; } clone() { return MetadataTransition.fromJson(this.toJson()); } } exports.MetadataTransition = MetadataTransition; //# sourceMappingURL=MetadataTransition.js.map