@vaadin-component-factory/vcf-pdf-viewer 0.9.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/README.md +1 -1
  2. package/package.json +42 -26
  3. package/{src/display → pdfjs/dist}/display_utils.js +344 -139
  4. package/{src/display → pdfjs/dist}/fetch_stream.js +115 -97
  5. package/pdfjs/dist/l10n_utils.js +140 -0
  6. package/{src/shared → pdfjs/dist}/message_handler.js +243 -259
  7. package/{src/display → pdfjs/dist}/network.js +149 -87
  8. package/{src/display/content_disposition.js → pdfjs/dist/network_utils.js} +167 -55
  9. package/{src/display → pdfjs/dist}/node_stream.js +133 -98
  10. package/pdfjs/dist/pdf.js +12778 -0
  11. package/pdfjs/dist/pdf_link_service.js +638 -0
  12. package/pdfjs/dist/pdf_rendering_queue.js +199 -0
  13. package/pdfjs/dist/pdf_thumbnail_viewer.js +819 -0
  14. package/pdfjs/dist/pdf_viewer.js +3598 -0
  15. package/pdfjs/dist/ui_utils.js +1033 -0
  16. package/{src/shared → pdfjs/dist}/util.js +301 -287
  17. package/pdfjs/dist/worker.js +62813 -0
  18. package/src/vcf-pdf-viewer.js +98 -46
  19. package/theme/lumo/vcf-pdf-viewer-styles.js +4 -4
  20. package/theme/material/vcf-pdf-viewer-styles.js +4 -4
  21. package/theme/material/vcf-pdf-viewer.js +2 -2
  22. package/src/core/.eslintrc +0 -13
  23. package/src/core/annotation.js +0 -2948
  24. package/src/core/arithmetic_decoder.js +0 -182
  25. package/src/core/ascii_85_stream.js +0 -98
  26. package/src/core/ascii_hex_stream.js +0 -79
  27. package/src/core/base_stream.js +0 -110
  28. package/src/core/bidi.js +0 -438
  29. package/src/core/calibri_factors.js +0 -308
  30. package/src/core/catalog.js +0 -1459
  31. package/src/core/ccitt.js +0 -1062
  32. package/src/core/ccitt_stream.js +0 -60
  33. package/src/core/cff_font.js +0 -116
  34. package/src/core/cff_parser.js +0 -1949
  35. package/src/core/charsets.js +0 -119
  36. package/src/core/chunked_stream.js +0 -557
  37. package/src/core/cmap.js +0 -1039
  38. package/src/core/colorspace.js +0 -1533
  39. package/src/core/core_utils.js +0 -464
  40. package/src/core/crypto.js +0 -1900
  41. package/src/core/decode_stream.js +0 -170
  42. package/src/core/decrypt_stream.js +0 -59
  43. package/src/core/default_appearance.js +0 -99
  44. package/src/core/document.js +0 -1456
  45. package/src/core/encodings.js +0 -301
  46. package/src/core/evaluator.js +0 -4601
  47. package/src/core/file_spec.js +0 -108
  48. package/src/core/flate_stream.js +0 -402
  49. package/src/core/font_renderer.js +0 -882
  50. package/src/core/fonts.js +0 -3260
  51. package/src/core/fonts_utils.js +0 -221
  52. package/src/core/function.js +0 -1257
  53. package/src/core/glyf.js +0 -706
  54. package/src/core/glyphlist.js +0 -4558
  55. package/src/core/helvetica_factors.js +0 -353
  56. package/src/core/image.js +0 -802
  57. package/src/core/image_utils.js +0 -291
  58. package/src/core/jbig2.js +0 -2572
  59. package/src/core/jbig2_stream.js +0 -73
  60. package/src/core/jpeg_stream.js +0 -105
  61. package/src/core/jpg.js +0 -1416
  62. package/src/core/jpx.js +0 -2343
  63. package/src/core/jpx_stream.js +0 -87
  64. package/src/core/liberationsans_widths.js +0 -221
  65. package/src/core/lzw_stream.js +0 -150
  66. package/src/core/metadata_parser.js +0 -146
  67. package/src/core/metrics.js +0 -2970
  68. package/src/core/murmurhash3.js +0 -139
  69. package/src/core/myriadpro_factors.js +0 -290
  70. package/src/core/name_number_tree.js +0 -153
  71. package/src/core/object_loader.js +0 -149
  72. package/src/core/opentype_file_builder.js +0 -154
  73. package/src/core/operator_list.js +0 -734
  74. package/src/core/parser.js +0 -1416
  75. package/src/core/pattern.js +0 -985
  76. package/src/core/pdf_manager.js +0 -217
  77. package/src/core/predictor_stream.js +0 -238
  78. package/src/core/primitives.js +0 -402
  79. package/src/core/ps_parser.js +0 -272
  80. package/src/core/run_length_stream.js +0 -61
  81. package/src/core/segoeui_factors.js +0 -308
  82. package/src/core/standard_fonts.js +0 -817
  83. package/src/core/stream.js +0 -103
  84. package/src/core/struct_tree.js +0 -335
  85. package/src/core/to_unicode_map.js +0 -103
  86. package/src/core/type1_font.js +0 -421
  87. package/src/core/type1_parser.js +0 -776
  88. package/src/core/unicode.js +0 -1649
  89. package/src/core/worker.js +0 -848
  90. package/src/core/worker_stream.js +0 -135
  91. package/src/core/writer.js +0 -278
  92. package/src/core/xfa/bind.js +0 -652
  93. package/src/core/xfa/builder.js +0 -207
  94. package/src/core/xfa/config.js +0 -1926
  95. package/src/core/xfa/connection_set.js +0 -202
  96. package/src/core/xfa/data.js +0 -82
  97. package/src/core/xfa/datasets.js +0 -76
  98. package/src/core/xfa/factory.js +0 -111
  99. package/src/core/xfa/fonts.js +0 -181
  100. package/src/core/xfa/formcalc_lexer.js +0 -385
  101. package/src/core/xfa/formcalc_parser.js +0 -1340
  102. package/src/core/xfa/html_utils.js +0 -639
  103. package/src/core/xfa/layout.js +0 -383
  104. package/src/core/xfa/locale_set.js +0 -345
  105. package/src/core/xfa/namespaces.js +0 -81
  106. package/src/core/xfa/parser.js +0 -184
  107. package/src/core/xfa/setup.js +0 -38
  108. package/src/core/xfa/signature.js +0 -40
  109. package/src/core/xfa/som.js +0 -338
  110. package/src/core/xfa/stylesheet.js +0 -40
  111. package/src/core/xfa/template.js +0 -6260
  112. package/src/core/xfa/text.js +0 -290
  113. package/src/core/xfa/unknown.js +0 -29
  114. package/src/core/xfa/utils.js +0 -217
  115. package/src/core/xfa/xdp.js +0 -59
  116. package/src/core/xfa/xfa_object.js +0 -1130
  117. package/src/core/xfa/xhtml.js +0 -543
  118. package/src/core/xfa_fonts.js +0 -208
  119. package/src/core/xml_parser.js +0 -507
  120. package/src/core/xref.js +0 -899
  121. package/src/display/annotation_layer.js +0 -2107
  122. package/src/display/annotation_storage.js +0 -113
  123. package/src/display/api.js +0 -3292
  124. package/src/display/base_factory.js +0 -180
  125. package/src/display/canvas.js +0 -2828
  126. package/src/display/font_loader.js +0 -484
  127. package/src/display/metadata.js +0 -41
  128. package/src/display/network_utils.js +0 -100
  129. package/src/display/node_utils.js +0 -83
  130. package/src/display/optional_content_config.js +0 -189
  131. package/src/display/pattern_helper.js +0 -659
  132. package/src/display/svg.js +0 -1709
  133. package/src/display/text_layer.js +0 -847
  134. package/src/display/transport_stream.js +0 -303
  135. package/src/display/worker_options.js +0 -40
  136. package/src/display/xfa_layer.js +0 -204
  137. package/src/doc_helper.js +0 -25
  138. package/src/images/logo.svg +0 -41
  139. package/src/interfaces.js +0 -169
  140. package/src/license_header.js +0 -14
  141. package/src/license_header_libre.js +0 -21
  142. package/src/pdf.image_decoders.js +0 -46
  143. package/src/pdf.js +0 -146
  144. package/src/pdf.sandbox.external.js +0 -181
  145. package/src/pdf.sandbox.js +0 -151
  146. package/src/pdf.scripting.js +0 -25
  147. package/src/pdf.worker.entry.js +0 -19
  148. package/src/pdf.worker.js +0 -23
  149. package/src/scripting_api/aform.js +0 -608
  150. package/src/scripting_api/app.js +0 -621
  151. package/src/scripting_api/color.js +0 -129
  152. package/src/scripting_api/common.js +0 -58
  153. package/src/scripting_api/console.js +0 -38
  154. package/src/scripting_api/constants.js +0 -208
  155. package/src/scripting_api/doc.js +0 -1195
  156. package/src/scripting_api/error.js +0 -23
  157. package/src/scripting_api/event.js +0 -232
  158. package/src/scripting_api/field.js +0 -620
  159. package/src/scripting_api/fullscreen.js +0 -145
  160. package/src/scripting_api/initialization.js +0 -223
  161. package/src/scripting_api/pdf_object.js +0 -24
  162. package/src/scripting_api/print_params.js +0 -146
  163. package/src/scripting_api/proxy.js +0 -139
  164. package/src/scripting_api/thermometer.js +0 -69
  165. package/src/scripting_api/util.js +0 -581
  166. package/src/shared/.eslintrc +0 -13
  167. package/src/shared/cffStandardStrings.js +0 -311
  168. package/src/shared/compatibility.js +0 -114
  169. package/src/shared/fonts_utils.js +0 -429
  170. package/src/shared/is_node.js +0 -27
  171. package/src/shared/scripting_utils.js +0 -85
  172. package/src/worker_loader.js +0 -32
@@ -1,621 +0,0 @@
1
- /* Copyright 2020 Mozilla Foundation
2
- *
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- */
15
-
16
- import { Color } from "./color.js";
17
- import { EventDispatcher } from "./event.js";
18
- import { FullScreen } from "./fullscreen.js";
19
- import { PDFObject } from "./pdf_object.js";
20
- import { Thermometer } from "./thermometer.js";
21
-
22
- const VIEWER_TYPE = "PDF.js";
23
- const VIEWER_VARIATION = "Full";
24
- const VIEWER_VERSION = "10.0";
25
- const FORMS_VERSION = undefined;
26
-
27
- class App extends PDFObject {
28
- constructor(data) {
29
- super(data);
30
-
31
- this._constants = null;
32
- this._focusRect = true;
33
- this._fs = null;
34
- this._language = App._getLanguage(data.language);
35
- this._openInPlace = false;
36
- this._platform = App._getPlatform(data.platform);
37
- this._runtimeHighlight = false;
38
- this._runtimeHighlightColor = ["T"];
39
- this._thermometer = null;
40
- this._toolbar = false;
41
-
42
- this._document = data._document;
43
- this._proxyHandler = data.proxyHandler;
44
- this._objects = Object.create(null);
45
- this._eventDispatcher = new EventDispatcher(
46
- this._document,
47
- data.calculationOrder,
48
- this._objects
49
- );
50
-
51
- this._timeoutIds = new WeakMap();
52
- if (typeof FinalizationRegistry !== "undefined") {
53
- // About setTimeOut/setInterval return values (specs):
54
- // The return value of this method must be held in a
55
- // JavaScript variable.
56
- // Otherwise, the timeout object is subject to garbage-collection,
57
- // which would cause the clock to stop.
58
- this._timeoutIdsRegistry = new FinalizationRegistry(
59
- this._cleanTimeout.bind(this)
60
- );
61
- } else {
62
- this._timeoutIdsRegistry = null;
63
- }
64
-
65
- this._timeoutCallbackIds = new Map();
66
- this._timeoutCallbackId = 0;
67
- this._globalEval = data.globalEval;
68
- this._externalCall = data.externalCall;
69
- this._document = data._document;
70
- }
71
-
72
- // This function is called thanks to the proxy
73
- // when we call app['random_string'] to dispatch the event.
74
- _dispatchEvent(pdfEvent) {
75
- this._eventDispatcher.dispatch(pdfEvent);
76
- }
77
-
78
- _registerTimeoutCallback(cExpr) {
79
- const id = this._timeoutCallbackId++;
80
- this._timeoutCallbackIds.set(id, cExpr);
81
- return id;
82
- }
83
-
84
- _unregisterTimeoutCallback(id) {
85
- this._timeoutCallbackIds.delete(id);
86
- }
87
-
88
- _evalCallback({ callbackId, interval }) {
89
- const expr = this._timeoutCallbackIds.get(callbackId);
90
- if (!interval) {
91
- this._unregisterTimeoutCallback(callbackId);
92
- }
93
-
94
- if (expr) {
95
- this._globalEval(expr);
96
- }
97
- }
98
-
99
- _registerTimeout(callbackId, interval) {
100
- const timeout = Object.create(null);
101
- const id = { callbackId, interval };
102
- this._timeoutIds.set(timeout, id);
103
- if (this._timeoutIdsRegistry) {
104
- this._timeoutIdsRegistry.register(timeout, id);
105
- }
106
- return timeout;
107
- }
108
-
109
- _unregisterTimeout(timeout) {
110
- if (this._timeoutIdsRegistry) {
111
- this._timeoutIdsRegistry.unregister(timeout);
112
- }
113
-
114
- const data = this._timeoutIds.get(timeout);
115
- if (!data) {
116
- return;
117
- }
118
-
119
- this._timeoutIds.delete(timeout);
120
- this._cleanTimeout(data);
121
- }
122
-
123
- _cleanTimeout({ callbackId, interval }) {
124
- this._unregisterTimeoutCallback(callbackId);
125
-
126
- if (interval) {
127
- this._externalCall("clearInterval", [callbackId]);
128
- } else {
129
- this._externalCall("clearTimeout", [callbackId]);
130
- }
131
- }
132
-
133
- static _getPlatform(platform) {
134
- if (typeof platform === "string") {
135
- platform = platform.toLowerCase();
136
- if (platform.includes("win")) {
137
- return "WIN";
138
- } else if (platform.includes("mac")) {
139
- return "MAC";
140
- }
141
- }
142
- return "UNIX";
143
- }
144
-
145
- static _getLanguage(language) {
146
- const [main, sub] = language.toLowerCase().split(/[-_]/);
147
- switch (main) {
148
- case "zh":
149
- if (sub === "cn" || sub === "sg") {
150
- return "CHS";
151
- }
152
- return "CHT";
153
- case "da":
154
- return "DAN";
155
- case "de":
156
- return "DEU";
157
- case "es":
158
- return "ESP";
159
- case "fr":
160
- return "FRA";
161
- case "it":
162
- return "ITA";
163
- case "ko":
164
- return "KOR";
165
- case "ja":
166
- return "JPN";
167
- case "nl":
168
- return "NLD";
169
- case "no":
170
- return "NOR";
171
- case "pt":
172
- if (sub === "br") {
173
- return "PTB";
174
- }
175
- return "ENU";
176
- case "fi":
177
- return "SUO";
178
- case "SV":
179
- return "SVE";
180
- default:
181
- return "ENU";
182
- }
183
- }
184
-
185
- get activeDocs() {
186
- return [this._document.wrapped];
187
- }
188
-
189
- set activeDocs(_) {
190
- throw new Error("app.activeDocs is read-only");
191
- }
192
-
193
- get calculate() {
194
- return this._document.obj.calculate;
195
- }
196
-
197
- set calculate(calculate) {
198
- this._document.obj.calculate = calculate;
199
- }
200
-
201
- get constants() {
202
- if (!this._constants) {
203
- this._constants = Object.freeze({
204
- align: Object.freeze({
205
- left: 0,
206
- center: 1,
207
- right: 2,
208
- top: 3,
209
- bottom: 4,
210
- }),
211
- });
212
- }
213
- return this._constants;
214
- }
215
-
216
- set constants(_) {
217
- throw new Error("app.constants is read-only");
218
- }
219
-
220
- get focusRect() {
221
- return this._focusRect;
222
- }
223
-
224
- set focusRect(val) {
225
- /* TODO or not */
226
- this._focusRect = val;
227
- }
228
-
229
- get formsVersion() {
230
- return FORMS_VERSION;
231
- }
232
-
233
- set formsVersion(_) {
234
- throw new Error("app.formsVersion is read-only");
235
- }
236
-
237
- get fromPDFConverters() {
238
- return [];
239
- }
240
-
241
- set fromPDFConverters(_) {
242
- throw new Error("app.fromPDFConverters is read-only");
243
- }
244
-
245
- get fs() {
246
- if (this._fs === null) {
247
- this._fs = new Proxy(
248
- new FullScreen({ send: this._send }),
249
- this._proxyHandler
250
- );
251
- }
252
- return this._fs;
253
- }
254
-
255
- set fs(_) {
256
- throw new Error("app.fs is read-only");
257
- }
258
-
259
- get language() {
260
- return this._language;
261
- }
262
-
263
- set language(_) {
264
- throw new Error("app.language is read-only");
265
- }
266
-
267
- get media() {
268
- return undefined;
269
- }
270
-
271
- set media(_) {
272
- throw new Error("app.media is read-only");
273
- }
274
-
275
- get monitors() {
276
- return [];
277
- }
278
-
279
- set monitors(_) {
280
- throw new Error("app.monitors is read-only");
281
- }
282
-
283
- get numPlugins() {
284
- return 0;
285
- }
286
-
287
- set numPlugins(_) {
288
- throw new Error("app.numPlugins is read-only");
289
- }
290
-
291
- get openInPlace() {
292
- return this._openInPlace;
293
- }
294
-
295
- set openInPlace(val) {
296
- this._openInPlace = val;
297
- /* TODO */
298
- }
299
-
300
- get platform() {
301
- return this._platform;
302
- }
303
-
304
- set platform(_) {
305
- throw new Error("app.platform is read-only");
306
- }
307
-
308
- get plugins() {
309
- return [];
310
- }
311
-
312
- set plugins(_) {
313
- throw new Error("app.plugins is read-only");
314
- }
315
-
316
- get printColorProfiles() {
317
- return [];
318
- }
319
-
320
- set printColorProfiles(_) {
321
- throw new Error("app.printColorProfiles is read-only");
322
- }
323
-
324
- get printerNames() {
325
- return [];
326
- }
327
-
328
- set printerNames(_) {
329
- throw new Error("app.printerNames is read-only");
330
- }
331
-
332
- get runtimeHighlight() {
333
- return this._runtimeHighlight;
334
- }
335
-
336
- set runtimeHighlight(val) {
337
- this._runtimeHighlight = val;
338
- /* TODO */
339
- }
340
-
341
- get runtimeHighlightColor() {
342
- return this._runtimeHighlightColor;
343
- }
344
-
345
- set runtimeHighlightColor(val) {
346
- if (Color._isValidColor(val)) {
347
- this._runtimeHighlightColor = val;
348
- /* TODO */
349
- }
350
- }
351
-
352
- get thermometer() {
353
- if (this._thermometer === null) {
354
- this._thermometer = new Proxy(
355
- new Thermometer({ send: this._send }),
356
- this._proxyHandler
357
- );
358
- }
359
- return this._thermometer;
360
- }
361
-
362
- set thermometer(_) {
363
- throw new Error("app.thermometer is read-only");
364
- }
365
-
366
- get toolbar() {
367
- return this._toolbar;
368
- }
369
-
370
- set toolbar(val) {
371
- this._toolbar = val;
372
- /* TODO */
373
- }
374
-
375
- get toolbarHorizontal() {
376
- return this.toolbar;
377
- }
378
-
379
- set toolbarHorizontal(value) {
380
- /* has been deprecated and it's now equivalent to toolbar */
381
- this.toolbar = value;
382
- }
383
-
384
- get toolbarVertical() {
385
- return this.toolbar;
386
- }
387
-
388
- set toolbarVertical(value) {
389
- /* has been deprecated and it's now equivalent to toolbar */
390
- this.toolbar = value;
391
- }
392
-
393
- get viewerType() {
394
- return VIEWER_TYPE;
395
- }
396
-
397
- set viewerType(_) {
398
- throw new Error("app.viewerType is read-only");
399
- }
400
-
401
- get viewerVariation() {
402
- return VIEWER_VARIATION;
403
- }
404
-
405
- set viewerVariation(_) {
406
- throw new Error("app.viewerVariation is read-only");
407
- }
408
-
409
- get viewerVersion() {
410
- return VIEWER_VERSION;
411
- }
412
-
413
- set viewerVersion(_) {
414
- throw new Error("app.viewerVersion is read-only");
415
- }
416
-
417
- addMenuItem() {
418
- /* Not implemented */
419
- }
420
-
421
- addSubMenu() {
422
- /* Not implemented */
423
- }
424
-
425
- addToolButton() {
426
- /* Not implemented */
427
- }
428
-
429
- alert(
430
- cMsg,
431
- nIcon = 0,
432
- nType = 0,
433
- cTitle = "PDF.js",
434
- oDoc = null,
435
- oCheckbox = null
436
- ) {
437
- if (typeof cMsg === "object") {
438
- nType = cMsg.nType;
439
- cMsg = cMsg.cMsg;
440
- }
441
- cMsg = (cMsg || "").toString();
442
- nType =
443
- typeof nType !== "number" || isNaN(nType) || nType < 0 || nType > 3
444
- ? 0
445
- : nType;
446
- if (nType >= 2) {
447
- return this._externalCall("confirm", [cMsg]) ? 4 : 3;
448
- }
449
-
450
- this._externalCall("alert", [cMsg]);
451
- return 1;
452
- }
453
-
454
- beep() {
455
- /* Not implemented */
456
- }
457
-
458
- beginPriv() {
459
- /* Not implemented */
460
- }
461
-
462
- browseForDoc() {
463
- /* Not implemented */
464
- }
465
-
466
- clearInterval(oInterval) {
467
- this._unregisterTimeout(oInterval);
468
- }
469
-
470
- clearTimeOut(oTime) {
471
- this._unregisterTimeout(oTime);
472
- }
473
-
474
- endPriv() {
475
- /* Not implemented */
476
- }
477
-
478
- execDialog() {
479
- /* Not implemented */
480
- }
481
-
482
- execMenuItem() {
483
- /* Not implemented */
484
- }
485
-
486
- getNthPlugInName() {
487
- /* Not implemented */
488
- }
489
-
490
- getPath() {
491
- /* Not implemented */
492
- }
493
-
494
- goBack() {
495
- /* TODO */
496
- }
497
-
498
- goForward() {
499
- /* TODO */
500
- }
501
-
502
- hideMenuItem() {
503
- /* Not implemented */
504
- }
505
-
506
- hideToolbarButton() {
507
- /* Not implemented */
508
- }
509
-
510
- launchURL() {
511
- /* Unsafe */
512
- }
513
-
514
- listMenuItems() {
515
- /* Not implemented */
516
- }
517
-
518
- listToolbarButtons() {
519
- /* Not implemented */
520
- }
521
-
522
- loadPolicyFile() {
523
- /* Not implemented */
524
- }
525
-
526
- mailGetAddrs() {
527
- /* Not implemented */
528
- }
529
-
530
- mailMsg() {
531
- /* TODO or not ? */
532
- }
533
-
534
- newDoc() {
535
- /* Not implemented */
536
- }
537
-
538
- newCollection() {
539
- /* Not implemented */
540
- }
541
-
542
- newFDF() {
543
- /* Not implemented */
544
- }
545
-
546
- openDoc() {
547
- /* Not implemented */
548
- }
549
-
550
- openFDF() {
551
- /* Not implemented */
552
- }
553
-
554
- popUpMenu() {
555
- /* Not implemented */
556
- }
557
-
558
- popUpMenuEx() {
559
- /* Not implemented */
560
- }
561
-
562
- removeToolButton() {
563
- /* Not implemented */
564
- }
565
-
566
- response(cQuestion, cTitle = "", cDefault = "", bPassword = "", cLabel = "") {
567
- if (typeof cQuestion === "object") {
568
- cDefault = cQuestion.cDefault;
569
- cQuestion = cQuestion.cQuestion;
570
- }
571
- cQuestion = (cQuestion || "").toString();
572
- cDefault = (cDefault || "").toString();
573
- return this._externalCall("prompt", [cQuestion, cDefault || ""]);
574
- }
575
-
576
- setInterval(cExpr, nMilliseconds = 0) {
577
- if (typeof cExpr === "object") {
578
- nMilliseconds = cExpr.nMilliseconds || 0;
579
- cExpr = cExpr.cExpr;
580
- }
581
-
582
- if (typeof cExpr !== "string") {
583
- throw new TypeError("First argument of app.setInterval must be a string");
584
- }
585
- if (typeof nMilliseconds !== "number") {
586
- throw new TypeError(
587
- "Second argument of app.setInterval must be a number"
588
- );
589
- }
590
- const callbackId = this._registerTimeoutCallback(cExpr);
591
- this._externalCall("setInterval", [callbackId, nMilliseconds]);
592
- return this._registerTimeout(callbackId, true);
593
- }
594
-
595
- setTimeOut(cExpr, nMilliseconds = 0) {
596
- if (typeof cExpr === "object") {
597
- nMilliseconds = cExpr.nMilliseconds || 0;
598
- cExpr = cExpr.cExpr;
599
- }
600
-
601
- if (typeof cExpr !== "string") {
602
- throw new TypeError("First argument of app.setTimeOut must be a string");
603
- }
604
- if (typeof nMilliseconds !== "number") {
605
- throw new TypeError("Second argument of app.setTimeOut must be a number");
606
- }
607
- const callbackId = this._registerTimeoutCallback(cExpr);
608
- this._externalCall("setTimeout", [callbackId, nMilliseconds]);
609
- return this._registerTimeout(callbackId, false);
610
- }
611
-
612
- trustedFunction() {
613
- /* Not implemented */
614
- }
615
-
616
- trustPropagatorFunction() {
617
- /* Not implemented */
618
- }
619
- }
620
-
621
- export { App };