-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprocessor.js
38 lines (36 loc) · 1.04 KB
/
processor.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Base class for all processors.
* Processor is object that performs specific parsing
* and updates its result with data extracted from the image.
*/
export class Processor {
constructor(processorType) {
/** Type of processor */
this.processorType = processorType;
}
}
/**
* Possible states of the Processor's result
*/
export const ProcessorResultState = Object.freeze(
{
/** Processor result is empty */
empty : 1,
/** Processor result contains some values, but is incomplete or it contains all values, but some are uncertain */
uncertain : 2,
/** Processor result contains all required values */
valid : 3
}
);
/**
* Base class for all processors's result objects.
* Processor result contains data extracted from the image.
*/
export class ProcessorResult {
constructor(resultState) {
/**
* State of the result. It is always one of the values represented by ProcessorResultState enum
*/
this.resultState = resultState;
}
}