Skip to content

Commit 227db73

Browse files
authored
Merge pull request #14 from dynamsoft-docs/preview
update to internal commit 8650ee30
2 parents c6237bf + 41d9154 commit 227db73

File tree

4 files changed

+455
-22
lines changed

4 files changed

+455
-22
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
layout: default-layout
3+
title: ParsedResultItem - Dynamsoft Code Parser JavaScript Interface
4+
description: This page shows the ParsedResultItem interface of Dynamsoft Code Parser for JavaScript.
5+
keywords: ParsedResultItem, javascript, interface
6+
needAutoGenerateSidebar: false
7+
noTitleIndex: true
8+
breadcrumbText: ParsedResultItem
9+
---
10+
11+
# ParsedResultItem
12+
13+
The ParsedResultItem interface provides a structure representing the result items returned by Dynamsoft Code Parser.
14+
15+
```ts
16+
interface ParsedResultItem extends Core.CapturedResultItem {
17+
codeType: string;
18+
jsonString: string;
19+
getFieldValue: (fieldName: string) => string;
20+
getFieldMappingStatus: (fieldName: string) => EnumMappingStatus;
21+
getFieldValidationStatus: (fieldName: string) => EnumValidationStatus;
22+
}
23+
```
24+
25+
<!-- | API Name | Description |
26+
| ------------------------------------------------------- | ----------------------------------------------------------------------- |
27+
| [codeType](#codetype) | Returns the code type of the parsed result. |
28+
| [jsonString](#jsonstring) | Returns the parsed result as a JSON formatted string. |
29+
| [getFieldValue()](#getfieldvalue) | Gets the value of a specified field from the parsed result. |
30+
| [getFieldMappingStatus()](#getfieldmappingstatus) | Gets the mapping status of a specified field from the parsed result. |
31+
| [getFieldValidationStatus()](#getfieldvalidationstatus) | Gets the validation status of a specified field from the parsed result. | -->
32+
33+
## codeType
34+
35+
Returns the code type of the parsed result.
36+
37+
```ts
38+
codeType: string;
39+
```
40+
41+
## jsonString
42+
43+
Returns the parsed result as a JSON formatted string.
44+
45+
```ts
46+
jsonString: string;
47+
```
48+
49+
## getFieldValue
50+
51+
Gets the value of a specified field from the parsed result.
52+
53+
```ts
54+
getFieldValue(fieldName: string): string;
55+
```
56+
57+
**Parameters**
58+
59+
`fieldName`: specifies the name of the field.
60+
61+
**Return Value**
62+
63+
A string which contains the field value.
64+
65+
**Code Snippet**
66+
67+
```js
68+
parser.getFieldValue("passportNumber");
69+
```
70+
71+
## getFieldMappingStatus
72+
73+
Gets the mapping status of a specified field from the parsed result.
74+
75+
```ts
76+
getFieldMappingStatus: (fieldName: string) => EnumMappingStatus;
77+
```
78+
79+
**Parameters**
80+
81+
`fieldName`: specifies the name of the field.
82+
83+
**Return Value**
84+
85+
A value that indicates whether the mapping succeeded.
86+
87+
**Code Snippet**
88+
89+
```js
90+
await parser.getFieldMappingStatus("nationality");
91+
```
92+
93+
**See Also**
94+
95+
* [EnumMappingStatus](../enum/EnumMappingStatus.md)
96+
97+
## getFieldValidationStatus
98+
99+
Gets the validation status of a specified field from the parsed result.
100+
101+
```ts
102+
getFieldValidationStatus: (fieldName: string) => EnumValidationStatus;
103+
```
104+
105+
**Parameters**
106+
107+
`fieldName`: specifies the name of the field.
108+
109+
**Return Value**
110+
111+
A value that indicates whether the validation succeeded.
112+
113+
**Code Snippet**
114+
115+
```js
116+
await parser.getFieldValidationStatus("passportNumber");
117+
```
118+
119+
**See Also**
120+
121+
* [EnumValidationStatus](../enum/EnumValidationStatus.md)

programming/javascript/api-reference/interfaces/parsed-result-item.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ The ParsedResultItem interface provides a structure representing the result item
1616
interface ParsedResultItem extends Core.CapturedResultItem {
1717
codeType: string;
1818
jsonString: string;
19-
getFieldValue: (fieldName: string) => Promise<string>;
19+
getFieldValue: (fieldName: string) => string;
20+
getFieldRawValue: (fieldName: string) => string;
2021
getFieldMappingStatus: (fieldName: string) => EnumMappingStatus;
2122
getFieldValidationStatus: (fieldName: string) => EnumValidationStatus;
2223
}
@@ -51,7 +52,7 @@ jsonString: string;
5152
Gets the value of a specified field from the parsed result.
5253

5354
```ts
54-
getFieldValue(fieldName: string): Promise<string>;
55+
getFieldValue(fieldName: string): string;
5556
```
5657

5758
**Parameters**
@@ -60,12 +61,34 @@ getFieldValue(fieldName: string): Promise<string>;
6061

6162
**Return Value**
6263

63-
A promise resolving to a string which contains the field value.
64+
A string which contains the field value.
6465

6566
**Code Snippet**
6667

6768
```js
68-
await parser.getFieldValue("passportNumber");
69+
parser.getFieldValue("passportNumber");
70+
```
71+
72+
## getFieldRawValue
73+
74+
Gets the value of a specified field from the parsed result, without mapping process.
75+
76+
```ts
77+
getFieldRawValue(fieldName: string): string;
78+
```
79+
80+
**Parameters**
81+
82+
`fieldName`: specifies the name of the field.
83+
84+
**Return Value**
85+
86+
A string which contains the field raw value.
87+
88+
**Code Snippet**
89+
90+
```js
91+
parser.getFieldRawValue("passportNumber");
6992
```
7093

7194
## getFieldMappingStatus

0 commit comments

Comments
 (0)