UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

103 lines 10.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SyntaxHighlight = void 0; class SyntaxHighlight { constructor(data) { let availableDefault = ""; this.available = typeof (data === null || data === void 0 ? void 0 : data.available) !== "undefined" ? data === null || data === void 0 ? void 0 : data.available : availableDefault; let fontFamilyDefault = ""; this.fontFamily = typeof (data === null || data === void 0 ? void 0 : data.fontFamily) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fontFamily : fontFamilyDefault; let fontOriginDefault = "system"; this.fontOrigin = typeof (data === null || data === void 0 ? void 0 : data.fontOrigin) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fontOrigin : fontOriginDefault; let fontSizeDefault = "10px"; this.fontSize = typeof (data === null || data === void 0 ? void 0 : data.fontSize) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fontSize : fontSizeDefault; let languageDefault = ""; this.language = typeof (data === null || data === void 0 ? void 0 : data.language) !== "undefined" ? data === null || data === void 0 ? void 0 : data.language : languageDefault; let lineHeightDefault = "12px"; this.lineHeight = typeof (data === null || data === void 0 ? void 0 : data.lineHeight) !== "undefined" ? data === null || data === void 0 ? void 0 : data.lineHeight : lineHeightDefault; let lineNumbersDefault = true; this.lineNumbers = typeof (data === null || data === void 0 ? void 0 : data.lineNumbers) !== "undefined" ? data === null || data === void 0 ? void 0 : data.lineNumbers : lineNumbersDefault; let relevanceDefault = 90; this.relevance = typeof (data === null || data === void 0 ? void 0 : data.relevance) !== "undefined" ? data === null || data === void 0 ? void 0 : data.relevance : relevanceDefault; let wordBreakDefault = "auto"; this.wordBreak = typeof (data === null || data === void 0 ? void 0 : data.wordBreak) !== "undefined" ? data === null || data === void 0 ? void 0 : data.wordBreak : wordBreakDefault; } static getAvailableDefault() { return ""; } static getAvailableDescription() { return "Can be used to specify the languages to which the syntax highlighted should be limited. You can enter multiple languages by separating them with a comma (\"java,cpp\"). If you do not specify a value, all the languages listed below will be recognized. You can select any of the following languages:\n\n* abnf = Augmented Backus-Naur form\n* accesslog = Apache\/Nginx Access Logs\n* actionscript = ActionScript\n* ada = Ada\n* angelscript = AngelScript\n* apache = Apache configuration language\n* applescript = AppleScript\n* arcade = ArcGIS Arcade\n* arduino = Arduino\n* armasm = ARM Assembly\n* asciidoc = AsciiDoc\n* aspectj = AspectJ\n* autohotkey = AutoHotkey\n* autoit = AutoIt\n* avrasm = AVR Assembler\n* awk = Awk\n* axapta = Axapta\n* bash = Bash\n* basic = Basic\n* bnf = Backus-Naur Form\n* brainfuck = Brainfuck\n* cal = C\/AL\n* capnproto = Cap'n Proto\n* ceylon = Ceylon\n* clean = Clean\n* clojure-repl = Clojure REPL\n* clojure = Clojure\n* cmake = CMake\n* coffeescript = CoffeeScript\n* coq = Coq\n* cos = Cach\u00E9 Object Script\n* cpp = C++\n* crmsh = crmsh\n* crystal = Crystal\n* cs = C#\n* csp = CSP\n* css = CSS\n* d = D\n* dart = Dart\n* delphi = Delphi\n* diff = Diff\n* django = Django\n* dns = DNS Zone file\n* dockerfile = Dockerfile\n* dos = DOS .bat\n* dsconfig = dsconfig\n* dts = Device Tree\n* dust = Dust\n* ebnf = Extended Backus-Naur Form\n* elixir = Elixir\n* elm = Elm\n* erb = Embedded Ruby\n* erlang-repl = Erlang REPL\n* erlang = Erlang\n* excel = Excel\n* fix = FIX\n* flix = FLIX\n* fortran = Fortran\n* fsharp = F#\n* gams = GAMS\n* gauss = GAUSS\n* gcode = G-code\n* gherkin = Gherkin\n* glsl = GLSL\n* gml = GML\n* go = Go\n* golo = Golo\n* gradle = Gradle\n* groovy = Groovy\n* haml = Haml\n* arduino = Arduino\n* handlebars = Handlebars\n* haskell = Haskell\n* haxe = Haxe\n* hsp = HSP\n* htmlbars = HTMLBars\n* http = HTTP\n* hy = Hy\n* inform7 = Inform 7\n* arduino = Ini, TOML\n* irpf90 = IRPF90\n* isbl = ISBL\n* java = Java\n* javascript = Javascript\n* jboss-cli = jboss-cli\n* json = JSON\n* julia-repl = Julia REPL\n* julia = Julia\n* kotlin = Kotlin\n* lasso = Lasso\n* ldif = LDIF\n* leaf = Leaf\n* less = Less\n* lisp = Lisp\n* livecodeserver = LiveCode\n* livescript = LiveScript\n* llvm = LLVM IR\n* lsl = Linden Scripting Language\n* lua = Lua\n* makefile = Makefile\n* markdown = Markdown\n* mathematica = Mathematica\n* matlab = Matlab\n* maxima = Maxima\n* mel = MEL\n* mercury = Mercury\n* mipsasm = MIPS Assembly\n* mizar = Mizar\n* mojolicious = Mojolicious\n* monkey = Monkey\n* moonscript = MoonScript\n* n1ql = N1QL\n* nginx = Nginx\n* nimrod = Nimrod\n* nix = Nix\n* nsis = NSIS\n* objectivec = Objective-C\n* ocaml = OCaml\n* openscad = OpenSCAD\n* oxygene = Oxygene\n* parser3 = Parser3\n* perl = Perl\n* pf = pf\n* pgsql = PostgreSQL\n* php = PHP\n* plaintext = plaintext\n* pony = Pony\n* powershell = PowerShell\n* processing = Processing\n* profile = Python profile\n* prolog = Prolog\n* properties = Properties\n* protobuf = Protocol Buffers\n* puppet = Puppet\n* purebasic = PureBASIC\n* python = Python\n* q = Q\n* qml = QML\n* r = R\n* reasonml = ReasonML\n* rib = RenderMan RIB\n* roboconf = Roboconf\n* routeros = Microtik RouterOS Script\n* rsl = RenderMan RSL\n* ruby = Ruby\n* ruleslanguage = Oracle Rules Language\n* rust = Rust\n* sas = SAS\n* scala = Scala\n* scheme = Scheme\n* scilab = Scilab\n* scss = SCSS\n* shell = Shell Session\n* smali = Smali\n* smalltalk = Smalltalk\n* sml = SML\n* sqf = SQF\n* sql = SQL\n* stan = Stan\n* stata = Stata\n* step21 = Step Part 21\n* stylus = Stylus\n* subunit = SubUnit\n* swift = Swift\n* taggerscript = Tagger Script\n* tap = Test Anything Protocol\n* tcl = Tcl\n* tex = TeX\n* thrift = Thrift\n* tp = TP\n* twig = Twig\n* typescript = TypeScript\n* vala = Vala\n* vbnet = VB.NET\n* vbscript-html = VBScript in HTML\n* vbscript = VBScript\n* verilog = Verilog\n* vhdl = VHDL\n* vim = Vim Script\n* x86asm = Intel x86 Assembly\n* xl = XL\n* xml = XML\n* xquery = XQuery\n* yaml = YAML\n* zephir = Zephir"; } static getFontFamilyDefault() { return ""; } static getFontFamilyDescription() { return "Used to specify the font that should be used for syntax highlighting. If you select \"folder\" for the \"fontOrigin\" parameter, the font here needs to be specified with the filename for the file. Otherwise, use the name of the font you want. If the value is left blank, the \"Fira Code\" font will be used automatically."; } static getFontOriginDefault() { return "system"; } static getFontOriginDescription() { return "Used to specify whether the selected font should be obtained from your operating system or from the \"templates\/fonts\" folder (in your webPDF installation path). Possible values:\n\n* system = It will be possible to select from the fonts available system-wide.\n* folder =It will be possible to select from the fonts in \"templates\/fonts\"."; } static getFontSizeDefault() { return "10px"; } static getFontSizeDescription() { return "Used to set the font size for syntax highlighting to the specified value. You can use any of the following units:\n\n* px = Pixels\n* cm = Centimeters\n* mm = Millimeters\n* in = Inches\n* pt = Points\n* pc = Pica"; } static getLanguageDefault() { return ""; } static getLanguageDescription() { return "Used to select a specific language for highlighting recognition. You can select one of the languages listed for the \"available\" parameter. If you do not set this value, the system will attempt to automatically select an appropriate language from the list of available languages."; } static getLineHeightDefault() { return "12px"; } static getLineHeightDescription() { return "Used to set the line height. You can use any of the following units:\n\n* px = Pixels\n* cm = Centimeters\n* mm = Millimeters\n* in = Inches\n* pt = Points\n* pc = Pica"; } static getLineNumbersDefault() { return true; } static getLineNumbersDescription() { return "If this value is set to \"true\", line numbers are added before the code."; } static getRelevanceDefault() { return 90; } static getRelevanceDescription() { return "The syntax highlighter evaluates the degree of reliability with which it recognizes a language with a value ranging from 0 to 1000 points. This value determines the reliability level starting from which it should highlight syntax for a recognized language. The higher the value, the more closely the content found must match the criteria."; } static getWordBreakDefault() { return "auto"; } static getWordBreakDescription() { return "Can be used to configure the word wrap behaviour during highlighting Possible values:\n\n* auto = Automatic word wrap if necessary.\n* none = Suppress the addition of extra line breaks.\n* word = Line breaks allowed only after words.\n* all = Line breaks allowed unconditionally."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new SyntaxHighlight(data); } toJson() { return { 'available': this.available, 'fontFamily': this.fontFamily, 'fontOrigin': this.fontOrigin, 'fontSize': this.fontSize, 'language': this.language, 'lineHeight': this.lineHeight, 'lineNumbers': this.lineNumbers, 'relevance': this.relevance, 'wordBreak': this.wordBreak, }; } clone() { return SyntaxHighlight.fromJson(this.toJson()); } } exports.SyntaxHighlight = SyntaxHighlight; //# sourceMappingURL=SyntaxHighlight.js.map