Skip to content

update to internal commit 8650ee30 #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
layout: default-layout
title: ParsedResultItem - Dynamsoft Code Parser JavaScript Interface
description: This page shows the ParsedResultItem interface of Dynamsoft Code Parser for JavaScript.
keywords: ParsedResultItem, javascript, interface
needAutoGenerateSidebar: false
noTitleIndex: true
breadcrumbText: ParsedResultItem
---

# ParsedResultItem

The ParsedResultItem interface provides a structure representing the result items returned by Dynamsoft Code Parser.

```ts
interface ParsedResultItem extends Core.CapturedResultItem {
codeType: string;
jsonString: string;
getFieldValue: (fieldName: string) => string;
getFieldMappingStatus: (fieldName: string) => EnumMappingStatus;
getFieldValidationStatus: (fieldName: string) => EnumValidationStatus;
}
```

<!-- | API Name | Description |
| ------------------------------------------------------- | ----------------------------------------------------------------------- |
| [codeType](#codetype) | Returns the code type of the parsed result. |
| [jsonString](#jsonstring) | Returns the parsed result as a JSON formatted string. |
| [getFieldValue()](#getfieldvalue) | Gets the value of a specified field from the parsed result. |
| [getFieldMappingStatus()](#getfieldmappingstatus) | Gets the mapping status of a specified field from the parsed result. |
| [getFieldValidationStatus()](#getfieldvalidationstatus) | Gets the validation status of a specified field from the parsed result. | -->

## codeType

Returns the code type of the parsed result.

```ts
codeType: string;
```

## jsonString

Returns the parsed result as a JSON formatted string.

```ts
jsonString: string;
```

## getFieldValue

Gets the value of a specified field from the parsed result.

```ts
getFieldValue(fieldName: string): string;
```

**Parameters**

`fieldName`: specifies the name of the field.

**Return Value**

A string which contains the field value.

**Code Snippet**

```js
parser.getFieldValue("passportNumber");
```

## getFieldMappingStatus

Gets the mapping status of a specified field from the parsed result.

```ts
getFieldMappingStatus: (fieldName: string) => EnumMappingStatus;
```

**Parameters**

`fieldName`: specifies the name of the field.

**Return Value**

A value that indicates whether the mapping succeeded.

**Code Snippet**

```js
await parser.getFieldMappingStatus("nationality");
```

**See Also**

* [EnumMappingStatus](../enum/EnumMappingStatus.md)

## getFieldValidationStatus

Gets the validation status of a specified field from the parsed result.

```ts
getFieldValidationStatus: (fieldName: string) => EnumValidationStatus;
```

**Parameters**

`fieldName`: specifies the name of the field.

**Return Value**

A value that indicates whether the validation succeeded.

**Code Snippet**

```js
await parser.getFieldValidationStatus("passportNumber");
```

**See Also**

* [EnumValidationStatus](../enum/EnumValidationStatus.md)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ The ParsedResultItem interface provides a structure representing the result item
interface ParsedResultItem extends Core.CapturedResultItem {
codeType: string;
jsonString: string;
getFieldValue: (fieldName: string) => Promise<string>;
getFieldValue: (fieldName: string) => string;
getFieldRawValue: (fieldName: string) => string;
getFieldMappingStatus: (fieldName: string) => EnumMappingStatus;
getFieldValidationStatus: (fieldName: string) => EnumValidationStatus;
}
Expand Down Expand Up @@ -51,7 +52,7 @@ jsonString: string;
Gets the value of a specified field from the parsed result.

```ts
getFieldValue(fieldName: string): Promise<string>;
getFieldValue(fieldName: string): string;
```

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

**Return Value**

A promise resolving to a string which contains the field value.
A string which contains the field value.

**Code Snippet**

```js
await parser.getFieldValue("passportNumber");
parser.getFieldValue("passportNumber");
```

## getFieldRawValue

Gets the value of a specified field from the parsed result, without mapping process.

```ts
getFieldRawValue(fieldName: string): string;
```

**Parameters**

`fieldName`: specifies the name of the field.

**Return Value**

A string which contains the field raw value.

**Code Snippet**

```js
parser.getFieldRawValue("passportNumber");
```

## getFieldMappingStatus
Expand Down
Loading