6
6
*/
7
7
import ScanbotSDK from "scanbot-web-sdk/ui" ;
8
8
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" ;
18
9
19
10
export function applyFinderOverlayConfig ( config ?: UIConfig . MrzScannerScreenConfiguration ) {
20
11
@@ -24,34 +15,34 @@ export function applyFinderOverlayConfig(config?: UIConfig.MrzScannerScreenConfi
24
15
}
25
16
26
17
// To hide the example layout preset.
27
- config . mrzExampleOverlay = new NoLayoutPreset ( )
18
+ config . mrzExampleOverlay = new ScanbotSDK . UI . Config . NoLayoutPreset ( ) ;
28
19
29
20
// Configure the finder example overlay. You can choose between the two-line and three-line preset.
30
21
// Each example preset has a default text for each line, but you can change it accordingly to your liking.
31
22
// Each preset has a fixed aspect ratio adjusted to it's number of lines. To override, please use 'aspectRatio'
32
23
// parameter in 'viewFinder' field in the main configuration object.
33
24
34
25
// 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 ( ) ;
37
28
38
29
// Or configure the preset.
39
30
// 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<<<<<<<<<<<<<<<<<<<" ;
44
35
45
36
// Set the configured finder layout preset on the main configuration object.
46
- config . mrzExampleOverlay = preset
37
+ config . mrzExampleOverlay = preset ;
47
38
48
39
// Configure the view finder.
49
40
// Set the style for the view finder.
50
41
// Choose between cornered or stroked style.
51
42
// For default stroked style.
52
- config . viewFinder . style = new FinderStrokedStyle ( ) ;
43
+ config . viewFinder . style = new ScanbotSDK . UI . Config . FinderStrokedStyle ( ) ;
53
44
// For default cornered style.
54
- config . viewFinder . style = new FinderCorneredStyle ( ) ;
45
+ config . viewFinder . style = new ScanbotSDK . UI . Config . FinderCorneredStyle ( ) ;
55
46
// 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 } ) ;
57
48
}
0 commit comments