dytools-capture-engine 1.5.2 → 2.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.
- package/dist/index.cjs +354 -25
- package/dist/index.d.cts +116 -8
- package/dist/index.d.ts +116 -8
- package/dist/index.js +354 -25
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2,15 +2,15 @@ import { InteractiveObject, ZoomToolOptions } from 'dytools-canvas-engine';
|
|
|
2
2
|
import { Rectangle, Size, Point, Polygon, Vector } from 'dytools-geometry';
|
|
3
3
|
import { Result } from 'dytools-result';
|
|
4
4
|
|
|
5
|
-
type ExternalZoneType = "TemplateSimpleZone" | "TemplateAnchorZone" | "TemplateAnchorZoneChild";
|
|
5
|
+
type ExternalZoneType = "TemplateSimpleZone" | "TemplateAnchorZone" | "TemplateAnchorZoneChild" | "TemplateStaticZone";
|
|
6
6
|
interface ExternalTemplateZone {
|
|
7
7
|
TemplateZoneId: string;
|
|
8
8
|
Name: string;
|
|
9
9
|
Type: ExternalZoneType;
|
|
10
|
-
X
|
|
11
|
-
Y
|
|
12
|
-
Width
|
|
13
|
-
Height
|
|
10
|
+
X?: number;
|
|
11
|
+
Y?: number;
|
|
12
|
+
Width?: number;
|
|
13
|
+
Height?: number;
|
|
14
14
|
XAbsolute?: number;
|
|
15
15
|
YAbsolute?: number;
|
|
16
16
|
WidthAbsolute?: number;
|
|
@@ -18,14 +18,22 @@ interface ExternalTemplateZone {
|
|
|
18
18
|
AnchorLocationXAbsoluteHint?: number;
|
|
19
19
|
AnchorLocationYAbsoluteHint?: number;
|
|
20
20
|
RegExFilter?: string | null;
|
|
21
|
+
ApplyRegExFilterToWholeLines?: boolean;
|
|
22
|
+
IsRegExFilterNegated?: boolean;
|
|
21
23
|
RegExOutput?: string | null;
|
|
22
24
|
RegExReplacement?: string | null;
|
|
25
|
+
OutputFunction?: OutputFunction | null;
|
|
23
26
|
Required?: boolean;
|
|
24
27
|
DataType?: string | null;
|
|
25
28
|
ExcludeFromOutput?: boolean;
|
|
26
29
|
DefaultValueIfEmpty?: string | null;
|
|
30
|
+
Value?: string | null;
|
|
27
31
|
AnchorLocation?: string;
|
|
28
32
|
GroupChildrenInSubRecord?: boolean;
|
|
33
|
+
HasColumnHeaders?: boolean;
|
|
34
|
+
ExcludeColumnHeaders?: boolean;
|
|
35
|
+
IsAnchorPerLine?: boolean;
|
|
36
|
+
FeatureFlags?: string[];
|
|
29
37
|
ChildZones?: ExternalTemplateZone[];
|
|
30
38
|
}
|
|
31
39
|
interface ExternalTemplate {
|
|
@@ -38,6 +46,8 @@ declare const CapturePublicEventType: {
|
|
|
38
46
|
readonly ZonePositionChanged: "zone:position_changed";
|
|
39
47
|
readonly ZoneNameChanged: "zone:name_changed";
|
|
40
48
|
readonly ZoneFilterRegexChanged: "zone:filter_regex_changed";
|
|
49
|
+
readonly ZoneApplyFilterRegexToWholeLinesChanged: "zone:apply_filter_regex_to_whole_lines_changed";
|
|
50
|
+
readonly ZoneIsFilterRegexNegatedChanged: "zone:is_filter_regex_negated_changed";
|
|
41
51
|
readonly ZoneExampleChanged: "zone:example_changed";
|
|
42
52
|
readonly ZoneHiddenChanged: "zone:hidden_changed";
|
|
43
53
|
readonly ZoneChanged: "zone:changed";
|
|
@@ -78,6 +88,16 @@ interface CapturePublicEventPayloads {
|
|
|
78
88
|
oldFilterRegex: number;
|
|
79
89
|
newFilterRegex: number;
|
|
80
90
|
};
|
|
91
|
+
[CapturePublicEventType.ZoneApplyFilterRegexToWholeLinesChanged]: {
|
|
92
|
+
zone: TemplateZoneBase;
|
|
93
|
+
oldApplyFilterRegexToWholeLines: boolean;
|
|
94
|
+
newApplyFilterRegexToWholeLines: boolean;
|
|
95
|
+
};
|
|
96
|
+
[CapturePublicEventType.ZoneIsFilterRegexNegatedChanged]: {
|
|
97
|
+
zone: TemplateZoneBase;
|
|
98
|
+
oldIsFilterRegexNegated: boolean;
|
|
99
|
+
newIsFilterRegexNegated: boolean;
|
|
100
|
+
};
|
|
81
101
|
[CapturePublicEventType.ZoneExampleChanged]: {
|
|
82
102
|
zone: TemplateZoneBase;
|
|
83
103
|
oldExample: string;
|
|
@@ -165,15 +185,22 @@ declare const CaptureZoneEventType: {
|
|
|
165
185
|
readonly ZoneExampleChanged: "zone_internal:example_changed";
|
|
166
186
|
readonly ZoneHiddenChanged: "zone_internal:hidden_changed";
|
|
167
187
|
readonly ZoneFilterRegexChanged: "zone_internal:filter_regex_changed";
|
|
188
|
+
readonly ZoneApplyFilterRegexToWholeLinesChanged: "zone_internal:apply_filter_regex_to_whole_lines_changed";
|
|
189
|
+
readonly ZoneIsFilterRegexNegatedChanged: "zone_internal:is_filter_regex_negated_changed";
|
|
168
190
|
readonly ZoneOutputRegexChanged: "zone_internal:output_regex_changed";
|
|
169
191
|
readonly ZoneOutputReplacementChanged: "zone_internal:output_replacement_changed";
|
|
192
|
+
readonly ZoneOutputFunctionChanged: "zone_internal:output_function_changed";
|
|
170
193
|
readonly ZoneRequiredChanged: "zone_internal:required_changed";
|
|
171
194
|
readonly ZoneDataTypeChanged: "zone_internal:data_type_changed";
|
|
172
195
|
readonly ZoneExcludeFromOutputChanged: "zone_internal:exclude_from_output_changed";
|
|
173
196
|
readonly ZoneDefaultValueIfEmptyChanged: "zone_internal:default_value_if_empty_changed";
|
|
197
|
+
readonly ZoneFeatureFlagsChanged: "zone_internal:feature_flags_changed";
|
|
174
198
|
readonly ZoneOcrMatchesChanged: "zone_internal:ocr_matches_changed";
|
|
175
199
|
readonly ZoneGroupChildrenChanged: "zone_internal:group_children_changed";
|
|
176
200
|
readonly ZoneAnchorLocationChanged: "zone_internal:anchor_location_changed";
|
|
201
|
+
readonly ZoneHasColumnHeadersChanged: "zone_internal:has_column_headers_changed";
|
|
202
|
+
readonly ZoneExcludeColumnHeadersChanged: "zone_internal:exclude_column_headers_changed";
|
|
203
|
+
readonly ZoneIsAnchorPerLineChanged: "zone_internal:is_anchor_per_line_changed";
|
|
177
204
|
};
|
|
178
205
|
type CaptureZoneEventType = typeof CaptureZoneEventType[keyof typeof CaptureZoneEventType];
|
|
179
206
|
interface CaptureZoneEventPayloads {
|
|
@@ -201,6 +228,14 @@ interface CaptureZoneEventPayloads {
|
|
|
201
228
|
oldFilterRegex: string | null;
|
|
202
229
|
newFilterRegex: string | null;
|
|
203
230
|
};
|
|
231
|
+
[CaptureZoneEventType.ZoneApplyFilterRegexToWholeLinesChanged]: {
|
|
232
|
+
oldApplyFilterRegexToWholeLines: boolean;
|
|
233
|
+
newApplyFilterRegexToWholeLines: boolean;
|
|
234
|
+
};
|
|
235
|
+
[CaptureZoneEventType.ZoneIsFilterRegexNegatedChanged]: {
|
|
236
|
+
oldIsFilterRegexNegated: boolean;
|
|
237
|
+
newIsFilterRegexNegated: boolean;
|
|
238
|
+
};
|
|
204
239
|
[CaptureZoneEventType.ZoneOutputRegexChanged]: {
|
|
205
240
|
oldOutputRegex: string | null;
|
|
206
241
|
newOutputRegex: string | null;
|
|
@@ -209,6 +244,10 @@ interface CaptureZoneEventPayloads {
|
|
|
209
244
|
oldOutputReplacement: string | null;
|
|
210
245
|
newOutputReplacement: string | null;
|
|
211
246
|
};
|
|
247
|
+
[CaptureZoneEventType.ZoneOutputFunctionChanged]: {
|
|
248
|
+
oldOutputFunction: OutputFunction | null;
|
|
249
|
+
newOutputFunction: OutputFunction | null;
|
|
250
|
+
};
|
|
212
251
|
[CaptureZoneEventType.ZoneRequiredChanged]: {
|
|
213
252
|
oldRequired: boolean;
|
|
214
253
|
newRequired: boolean;
|
|
@@ -225,6 +264,10 @@ interface CaptureZoneEventPayloads {
|
|
|
225
264
|
oldDefaultValueIfEmpty: string | null;
|
|
226
265
|
newDefaultValueIfEmpty: string | null;
|
|
227
266
|
};
|
|
267
|
+
[CaptureZoneEventType.ZoneFeatureFlagsChanged]: {
|
|
268
|
+
oldFeatureFlags: string[] | null;
|
|
269
|
+
newFeatureFlags: string[] | null;
|
|
270
|
+
};
|
|
228
271
|
[CaptureZoneEventType.ZoneCanvasManagerSet]: {
|
|
229
272
|
canvasManager: ZoneCanvasManager;
|
|
230
273
|
};
|
|
@@ -239,6 +282,18 @@ interface CaptureZoneEventPayloads {
|
|
|
239
282
|
oldAnchorLocation: AnchorLocation;
|
|
240
283
|
newAnchorLocation: AnchorLocation;
|
|
241
284
|
};
|
|
285
|
+
[CaptureZoneEventType.ZoneHasColumnHeadersChanged]: {
|
|
286
|
+
newHasColumnHeaders: boolean;
|
|
287
|
+
oldHasColumnHeaders: boolean;
|
|
288
|
+
};
|
|
289
|
+
[CaptureZoneEventType.ZoneExcludeColumnHeadersChanged]: {
|
|
290
|
+
newExcludeColumnHeaders: boolean;
|
|
291
|
+
oldExcludeColumnHeaders: boolean;
|
|
292
|
+
};
|
|
293
|
+
[CaptureZoneEventType.ZoneIsAnchorPerLineChanged]: {
|
|
294
|
+
newIsAnchorPerLine: boolean;
|
|
295
|
+
oldIsAnchorPerLine: boolean;
|
|
296
|
+
};
|
|
242
297
|
}
|
|
243
298
|
declare const CaptureEngineToZoneEventType: {
|
|
244
299
|
readonly CanvasObjectPositionChanged: "canvas:object_position_changed";
|
|
@@ -289,8 +344,11 @@ declare const CaptureToEngineEventType: {
|
|
|
289
344
|
readonly ZonePositionChanged: "zone:position_changed";
|
|
290
345
|
readonly ZoneNameChanged: "zone:name_changed";
|
|
291
346
|
readonly ZoneFilterRegexChanged: "zone:filter_regex_changed";
|
|
347
|
+
readonly ZoneApplyFilterRegexToWholeLinesChanged: "zone:apply_filter_regex_to_whole_lines_changed";
|
|
348
|
+
readonly ZoneIsFilterRegexNegatedChanged: "zone:is_filter_regex_negated_changed";
|
|
292
349
|
readonly ZoneOutputRegexChanged: "zone:output_regex_changed";
|
|
293
350
|
readonly ZoneOutputReplacementChanged: "zone:output_replacement_changed";
|
|
351
|
+
readonly ZoneOutputFunctionChanged: "zone:output_function_changed";
|
|
294
352
|
readonly ZoneRequiredChanged: "zone:required_changed";
|
|
295
353
|
readonly ZoneDataTypeChanged: "zone:data_type_changed";
|
|
296
354
|
readonly ZoneExcludeFromOutputChanged: "zone:exclude_from_output_changed";
|
|
@@ -300,6 +358,10 @@ declare const CaptureToEngineEventType: {
|
|
|
300
358
|
readonly ZoneChanged: "zone:changed";
|
|
301
359
|
readonly ZoneAnchorLocationChanged: "zone:anchor_location_changed";
|
|
302
360
|
readonly ZoneGroupChildrenChanged: "zone:group_children_changed";
|
|
361
|
+
readonly ZoneHasColumnHeadersChanged: "zone:has_column_headers_changed";
|
|
362
|
+
readonly ZoneExcludeColumnHeadersChanged: "zone:exclude_column_headers_changed";
|
|
363
|
+
readonly ZoneIsAnchorPerLineChanged: "zone:is_anchor_per_line_changed";
|
|
364
|
+
readonly ZoneFeatureFlagsChanged: "zone:feature_flags_changed";
|
|
303
365
|
readonly ZoneChildZoneAdded: "zone:child_zone_added";
|
|
304
366
|
readonly ZoneChildZoneRemoved: "zone:child_zone_removed";
|
|
305
367
|
readonly ZoneChildZonesChanged: "zone:child_zone_changed";
|
|
@@ -322,6 +384,16 @@ interface CaptureToEngineEventPayloads {
|
|
|
322
384
|
oldFilterRegex: string | null;
|
|
323
385
|
newFilterRegex: string | null;
|
|
324
386
|
};
|
|
387
|
+
[CaptureToEngineEventType.ZoneApplyFilterRegexToWholeLinesChanged]: {
|
|
388
|
+
zone: TemplateZoneBase;
|
|
389
|
+
oldApplyFilterRegexToWholeLines: boolean;
|
|
390
|
+
newApplyFilterRegexToWholeLines: boolean;
|
|
391
|
+
};
|
|
392
|
+
[CaptureToEngineEventType.ZoneIsFilterRegexNegatedChanged]: {
|
|
393
|
+
zone: TemplateZoneBase;
|
|
394
|
+
oldIsFilterRegexNegated: boolean;
|
|
395
|
+
newIsFilterRegexNegated: boolean;
|
|
396
|
+
};
|
|
325
397
|
[CaptureToEngineEventType.ZoneOutputRegexChanged]: {
|
|
326
398
|
zone: TemplateZoneBase;
|
|
327
399
|
oldOutputRegex: string | null;
|
|
@@ -332,6 +404,11 @@ interface CaptureToEngineEventPayloads {
|
|
|
332
404
|
oldOutputReplacement: string | null;
|
|
333
405
|
newOutputReplacement: string | null;
|
|
334
406
|
};
|
|
407
|
+
[CaptureToEngineEventType.ZoneOutputFunctionChanged]: {
|
|
408
|
+
zone: TemplateZoneBase;
|
|
409
|
+
oldOutputFunction: OutputFunction | null;
|
|
410
|
+
newOutputFunction: OutputFunction | null;
|
|
411
|
+
};
|
|
335
412
|
[CaptureToEngineEventType.ZoneRequiredChanged]: {
|
|
336
413
|
zone: TemplateZoneBase;
|
|
337
414
|
oldRequired: boolean;
|
|
@@ -376,6 +453,26 @@ interface CaptureToEngineEventPayloads {
|
|
|
376
453
|
newGroupChildren: boolean;
|
|
377
454
|
oldGroupChildren: boolean;
|
|
378
455
|
};
|
|
456
|
+
[CaptureToEngineEventType.ZoneHasColumnHeadersChanged]: {
|
|
457
|
+
zone: TemplateZoneBase;
|
|
458
|
+
newHasColumnHeaders: boolean;
|
|
459
|
+
oldHasColumnHeaders: boolean;
|
|
460
|
+
};
|
|
461
|
+
[CaptureToEngineEventType.ZoneExcludeColumnHeadersChanged]: {
|
|
462
|
+
zone: TemplateZoneBase;
|
|
463
|
+
newExcludeColumnHeaders: boolean;
|
|
464
|
+
oldExcludeColumnHeaders: boolean;
|
|
465
|
+
};
|
|
466
|
+
[CaptureToEngineEventType.ZoneIsAnchorPerLineChanged]: {
|
|
467
|
+
zone: TemplateZoneBase;
|
|
468
|
+
newIsAnchorPerLine: boolean;
|
|
469
|
+
oldIsAnchorPerLine: boolean;
|
|
470
|
+
};
|
|
471
|
+
[CaptureToEngineEventType.ZoneFeatureFlagsChanged]: {
|
|
472
|
+
zone: TemplateZoneBase;
|
|
473
|
+
oldFeatureFlags: string[] | null;
|
|
474
|
+
newFeatureFlags: string[] | null;
|
|
475
|
+
};
|
|
379
476
|
[CaptureToEngineEventType.ZoneChildZoneAdded]: {
|
|
380
477
|
parentZone: TemplateZoneBase;
|
|
381
478
|
newChildZone: TemplateZoneBase;
|
|
@@ -393,8 +490,9 @@ interface CaptureToEngineEventPayloads {
|
|
|
393
490
|
message: string;
|
|
394
491
|
};
|
|
395
492
|
}
|
|
396
|
-
type ZoneKind = "simple" | "anchor" | "anchor-child";
|
|
397
|
-
type AnchorLocation = "TopLeft" | "TopRight" | "BottomLeft" | "BottomRight" | "CenterMiddle" | "CenterTop" | "CenterBottom" | "MiddleLeft" | "MiddleRight";
|
|
493
|
+
type ZoneKind = "simple" | "anchor" | "anchor-child" | "static";
|
|
494
|
+
type AnchorLocation = "TopLeft" | "TopRight" | "BottomLeft" | "BottomRight" | "CenterMiddle" | "CenterTop" | "CenterBottom" | "MiddleLeft" | "MiddleRight" | "PerRowLeft" | "PerRowRight" | "PerColumnTop" | "PerColumnBottom";
|
|
495
|
+
type OutputFunction = "Replace" | "List" | "Single";
|
|
398
496
|
interface TemplateZoneBase {
|
|
399
497
|
id: string;
|
|
400
498
|
name: string;
|
|
@@ -404,14 +502,21 @@ interface TemplateZoneBase {
|
|
|
404
502
|
rect: Rectangle;
|
|
405
503
|
hidden?: boolean;
|
|
406
504
|
filterRegex: string | null;
|
|
505
|
+
applyFilterRegexToWholeLines: boolean;
|
|
506
|
+
isFilterRegexNegated: boolean;
|
|
407
507
|
outputRegex: string | null;
|
|
408
508
|
outputReplacement: string | null;
|
|
509
|
+
outputFunction: OutputFunction | null;
|
|
409
510
|
required: boolean;
|
|
410
511
|
dataType: string | null;
|
|
411
512
|
excludeFromOutput: boolean;
|
|
412
513
|
defaultValueIfEmpty: string | null;
|
|
413
514
|
anchorLocation?: AnchorLocation;
|
|
414
515
|
groupChildren?: boolean;
|
|
516
|
+
featureFlags: string[] | null;
|
|
517
|
+
hasColumnHeaders?: boolean;
|
|
518
|
+
excludeColumnHeaders?: boolean;
|
|
519
|
+
isAnchorPerLine?: boolean;
|
|
415
520
|
children?: TemplateZoneBase[];
|
|
416
521
|
handleEvent?<T extends CaptureEngineToZoneEventType>(id: string, type: T, payload: CaptureEngineToZoneEventPayloads[T]): void;
|
|
417
522
|
setCanvasManager?(cm?: ZoneCanvasManager): void;
|
|
@@ -461,7 +566,6 @@ declare class CaptureEngine {
|
|
|
461
566
|
private onZoneAdded;
|
|
462
567
|
private onZoneRemoved;
|
|
463
568
|
private getZoneByCanvasEngineId;
|
|
464
|
-
private doRender;
|
|
465
569
|
private createMeteredFn;
|
|
466
570
|
loadExternalTemplate(external: ExternalTemplate, reapplyZonePositioning: boolean): void;
|
|
467
571
|
getExternalTemplate(): ExternalTemplate;
|
|
@@ -471,6 +575,10 @@ declare class CaptureEngine {
|
|
|
471
575
|
set name(value: string);
|
|
472
576
|
get allZonesFlattened(): TemplateZoneBase[];
|
|
473
577
|
getZoneById(id: string): TemplateZoneBase | undefined;
|
|
578
|
+
/**
|
|
579
|
+
* Add a new static zone
|
|
580
|
+
*/
|
|
581
|
+
addStaticZone(makeCurrentSelected?: boolean): TemplateZoneBase;
|
|
474
582
|
/**
|
|
475
583
|
* Add a new simple zone
|
|
476
584
|
* @param bounds Rectangle
|
package/dist/index.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ import { InteractiveObject, ZoomToolOptions } from 'dytools-canvas-engine';
|
|
|
2
2
|
import { Rectangle, Size, Point, Polygon, Vector } from 'dytools-geometry';
|
|
3
3
|
import { Result } from 'dytools-result';
|
|
4
4
|
|
|
5
|
-
type ExternalZoneType = "TemplateSimpleZone" | "TemplateAnchorZone" | "TemplateAnchorZoneChild";
|
|
5
|
+
type ExternalZoneType = "TemplateSimpleZone" | "TemplateAnchorZone" | "TemplateAnchorZoneChild" | "TemplateStaticZone";
|
|
6
6
|
interface ExternalTemplateZone {
|
|
7
7
|
TemplateZoneId: string;
|
|
8
8
|
Name: string;
|
|
9
9
|
Type: ExternalZoneType;
|
|
10
|
-
X
|
|
11
|
-
Y
|
|
12
|
-
Width
|
|
13
|
-
Height
|
|
10
|
+
X?: number;
|
|
11
|
+
Y?: number;
|
|
12
|
+
Width?: number;
|
|
13
|
+
Height?: number;
|
|
14
14
|
XAbsolute?: number;
|
|
15
15
|
YAbsolute?: number;
|
|
16
16
|
WidthAbsolute?: number;
|
|
@@ -18,14 +18,22 @@ interface ExternalTemplateZone {
|
|
|
18
18
|
AnchorLocationXAbsoluteHint?: number;
|
|
19
19
|
AnchorLocationYAbsoluteHint?: number;
|
|
20
20
|
RegExFilter?: string | null;
|
|
21
|
+
ApplyRegExFilterToWholeLines?: boolean;
|
|
22
|
+
IsRegExFilterNegated?: boolean;
|
|
21
23
|
RegExOutput?: string | null;
|
|
22
24
|
RegExReplacement?: string | null;
|
|
25
|
+
OutputFunction?: OutputFunction | null;
|
|
23
26
|
Required?: boolean;
|
|
24
27
|
DataType?: string | null;
|
|
25
28
|
ExcludeFromOutput?: boolean;
|
|
26
29
|
DefaultValueIfEmpty?: string | null;
|
|
30
|
+
Value?: string | null;
|
|
27
31
|
AnchorLocation?: string;
|
|
28
32
|
GroupChildrenInSubRecord?: boolean;
|
|
33
|
+
HasColumnHeaders?: boolean;
|
|
34
|
+
ExcludeColumnHeaders?: boolean;
|
|
35
|
+
IsAnchorPerLine?: boolean;
|
|
36
|
+
FeatureFlags?: string[];
|
|
29
37
|
ChildZones?: ExternalTemplateZone[];
|
|
30
38
|
}
|
|
31
39
|
interface ExternalTemplate {
|
|
@@ -38,6 +46,8 @@ declare const CapturePublicEventType: {
|
|
|
38
46
|
readonly ZonePositionChanged: "zone:position_changed";
|
|
39
47
|
readonly ZoneNameChanged: "zone:name_changed";
|
|
40
48
|
readonly ZoneFilterRegexChanged: "zone:filter_regex_changed";
|
|
49
|
+
readonly ZoneApplyFilterRegexToWholeLinesChanged: "zone:apply_filter_regex_to_whole_lines_changed";
|
|
50
|
+
readonly ZoneIsFilterRegexNegatedChanged: "zone:is_filter_regex_negated_changed";
|
|
41
51
|
readonly ZoneExampleChanged: "zone:example_changed";
|
|
42
52
|
readonly ZoneHiddenChanged: "zone:hidden_changed";
|
|
43
53
|
readonly ZoneChanged: "zone:changed";
|
|
@@ -78,6 +88,16 @@ interface CapturePublicEventPayloads {
|
|
|
78
88
|
oldFilterRegex: number;
|
|
79
89
|
newFilterRegex: number;
|
|
80
90
|
};
|
|
91
|
+
[CapturePublicEventType.ZoneApplyFilterRegexToWholeLinesChanged]: {
|
|
92
|
+
zone: TemplateZoneBase;
|
|
93
|
+
oldApplyFilterRegexToWholeLines: boolean;
|
|
94
|
+
newApplyFilterRegexToWholeLines: boolean;
|
|
95
|
+
};
|
|
96
|
+
[CapturePublicEventType.ZoneIsFilterRegexNegatedChanged]: {
|
|
97
|
+
zone: TemplateZoneBase;
|
|
98
|
+
oldIsFilterRegexNegated: boolean;
|
|
99
|
+
newIsFilterRegexNegated: boolean;
|
|
100
|
+
};
|
|
81
101
|
[CapturePublicEventType.ZoneExampleChanged]: {
|
|
82
102
|
zone: TemplateZoneBase;
|
|
83
103
|
oldExample: string;
|
|
@@ -165,15 +185,22 @@ declare const CaptureZoneEventType: {
|
|
|
165
185
|
readonly ZoneExampleChanged: "zone_internal:example_changed";
|
|
166
186
|
readonly ZoneHiddenChanged: "zone_internal:hidden_changed";
|
|
167
187
|
readonly ZoneFilterRegexChanged: "zone_internal:filter_regex_changed";
|
|
188
|
+
readonly ZoneApplyFilterRegexToWholeLinesChanged: "zone_internal:apply_filter_regex_to_whole_lines_changed";
|
|
189
|
+
readonly ZoneIsFilterRegexNegatedChanged: "zone_internal:is_filter_regex_negated_changed";
|
|
168
190
|
readonly ZoneOutputRegexChanged: "zone_internal:output_regex_changed";
|
|
169
191
|
readonly ZoneOutputReplacementChanged: "zone_internal:output_replacement_changed";
|
|
192
|
+
readonly ZoneOutputFunctionChanged: "zone_internal:output_function_changed";
|
|
170
193
|
readonly ZoneRequiredChanged: "zone_internal:required_changed";
|
|
171
194
|
readonly ZoneDataTypeChanged: "zone_internal:data_type_changed";
|
|
172
195
|
readonly ZoneExcludeFromOutputChanged: "zone_internal:exclude_from_output_changed";
|
|
173
196
|
readonly ZoneDefaultValueIfEmptyChanged: "zone_internal:default_value_if_empty_changed";
|
|
197
|
+
readonly ZoneFeatureFlagsChanged: "zone_internal:feature_flags_changed";
|
|
174
198
|
readonly ZoneOcrMatchesChanged: "zone_internal:ocr_matches_changed";
|
|
175
199
|
readonly ZoneGroupChildrenChanged: "zone_internal:group_children_changed";
|
|
176
200
|
readonly ZoneAnchorLocationChanged: "zone_internal:anchor_location_changed";
|
|
201
|
+
readonly ZoneHasColumnHeadersChanged: "zone_internal:has_column_headers_changed";
|
|
202
|
+
readonly ZoneExcludeColumnHeadersChanged: "zone_internal:exclude_column_headers_changed";
|
|
203
|
+
readonly ZoneIsAnchorPerLineChanged: "zone_internal:is_anchor_per_line_changed";
|
|
177
204
|
};
|
|
178
205
|
type CaptureZoneEventType = typeof CaptureZoneEventType[keyof typeof CaptureZoneEventType];
|
|
179
206
|
interface CaptureZoneEventPayloads {
|
|
@@ -201,6 +228,14 @@ interface CaptureZoneEventPayloads {
|
|
|
201
228
|
oldFilterRegex: string | null;
|
|
202
229
|
newFilterRegex: string | null;
|
|
203
230
|
};
|
|
231
|
+
[CaptureZoneEventType.ZoneApplyFilterRegexToWholeLinesChanged]: {
|
|
232
|
+
oldApplyFilterRegexToWholeLines: boolean;
|
|
233
|
+
newApplyFilterRegexToWholeLines: boolean;
|
|
234
|
+
};
|
|
235
|
+
[CaptureZoneEventType.ZoneIsFilterRegexNegatedChanged]: {
|
|
236
|
+
oldIsFilterRegexNegated: boolean;
|
|
237
|
+
newIsFilterRegexNegated: boolean;
|
|
238
|
+
};
|
|
204
239
|
[CaptureZoneEventType.ZoneOutputRegexChanged]: {
|
|
205
240
|
oldOutputRegex: string | null;
|
|
206
241
|
newOutputRegex: string | null;
|
|
@@ -209,6 +244,10 @@ interface CaptureZoneEventPayloads {
|
|
|
209
244
|
oldOutputReplacement: string | null;
|
|
210
245
|
newOutputReplacement: string | null;
|
|
211
246
|
};
|
|
247
|
+
[CaptureZoneEventType.ZoneOutputFunctionChanged]: {
|
|
248
|
+
oldOutputFunction: OutputFunction | null;
|
|
249
|
+
newOutputFunction: OutputFunction | null;
|
|
250
|
+
};
|
|
212
251
|
[CaptureZoneEventType.ZoneRequiredChanged]: {
|
|
213
252
|
oldRequired: boolean;
|
|
214
253
|
newRequired: boolean;
|
|
@@ -225,6 +264,10 @@ interface CaptureZoneEventPayloads {
|
|
|
225
264
|
oldDefaultValueIfEmpty: string | null;
|
|
226
265
|
newDefaultValueIfEmpty: string | null;
|
|
227
266
|
};
|
|
267
|
+
[CaptureZoneEventType.ZoneFeatureFlagsChanged]: {
|
|
268
|
+
oldFeatureFlags: string[] | null;
|
|
269
|
+
newFeatureFlags: string[] | null;
|
|
270
|
+
};
|
|
228
271
|
[CaptureZoneEventType.ZoneCanvasManagerSet]: {
|
|
229
272
|
canvasManager: ZoneCanvasManager;
|
|
230
273
|
};
|
|
@@ -239,6 +282,18 @@ interface CaptureZoneEventPayloads {
|
|
|
239
282
|
oldAnchorLocation: AnchorLocation;
|
|
240
283
|
newAnchorLocation: AnchorLocation;
|
|
241
284
|
};
|
|
285
|
+
[CaptureZoneEventType.ZoneHasColumnHeadersChanged]: {
|
|
286
|
+
newHasColumnHeaders: boolean;
|
|
287
|
+
oldHasColumnHeaders: boolean;
|
|
288
|
+
};
|
|
289
|
+
[CaptureZoneEventType.ZoneExcludeColumnHeadersChanged]: {
|
|
290
|
+
newExcludeColumnHeaders: boolean;
|
|
291
|
+
oldExcludeColumnHeaders: boolean;
|
|
292
|
+
};
|
|
293
|
+
[CaptureZoneEventType.ZoneIsAnchorPerLineChanged]: {
|
|
294
|
+
newIsAnchorPerLine: boolean;
|
|
295
|
+
oldIsAnchorPerLine: boolean;
|
|
296
|
+
};
|
|
242
297
|
}
|
|
243
298
|
declare const CaptureEngineToZoneEventType: {
|
|
244
299
|
readonly CanvasObjectPositionChanged: "canvas:object_position_changed";
|
|
@@ -289,8 +344,11 @@ declare const CaptureToEngineEventType: {
|
|
|
289
344
|
readonly ZonePositionChanged: "zone:position_changed";
|
|
290
345
|
readonly ZoneNameChanged: "zone:name_changed";
|
|
291
346
|
readonly ZoneFilterRegexChanged: "zone:filter_regex_changed";
|
|
347
|
+
readonly ZoneApplyFilterRegexToWholeLinesChanged: "zone:apply_filter_regex_to_whole_lines_changed";
|
|
348
|
+
readonly ZoneIsFilterRegexNegatedChanged: "zone:is_filter_regex_negated_changed";
|
|
292
349
|
readonly ZoneOutputRegexChanged: "zone:output_regex_changed";
|
|
293
350
|
readonly ZoneOutputReplacementChanged: "zone:output_replacement_changed";
|
|
351
|
+
readonly ZoneOutputFunctionChanged: "zone:output_function_changed";
|
|
294
352
|
readonly ZoneRequiredChanged: "zone:required_changed";
|
|
295
353
|
readonly ZoneDataTypeChanged: "zone:data_type_changed";
|
|
296
354
|
readonly ZoneExcludeFromOutputChanged: "zone:exclude_from_output_changed";
|
|
@@ -300,6 +358,10 @@ declare const CaptureToEngineEventType: {
|
|
|
300
358
|
readonly ZoneChanged: "zone:changed";
|
|
301
359
|
readonly ZoneAnchorLocationChanged: "zone:anchor_location_changed";
|
|
302
360
|
readonly ZoneGroupChildrenChanged: "zone:group_children_changed";
|
|
361
|
+
readonly ZoneHasColumnHeadersChanged: "zone:has_column_headers_changed";
|
|
362
|
+
readonly ZoneExcludeColumnHeadersChanged: "zone:exclude_column_headers_changed";
|
|
363
|
+
readonly ZoneIsAnchorPerLineChanged: "zone:is_anchor_per_line_changed";
|
|
364
|
+
readonly ZoneFeatureFlagsChanged: "zone:feature_flags_changed";
|
|
303
365
|
readonly ZoneChildZoneAdded: "zone:child_zone_added";
|
|
304
366
|
readonly ZoneChildZoneRemoved: "zone:child_zone_removed";
|
|
305
367
|
readonly ZoneChildZonesChanged: "zone:child_zone_changed";
|
|
@@ -322,6 +384,16 @@ interface CaptureToEngineEventPayloads {
|
|
|
322
384
|
oldFilterRegex: string | null;
|
|
323
385
|
newFilterRegex: string | null;
|
|
324
386
|
};
|
|
387
|
+
[CaptureToEngineEventType.ZoneApplyFilterRegexToWholeLinesChanged]: {
|
|
388
|
+
zone: TemplateZoneBase;
|
|
389
|
+
oldApplyFilterRegexToWholeLines: boolean;
|
|
390
|
+
newApplyFilterRegexToWholeLines: boolean;
|
|
391
|
+
};
|
|
392
|
+
[CaptureToEngineEventType.ZoneIsFilterRegexNegatedChanged]: {
|
|
393
|
+
zone: TemplateZoneBase;
|
|
394
|
+
oldIsFilterRegexNegated: boolean;
|
|
395
|
+
newIsFilterRegexNegated: boolean;
|
|
396
|
+
};
|
|
325
397
|
[CaptureToEngineEventType.ZoneOutputRegexChanged]: {
|
|
326
398
|
zone: TemplateZoneBase;
|
|
327
399
|
oldOutputRegex: string | null;
|
|
@@ -332,6 +404,11 @@ interface CaptureToEngineEventPayloads {
|
|
|
332
404
|
oldOutputReplacement: string | null;
|
|
333
405
|
newOutputReplacement: string | null;
|
|
334
406
|
};
|
|
407
|
+
[CaptureToEngineEventType.ZoneOutputFunctionChanged]: {
|
|
408
|
+
zone: TemplateZoneBase;
|
|
409
|
+
oldOutputFunction: OutputFunction | null;
|
|
410
|
+
newOutputFunction: OutputFunction | null;
|
|
411
|
+
};
|
|
335
412
|
[CaptureToEngineEventType.ZoneRequiredChanged]: {
|
|
336
413
|
zone: TemplateZoneBase;
|
|
337
414
|
oldRequired: boolean;
|
|
@@ -376,6 +453,26 @@ interface CaptureToEngineEventPayloads {
|
|
|
376
453
|
newGroupChildren: boolean;
|
|
377
454
|
oldGroupChildren: boolean;
|
|
378
455
|
};
|
|
456
|
+
[CaptureToEngineEventType.ZoneHasColumnHeadersChanged]: {
|
|
457
|
+
zone: TemplateZoneBase;
|
|
458
|
+
newHasColumnHeaders: boolean;
|
|
459
|
+
oldHasColumnHeaders: boolean;
|
|
460
|
+
};
|
|
461
|
+
[CaptureToEngineEventType.ZoneExcludeColumnHeadersChanged]: {
|
|
462
|
+
zone: TemplateZoneBase;
|
|
463
|
+
newExcludeColumnHeaders: boolean;
|
|
464
|
+
oldExcludeColumnHeaders: boolean;
|
|
465
|
+
};
|
|
466
|
+
[CaptureToEngineEventType.ZoneIsAnchorPerLineChanged]: {
|
|
467
|
+
zone: TemplateZoneBase;
|
|
468
|
+
newIsAnchorPerLine: boolean;
|
|
469
|
+
oldIsAnchorPerLine: boolean;
|
|
470
|
+
};
|
|
471
|
+
[CaptureToEngineEventType.ZoneFeatureFlagsChanged]: {
|
|
472
|
+
zone: TemplateZoneBase;
|
|
473
|
+
oldFeatureFlags: string[] | null;
|
|
474
|
+
newFeatureFlags: string[] | null;
|
|
475
|
+
};
|
|
379
476
|
[CaptureToEngineEventType.ZoneChildZoneAdded]: {
|
|
380
477
|
parentZone: TemplateZoneBase;
|
|
381
478
|
newChildZone: TemplateZoneBase;
|
|
@@ -393,8 +490,9 @@ interface CaptureToEngineEventPayloads {
|
|
|
393
490
|
message: string;
|
|
394
491
|
};
|
|
395
492
|
}
|
|
396
|
-
type ZoneKind = "simple" | "anchor" | "anchor-child";
|
|
397
|
-
type AnchorLocation = "TopLeft" | "TopRight" | "BottomLeft" | "BottomRight" | "CenterMiddle" | "CenterTop" | "CenterBottom" | "MiddleLeft" | "MiddleRight";
|
|
493
|
+
type ZoneKind = "simple" | "anchor" | "anchor-child" | "static";
|
|
494
|
+
type AnchorLocation = "TopLeft" | "TopRight" | "BottomLeft" | "BottomRight" | "CenterMiddle" | "CenterTop" | "CenterBottom" | "MiddleLeft" | "MiddleRight" | "PerRowLeft" | "PerRowRight" | "PerColumnTop" | "PerColumnBottom";
|
|
495
|
+
type OutputFunction = "Replace" | "List" | "Single";
|
|
398
496
|
interface TemplateZoneBase {
|
|
399
497
|
id: string;
|
|
400
498
|
name: string;
|
|
@@ -404,14 +502,21 @@ interface TemplateZoneBase {
|
|
|
404
502
|
rect: Rectangle;
|
|
405
503
|
hidden?: boolean;
|
|
406
504
|
filterRegex: string | null;
|
|
505
|
+
applyFilterRegexToWholeLines: boolean;
|
|
506
|
+
isFilterRegexNegated: boolean;
|
|
407
507
|
outputRegex: string | null;
|
|
408
508
|
outputReplacement: string | null;
|
|
509
|
+
outputFunction: OutputFunction | null;
|
|
409
510
|
required: boolean;
|
|
410
511
|
dataType: string | null;
|
|
411
512
|
excludeFromOutput: boolean;
|
|
412
513
|
defaultValueIfEmpty: string | null;
|
|
413
514
|
anchorLocation?: AnchorLocation;
|
|
414
515
|
groupChildren?: boolean;
|
|
516
|
+
featureFlags: string[] | null;
|
|
517
|
+
hasColumnHeaders?: boolean;
|
|
518
|
+
excludeColumnHeaders?: boolean;
|
|
519
|
+
isAnchorPerLine?: boolean;
|
|
415
520
|
children?: TemplateZoneBase[];
|
|
416
521
|
handleEvent?<T extends CaptureEngineToZoneEventType>(id: string, type: T, payload: CaptureEngineToZoneEventPayloads[T]): void;
|
|
417
522
|
setCanvasManager?(cm?: ZoneCanvasManager): void;
|
|
@@ -461,7 +566,6 @@ declare class CaptureEngine {
|
|
|
461
566
|
private onZoneAdded;
|
|
462
567
|
private onZoneRemoved;
|
|
463
568
|
private getZoneByCanvasEngineId;
|
|
464
|
-
private doRender;
|
|
465
569
|
private createMeteredFn;
|
|
466
570
|
loadExternalTemplate(external: ExternalTemplate, reapplyZonePositioning: boolean): void;
|
|
467
571
|
getExternalTemplate(): ExternalTemplate;
|
|
@@ -471,6 +575,10 @@ declare class CaptureEngine {
|
|
|
471
575
|
set name(value: string);
|
|
472
576
|
get allZonesFlattened(): TemplateZoneBase[];
|
|
473
577
|
getZoneById(id: string): TemplateZoneBase | undefined;
|
|
578
|
+
/**
|
|
579
|
+
* Add a new static zone
|
|
580
|
+
*/
|
|
581
|
+
addStaticZone(makeCurrentSelected?: boolean): TemplateZoneBase;
|
|
474
582
|
/**
|
|
475
583
|
* Add a new simple zone
|
|
476
584
|
* @param bounds Rectangle
|