@regulaforensics/document-reader 9.3.671-nightly → 9.3.674-rc

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 (60) hide show
  1. package/RNDocumentReader.podspec +2 -2
  2. package/android/build.gradle +2 -2
  3. package/android/cordova.gradle +2 -2
  4. package/android/src/main/java/com/regula/plugin/documentreader/Config.kt +137 -48
  5. package/android/src/main/java/com/regula/plugin/documentreader/JSONConstructor.kt +23 -19
  6. package/android/src/main/java/com/regula/plugin/documentreader/Main.kt +2 -2
  7. package/android/src/main/java/com/regula/plugin/documentreader/Utils.kt +5 -0
  8. package/examples/capacitor/package.json +1 -1
  9. package/examples/ionic/package.json +1 -1
  10. package/examples/react_native/package.json +1 -1
  11. package/ios/RGLWConfig.m +152 -41
  12. package/ios/RGLWJSONConstructor.m +5 -0
  13. package/package.json +1 -1
  14. package/plugin.xml +2 -2
  15. package/test/json.tsx +48 -2
  16. package/test/package-lock.json +1 -1
  17. package/test/test.tsx +5 -2
  18. package/www/capacitor/config/FinalizeConfig.js +4 -0
  19. package/www/capacitor/index.js +7 -5
  20. package/www/capacitor/params/customization/Customization.js +28 -18
  21. package/www/capacitor/params/customization/CustomizationColors.js +33 -1
  22. package/www/capacitor/params/customization/CustomizationContentModes.js +55 -0
  23. package/www/capacitor/params/customization/CustomizationFonts.js +38 -2
  24. package/www/capacitor/params/customization/CustomizationImages.js +145 -1
  25. package/www/capacitor/params/customization/CustomizationMatrices.js +39 -0
  26. package/www/capacitor/params/customization/CustomizationTimings.js +71 -0
  27. package/www/capacitor/params/process_params/BackendProcessingConfig.js +4 -0
  28. package/www/capacitor/params/process_params/ProcessParams.js +24 -0
  29. package/www/capacitor/results/visual_results/FieldType.js +2 -0
  30. package/www/capacitor/rfid/RFIDNotification.js +4 -1
  31. package/www/cordova.js +568 -140
  32. package/www/react-native/config/FinalizeConfig.js +4 -0
  33. package/www/react-native/index.js +7 -5
  34. package/www/react-native/params/customization/Customization.js +28 -18
  35. package/www/react-native/params/customization/CustomizationColors.js +33 -1
  36. package/www/react-native/params/customization/CustomizationContentModes.js +55 -0
  37. package/www/react-native/params/customization/CustomizationFonts.js +38 -2
  38. package/www/react-native/params/customization/CustomizationImages.js +145 -1
  39. package/www/react-native/params/customization/CustomizationMatrices.js +39 -0
  40. package/www/react-native/params/customization/CustomizationTimings.js +71 -0
  41. package/www/react-native/params/process_params/BackendProcessingConfig.js +4 -0
  42. package/www/react-native/params/process_params/ProcessParams.js +24 -0
  43. package/www/react-native/results/visual_results/FieldType.js +2 -0
  44. package/www/react-native/rfid/RFIDNotification.js +4 -1
  45. package/www/types/config/FinalizeConfig.d.ts +2 -1
  46. package/www/types/index.d.ts +7 -5
  47. package/www/types/params/customization/Customization.d.ts +37 -33
  48. package/www/types/params/customization/CustomizationColors.d.ts +4 -0
  49. package/www/types/params/customization/CustomizationContentModes.d.ts +41 -0
  50. package/www/types/params/customization/CustomizationFonts.d.ts +37 -2
  51. package/www/types/params/customization/CustomizationImages.d.ts +19 -0
  52. package/www/types/params/customization/CustomizationMatrices.d.ts +10 -0
  53. package/www/types/params/customization/CustomizationTimings.d.ts +14 -0
  54. package/www/types/params/process_params/BackendProcessingConfig.d.ts +2 -0
  55. package/www/types/params/process_params/ProcessParams.d.ts +9 -0
  56. package/www/types/results/visual_results/FieldType.d.ts +2 -0
  57. package/www/types/rfid/RFIDNotification.d.ts +4 -1
  58. package/www/capacitor/params/customization/Font.js +0 -36
  59. package/www/react-native/params/customization/Font.js +0 -36
  60. package/www/types/params/customization/Font.d.ts +0 -36
@@ -653,9 +653,11 @@ export const FieldType = {
653
653
  NATIONALITY_CODE_ALPHA_2: 697,
654
654
  FIRST_ISSUE_DATE_CHECKDIGIT: 698,
655
655
  FIRST_ISSUE_DATE_CHECKSUM: 699,
656
+ EXPIRY_TIMESTAMP: 700,
656
657
  COMMERCIAL_INDICATOR: 701,
657
658
  NON_DOMICILED_INDICATOR: 702,
658
659
  JURISDICTION_SPECIFIC_DATA: 703,
660
+ DATA_DATE_OF_EXPIRY: 704,
659
661
  }
660
662
 
661
663
  FieldType.getTranslation = async function (value) {
@@ -64,5 +64,8 @@ export const RFIDNotificationCodes = {
64
64
  PCSC_UPDATING_DATAGROUP: 786432,
65
65
  AUXILIARY_DATA_VALIDATION: 851968,
66
66
  RI_SECTOR_ID: 917504,
67
- BIOMETRICS_EMPTY_PLACEHOLDER: 983040
67
+ BIOMETRICS_EMPTY_PLACEHOLDER: 983040,
68
+ SESSION_FILE_DATA_UPDATED: 1048576,
69
+ TCC_TA_RESOURCES: 1114112,
70
+ TCC_TA_SIGNATURE: 1114113,
68
71
  }
@@ -1,5 +1,6 @@
1
1
  export interface FinalizeConfig {
2
2
  rawImages?: boolean,
3
3
  video?: boolean,
4
- rfidSession?: boolean
4
+ rfidSession?: boolean,
5
+ mdlSession?: boolean,
5
6
  }
@@ -111,12 +111,14 @@ export { LivenessParams, ProcessParams, MeasureSystem, MRZFormat, LogLevel, MrzD
111
111
  import { Functionality, CameraPosition, CaptureMode, CameraMode, CaptureSessionPreset, DocReaderFrame, CameraSize } from './params/Functionality';
112
112
  export { Functionality, CameraPosition, CaptureMode, CameraMode, CaptureSessionPreset, DocReaderFrame, CameraSize };
113
113
 
114
- import { CustomizationFonts } from './params/customization/CustomizationFonts';
115
- import { CustomizationImages } from './params/customization/CustomizationImages';
116
- import { Font, FontStyle } from './params/customization/Font';
117
- import { Customization, Cap, FrameShapeType, ViewContentMode, CustomButtonTag } from './params/customization/Customization';
118
114
  import { CustomizationColors } from './params/customization/CustomizationColors';
119
- export { CustomizationFonts, CustomizationImages, Font, FontStyle, Customization, Cap, FrameShapeType, ViewContentMode, CustomButtonTag, CustomizationColors };
115
+ import { CustomizationFonts, Font, FontStyle } from './params/customization/CustomizationFonts';
116
+ import { CustomizationImages } from './params/customization/CustomizationImages';
117
+ import { CustomizationTimings } from './params/customization/CustomizationTimings';
118
+ import { CustomizationMatrices } from './params/customization/CustomizationMatrices';
119
+ import { CustomizationContentModes, ViewContentMode } from './params/customization/CustomizationContentModes';
120
+ import { Customization, Cap, FrameShapeType, CustomButtonTag } from './params/customization/Customization';
121
+ export { CustomizationColors, CustomizationFonts, CustomizationImages, CustomizationTimings, CustomizationMatrices, CustomizationContentModes, Font, FontStyle, Customization, Cap, FrameShapeType, ViewContentMode, CustomButtonTag };
120
122
 
121
123
  import { EPassportDataGroups } from './params/rfid_scenario/EPassportDataGroups';
122
124
  import { EIDDataGroups } from './params/rfid_scenario/EIDDataGroups';
@@ -1,7 +1,9 @@
1
1
  import { CustomizationColors } from "./CustomizationColors";
2
- import { CustomizationFonts } from "./CustomizationFonts";
2
+ import { CustomizationFonts, Font } from "./CustomizationFonts";
3
3
  import { CustomizationImages } from "./CustomizationImages";
4
- import { Font } from "./Font";
4
+ import { CustomizationTimings } from "./CustomizationTimings";
5
+ import { CustomizationContentModes, ViewContentMode } from "./CustomizationContentModes";
6
+ import { CustomizationMatrices } from "./CustomizationMatrices";
5
7
 
6
8
  /**
7
9
  * Params that relate to the camera view controller customization and etc.
@@ -239,6 +241,8 @@ export declare class Customization {
239
241
  livenessAnimationPositionMultiplier?: number;
240
242
 
241
243
  /**
244
+ * @deprecated Use `timings.nextPageIdCardStartDelay` instead.
245
+ *
242
246
  * Animation delay before flip.
243
247
  *
244
248
  * @default 0
@@ -246,6 +250,8 @@ export declare class Customization {
246
250
  nextPageAnimationStartDelay?: number;
247
251
 
248
252
  /**
253
+ * @deprecated Use `timings.nextPageIdCardEndDelay` instead.
254
+ *
249
255
  * Animation delay after flip.
250
256
  *
251
257
  * @default 0
@@ -288,6 +294,8 @@ export declare class Customization {
288
294
  multipageAnimationBackImage?: string;
289
295
 
290
296
  /**
297
+ * @deprecated Use `images.borderBackground` instead.
298
+ *
291
299
  * Allows you to set any image within the camera frame. Base64 string.
292
300
  */
293
301
  borderBackgroundImage?: string;
@@ -298,27 +306,37 @@ export declare class Customization {
298
306
  helpAnimationImage?: string;
299
307
 
300
308
  /**
309
+ * @deprecated Use `images.closeButton` instead.
310
+ *
301
311
  * Allows you to set any image for the close button. Base64 string.
302
312
  */
303
313
  closeButtonImage?: string;
304
314
 
305
315
  /**
316
+ * @deprecated Use `images.captureButton` instead.
317
+ *
306
318
  * Allows you to set any image for the capture button. Base64 string.
307
319
  */
308
320
  captureButtonImage?: string;
309
321
 
310
322
  /**
323
+ * @deprecated Use `images.switchButton` instead.
324
+ *
311
325
  * Allows you to set any image for the button that allows
312
326
  * changing positions of the capture device. Base64 string.
313
327
  */
314
328
  cameraSwitchButtonImage?: string;
315
329
 
316
330
  /**
331
+ * @deprecated Use `images.torchButtonOn` instead.
332
+ *
317
333
  * Allows you to set any image for the torch button when its state is ON. Base64 string.
318
334
  */
319
335
  torchButtonOnImage?: string;
320
336
 
321
337
  /**
338
+ * @deprecated Use `images.torchButtonOff` instead.
339
+ *
322
340
  * Allows you to set any image for the torch button when its state is OFF. Base64 string.
323
341
  */
324
342
  torchButtonOffImage?: string;
@@ -338,6 +356,8 @@ export declare class Customization {
338
356
  changeFrameButtonCollapseImage?: string;
339
357
 
340
358
  /**
359
+ * @deprecated Use `images.livenessAnimation` instead.
360
+ *
341
361
  * Allows you to set any image for the liveness animation.
342
362
  *
343
363
  * When set to `null` the default image will be used.
@@ -348,6 +368,8 @@ export declare class Customization {
348
368
  livenessAnimationImage?: string;
349
369
 
350
370
  /**
371
+ * @deprecated Use `images.multipageButton` instead.
372
+ *
351
373
  * Allows you to set any UIImage for the "Skip next page" button.
352
374
  */
353
375
  multipageButtonImage?: string;
@@ -387,6 +409,8 @@ export declare class Customization {
387
409
  uiCustomizationLayer?: Record<string, any>;
388
410
 
389
411
  /**
412
+ * @deprecated Use `images.helpAnimation` instead.
413
+ *
390
414
  * Allows you to specify how a view of the help animation adjusts
391
415
  * its content when its size changes.
392
416
  *
@@ -397,6 +421,8 @@ export declare class Customization {
397
421
  helpAnimationImageTransformsIOS?: ViewContentMode;
398
422
 
399
423
  /**
424
+ * @deprecated Use `contentModes.nextPageIdCardFront` instead.
425
+ *
400
426
  * Allows you to specify how a view of the multipage animation (front side)
401
427
  * adjusts its content when its size changes.
402
428
  *
@@ -407,6 +433,8 @@ export declare class Customization {
407
433
  multipageAnimationFrontImageTransformsIOS?: ViewContentMode;
408
434
 
409
435
  /**
436
+ * @deprecated Use `contentModes.nextPageIdCardBack` instead.
437
+ *
410
438
  * Allows you to specify how a view of the multipage animation (back side)
411
439
  * adjusts its content when its size changes.
412
440
  *
@@ -449,6 +477,8 @@ export declare class Customization {
449
477
  helpAnimationImageTransformsAndroid?: number[];
450
478
 
451
479
  /**
480
+ * @deprecated Use `matrices.nextPageIdCardFront` instead.
481
+ *
452
482
  * Matrix used to scale multipage animation (front side).
453
483
  *
454
484
  * Android class `android.graphics.Matrix`.
@@ -461,6 +491,8 @@ export declare class Customization {
461
491
  multipageAnimationFrontImageTransformsAndroid?: number[];
462
492
 
463
493
  /**
494
+ * @deprecated Use `matrices.nextPageIdCardBack` instead.
495
+ *
464
496
  * Matrix used to scale multipage animation (back side).
465
497
  *
466
498
  * Android class `android.graphics.Matrix`.
@@ -499,6 +531,9 @@ export declare class Customization {
499
531
  colors: CustomizationColors;
500
532
  fonts: CustomizationFonts;
501
533
  images: CustomizationImages;
534
+ timings: CustomizationTimings;
535
+ contentModes: CustomizationContentModes;
536
+ matrices: CustomizationMatrices;
502
537
 
503
538
  /**
504
539
  * Allows you to deserialize object.
@@ -524,37 +559,6 @@ export declare enum FrameShapeType {
524
559
  CORNER = 1,
525
560
  }
526
561
 
527
- /**
528
- * Clone of iOS native enum `UIViewContentMode`
529
- */
530
- export declare enum ViewContentMode {
531
- SCALE_TO_FILL = 0,
532
- /**
533
- * Contents scaled to fit with fixed aspect. remainder is transparent.
534
- */
535
- SCALE_ASPECT_FIT = 1,
536
- /**
537
- * Contents scaled to fill with fixed aspect. some portion of content may be clipped.
538
- */
539
- SCALE_ASPECT_FILL = 2,
540
- /**
541
- * redraw on bounds change (calls -setNeedsDisplay).
542
- */
543
- REDRAW = 3,
544
- /**
545
- * contents remain same size. positioned adjusted.
546
- */
547
- CENTER = 4,
548
- TOP = 5,
549
- BOTTOM = 6,
550
- LEFT = 7,
551
- RIGHT = 8,
552
- TOP_LEFT = 9,
553
- TOP_RIGHT = 10,
554
- BOTTOM_LEFT = 11,
555
- BOTTOM_RIGHT = 12,
556
- }
557
-
558
562
  /**
559
563
  * Button tags for UI customization.
560
564
  */
@@ -29,6 +29,10 @@ export declare class CustomizationColors {
29
29
  mdlEnableNfcButtonText?: number;
30
30
  /** Android only. */
31
31
  mdlEnableNfcButtonBackground?: number;
32
+ nextPageIdCardFront?: number;
33
+ nextPageIdCardBack?: number;
34
+ nextPagePassportShift?: number;
35
+ nextPagePassportFlip?: number;
32
36
 
33
37
  /**
34
38
  * Allows you to deserialize object.
@@ -0,0 +1,41 @@
1
+ export declare class CustomizationContentModes {
2
+ nextPageIdCardFront?: ViewContentMode;
3
+ nextPageIdCardBack?: ViewContentMode;
4
+
5
+ /**
6
+ * Allows you to deserialize object.
7
+ * @param jsonObject
8
+ */
9
+ static fromJson(jsonObject: any): CustomizationContentModes;
10
+ }
11
+
12
+ /**
13
+ * Clone of iOS native enum `UIViewContentMode`
14
+ */
15
+ export declare enum ViewContentMode {
16
+ SCALE_TO_FILL = 0,
17
+ /**
18
+ * Contents scaled to fit with fixed aspect. remainder is transparent.
19
+ */
20
+ SCALE_ASPECT_FIT = 1,
21
+ /**
22
+ * Contents scaled to fill with fixed aspect. some portion of content may be clipped.
23
+ */
24
+ SCALE_ASPECT_FILL = 2,
25
+ /**
26
+ * redraw on bounds change (calls -setNeedsDisplay).
27
+ */
28
+ REDRAW = 3,
29
+ /**
30
+ * contents remain same size. positioned adjusted.
31
+ */
32
+ CENTER = 4,
33
+ TOP = 5,
34
+ BOTTOM = 6,
35
+ LEFT = 7,
36
+ RIGHT = 8,
37
+ TOP_LEFT = 9,
38
+ TOP_RIGHT = 10,
39
+ BOTTOM_LEFT = 11,
40
+ BOTTOM_RIGHT = 12,
41
+ }
@@ -1,5 +1,3 @@
1
- import { Font } from "./Font";
2
-
3
1
  export declare class CustomizationFonts {
4
2
  rfidProcessingScreenHintLabel?: Font;
5
3
  rfidProcessingScreenProgressLabel?: Font;
@@ -26,3 +24,40 @@ export declare class CustomizationFonts {
26
24
  */
27
25
  static fromJson(jsonObject: any): CustomizationFonts;
28
26
  }
27
+
28
+ export declare class Font {
29
+ /**
30
+ * Font family.
31
+ *
32
+ * Beware that Android and iOS have diffrent font names,
33
+ * so you will have to use if condition.
34
+ */
35
+ readonly name: string;
36
+
37
+ /**
38
+ * Font size.
39
+ */
40
+ readonly size?: number;
41
+
42
+ /**
43
+ * Font style.
44
+ *
45
+ * Android only.
46
+ */
47
+ readonly style?: FontStyle;
48
+
49
+ constructor(name: string, options?: { size?: number, style?: FontStyle });
50
+
51
+ /**
52
+ * Allows you to deserialize object.
53
+ * @param jsonObject
54
+ */
55
+ static fromJson(jsonObject: any): Font;
56
+ }
57
+
58
+ export declare enum FontStyle {
59
+ NORMAL = 0,
60
+ BOLD = 1,
61
+ ITALIC = 2,
62
+ BOLD_ITALIC = 3,
63
+ }
@@ -1,11 +1,30 @@
1
1
  export declare class CustomizationImages {
2
+ helpAnimation?: string;
3
+ livenessAnimation?: string;
4
+ borderBackground?: string;
5
+ torchButtonOn?: string;
6
+ torchButtonOff?: string;
7
+ captureButton?: string;
8
+ switchButton?: string;
9
+ closeButton?: string;
2
10
  /** Base64 string. */
3
11
  rfidProcessingScreenFailureImage?: string;
4
12
  /** Android only. */
5
13
  rfidEnableNfcImage?: string;
14
+ /** Android only. */
15
+ rfidDisableNfcImage?: string;
6
16
  mdlProcessingScreenFailureImage?: string;
7
17
  /** Android only. */
8
18
  mdlEnableNfcImage?: string;
19
+ /** Android only. */
20
+ mdlDisableNfcImage?: string;
21
+ nextPageIdCardFront?: string;
22
+ nextPageIdCardBack?: string;
23
+ nextPagePassportShift?: string;
24
+ nextPagePassportFlipStart?: string;
25
+ nextPagePassportFlipClean?: string;
26
+ nextPagePassportFlipTop?: string;
27
+ nextPagePassportFlipBottom?: string;
9
28
 
10
29
  /**
11
30
  * Allows you to deserialize object.
@@ -0,0 +1,10 @@
1
+ export declare class CustomizationMatrices {
2
+ nextPageIdCardFront?: number[];
3
+ nextPageIdCardBack?: number[];
4
+
5
+ /**
6
+ * Allows you to deserialize object.
7
+ * @param jsonObject
8
+ */
9
+ static fromJson(jsonObject: any): CustomizationMatrices;
10
+ }
@@ -0,0 +1,14 @@
1
+ export declare class CustomizationTimings {
2
+ nextPageIdCardStartDelay?: number;
3
+ nextPageIdCardEndDelay?: number;
4
+ nextPagePassportShiftStartDelay?: number;
5
+ nextPagePassportShiftEndDelay?: number;
6
+ nextPagePassportFlipStartDelay?: number;
7
+ nextPagePassportFlipEndDelay?: number;
8
+
9
+ /**
10
+ * Allows you to deserialize object.
11
+ * @param jsonObject
12
+ */
13
+ static fromJson(jsonObject: any): CustomizationTimings;
14
+ }
@@ -2,6 +2,7 @@ export declare class BackendProcessingConfig {
2
2
  readonly url: string;
3
3
  readonly httpHeaders?: Record<string, string>;
4
4
  readonly rfidServerSideChipVerification?: boolean;
5
+ readonly mdlVerification?: boolean;
5
6
 
6
7
  /**
7
8
  * Timeout in seconds that can be configured for backend transaction creation and package finalization.
@@ -12,6 +13,7 @@ export declare class BackendProcessingConfig {
12
13
  url: string,
13
14
  options?: {
14
15
  rfidServerSideChipVerification?: boolean,
16
+ mdlVerification?: boolean,
15
17
  httpHeaders?: Record<string, string>,
16
18
  timeoutConnection?: number,
17
19
  }
@@ -208,6 +208,15 @@ export declare class ProcessParams {
208
208
  */
209
209
  returnTransliteratedFields?: boolean;
210
210
  checkCaptureProcessIntegrity?: boolean;
211
+ /**
212
+ * When disabled, date of expiry doesn't affect the mrz and text statuses.
213
+ */
214
+ strictExpiryDate?: boolean;
215
+ debugSaveBinarySession?: boolean;
216
+ /**
217
+ * This parameter is used to enable Visible Digital Seal check.
218
+ */
219
+ checkVDS?: boolean;
211
220
  /**
212
221
  * There are documents that contain barcodes which data can be parsed only
213
222
  * if document type verification is performed. The following property allows
@@ -1307,12 +1307,14 @@ export declare enum FieldType {
1307
1307
  FIRST_ISSUE_DATE_CHECKDIGIT = 698,
1308
1308
  /** First issue date checksum. */
1309
1309
  FIRST_ISSUE_DATE_CHECKSUM = 699,
1310
+ EXPIRY_TIMESTAMP = 700,
1310
1311
  /** Commercial indicator. */
1311
1312
  COMMERCIAL_INDICATOR = 701,
1312
1313
  /** Non-domiciled indicator. */
1313
1314
  NON_DOMICILED_INDICATOR = 702,
1314
1315
  /** Jurisdiction specific data. */
1315
1316
  JURISDICTION_SPECIFIC_DATA = 703,
1317
+ DATA_DATE_OF_EXPIRY = 704,
1316
1318
  }
1317
1319
 
1318
1320
  export declare namespace FieldType {
@@ -149,5 +149,8 @@ export declare enum RFIDNotificationCodes {
149
149
  * Event of the detection of real biometric data absence in DG3 or DG4
150
150
  * and random filling data usage.
151
151
  */
152
- BIOMETRICS_EMPTY_PLACEHOLDER = 983040
152
+ BIOMETRICS_EMPTY_PLACEHOLDER = 983040,
153
+ SESSION_FILE_DATA_UPDATED = 1048576,
154
+ TCC_TA_RESOURCES = 1114112,
155
+ TCC_TA_SIGNATURE = 1114113,
153
156
  }
@@ -1,36 +0,0 @@
1
- export class Font {
2
- name
3
- size
4
- style
5
-
6
- constructor(name, options) {
7
- this.name = name;
8
- this.size = options?.size;
9
- this.style = options?.style;
10
- }
11
-
12
- static fromJson(jsonObject) {
13
- if (jsonObject == null) return null;
14
-
15
- const result = new Font(jsonObject["name"]);
16
- result.size = jsonObject["size"];
17
- result.style = jsonObject["style"];
18
-
19
- return result;
20
- }
21
-
22
- toJson() {
23
- return {
24
- "name": this.name,
25
- "size": this.size,
26
- "style": this.style,
27
- }
28
- }
29
- }
30
-
31
- export const FontStyle = {
32
- NORMAL: 0,
33
- BOLD: 1,
34
- ITALIC: 2,
35
- BOLD_ITALIC: 3
36
- };
@@ -1,36 +0,0 @@
1
- export class Font {
2
- name
3
- size
4
- style
5
-
6
- constructor(name, options) {
7
- this.name = name;
8
- this.size = options?.size;
9
- this.style = options?.style;
10
- }
11
-
12
- static fromJson(jsonObject) {
13
- if (jsonObject == null) return null;
14
-
15
- const result = new Font(jsonObject["name"]);
16
- result.size = jsonObject["size"];
17
- result.style = jsonObject["style"];
18
-
19
- return result;
20
- }
21
-
22
- toJson() {
23
- return {
24
- "name": this.name,
25
- "size": this.size,
26
- "style": this.style,
27
- }
28
- }
29
- }
30
-
31
- export const FontStyle = {
32
- NORMAL: 0,
33
- BOLD: 1,
34
- ITALIC: 2,
35
- BOLD_ITALIC: 3
36
- };
@@ -1,36 +0,0 @@
1
- export declare class Font {
2
- /**
3
- * Font family.
4
- *
5
- * Beware that Android and iOS have diffrent font names,
6
- * so you will have to use if condition.
7
- */
8
- readonly name: string;
9
-
10
- /**
11
- * Font size.
12
- */
13
- readonly size?: number;
14
-
15
- /**
16
- * Font style.
17
- *
18
- * Android only.
19
- */
20
- readonly style?: FontStyle;
21
-
22
- constructor(name: string, options?: { size?: number, style?: FontStyle });
23
-
24
- /**
25
- * Allows you to deserialize object.
26
- * @param jsonObject
27
- */
28
- static fromJson(jsonObject: any): Font;
29
- }
30
-
31
- export declare enum FontStyle {
32
- NORMAL = 0,
33
- BOLD = 1,
34
- ITALIC = 2,
35
- BOLD_ITALIC = 3,
36
- }