Skip to content

Commit 40fc9c9

Browse files
committed
rtu-ui-data: config class instantiation fix
1 parent 367afd4 commit 40fc9c9

File tree

2 files changed

+14
-28
lines changed

2 files changed

+14
-28
lines changed

rtu-ui-data/src/mrz/config/FinderOverlayConfig.ts

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@
66
*/
77
import ScanbotSDK from "scanbot-web-sdk/ui";
88
import { UIConfig } from "scanbot-web-sdk/@types";
9-
import {
10-
FinderCorneredStyle,
11-
FinderStrokedStyle
12-
} from "scanbot-web-sdk/@types/ui2/configuration/common/ViewFinderConfiguration";
13-
import {
14-
NoLayoutPreset,
15-
ThreeLineMrzFinderLayoutPreset,
16-
TwoLineMrzFinderLayoutPreset
17-
} from "scanbot-web-sdk/@types/ui2/configuration/mrz/MRZFinderLayoutPreset";
189

1910
export function applyFinderOverlayConfig(config?: UIConfig.MrzScannerScreenConfiguration) {
2011

@@ -24,34 +15,34 @@ export function applyFinderOverlayConfig(config?: UIConfig.MrzScannerScreenConfi
2415
}
2516

2617
// To hide the example layout preset.
27-
config.mrzExampleOverlay = new NoLayoutPreset()
18+
config.mrzExampleOverlay = new ScanbotSDK.UI.Config.NoLayoutPreset();
2819

2920
// Configure the finder example overlay. You can choose between the two-line and three-line preset.
3021
// Each example preset has a default text for each line, but you can change it accordingly to your liking.
3122
// Each preset has a fixed aspect ratio adjusted to it's number of lines. To override, please use 'aspectRatio'
3223
// parameter in 'viewFinder' field in the main configuration object.
3324

3425
// To use the default ones.
35-
config.mrzExampleOverlay = new TwoLineMrzFinderLayoutPreset()
36-
config.mrzExampleOverlay = new ThreeLineMrzFinderLayoutPreset()
26+
config.mrzExampleOverlay = new ScanbotSDK.UI.Config.TwoLineMrzFinderLayoutPreset();
27+
config.mrzExampleOverlay = new ScanbotSDK.UI.Config.ThreeLineMrzFinderLayoutPreset();
3728

3829
// Or configure the preset.
3930
// For this example we will configure the three-line preset.
40-
const preset = new ThreeLineMrzFinderLayoutPreset()
41-
preset.mrzTextLine1 = "I<USA2342353464<<<<<<<<<<<<<<<"
42-
preset.mrzTextLine2 = "9602300M2904076USA<<<<<<<<<<<2"
43-
preset.mrzTextLine3 = "SMITH<<JACK<<<<<<<<<<<<<<<<<<<"
31+
const preset = new ScanbotSDK.UI.Config.ThreeLineMrzFinderLayoutPreset();
32+
preset.mrzTextLine1 = "I<USA2342353464<<<<<<<<<<<<<<<";
33+
preset.mrzTextLine2 = "9602300M2904076USA<<<<<<<<<<<2";
34+
preset.mrzTextLine3 = "SMITH<<JACK<<<<<<<<<<<<<<<<<<<";
4435

4536
// Set the configured finder layout preset on the main configuration object.
46-
config.mrzExampleOverlay = preset
37+
config.mrzExampleOverlay = preset;
4738

4839
// Configure the view finder.
4940
// Set the style for the view finder.
5041
// Choose between cornered or stroked style.
5142
// For default stroked style.
52-
config.viewFinder.style = new FinderStrokedStyle();
43+
config.viewFinder.style = new ScanbotSDK.UI.Config.FinderStrokedStyle();
5344
// For default cornered style.
54-
config.viewFinder.style = new FinderCorneredStyle();
45+
config.viewFinder.style = new ScanbotSDK.UI.Config.FinderCorneredStyle();
5546
// You can also set each style's stroke width, stroke color or corner radius, e.g.
56-
config.viewFinder.style = new FinderCorneredStyle({ strokeWidth: 3.0 });
47+
config.viewFinder.style = new ScanbotSDK.UI.Config.FinderCorneredStyle({ strokeWidth: 3.0 });
5748
}

rtu-ui-data/src/mrz/config/IntroConfig.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
*/
77
import ScanbotSDK from "scanbot-web-sdk/ui";
88
import { UIConfig } from "scanbot-web-sdk/@types";
9-
import {
10-
MrzIntroCustomImage,
11-
MrzIntroDefaultImage,
12-
MrzIntroNoImage
13-
} from "scanbot-web-sdk/@types/ui2/configuration/mrz/MRZScannerIntroScreenConfiguration";
149

1510
export function applyIntroConfig(config?: UIConfig.MrzScannerScreenConfiguration) {
1611

@@ -32,11 +27,11 @@ export function applyIntroConfig(config?: UIConfig.MrzScannerScreenConfiguration
3227

3328
// Configure the image for the introduction screen.
3429
// If you want to have no image...
35-
intro.image = new MrzIntroNoImage();
30+
intro.image = new ScanbotSDK.UI.Config.MrzIntroNoImage();
3631
// For a custom image...
37-
intro.image = new MrzIntroCustomImage({ uri: "https://example.com/image.jpg" });
32+
intro.image = new ScanbotSDK.UI.Config.MrzIntroCustomImage({ uri: "https://example.com/image.jpg" });
3833
// Or you can also use our default image.
39-
intro.image = new MrzIntroDefaultImage();
34+
intro.image = new ScanbotSDK.UI.Config.MrzIntroDefaultImage();
4035

4136
// Configure the color of the handler on top.
4237
intro.handlerColor = "#EFEFEF";

0 commit comments

Comments
 (0)