ParsedResultItem
The ParsedResultItem interface provides a structure representing the result items returned by Dynamsoft Code Parser.
interface ParsedResultItem extends Core.CapturedResultItem {
codeType: string;
jsonString: string;
getFieldValue: (fieldName: string) => Promise<string>;
getFieldMappingStatus: (fieldName: string) => EnumMappingStatus;
getFieldValidationStatus: (fieldName: string) => EnumValidationStatus;
}
codeType
Returns the code type of the parsed result.
codeType: string;
jsonString
Returns the parsed result as a JSON formatted string.
jsonString: string;
getFieldValue
Gets the value of a specified field from the parsed result.
getFieldValue(fieldName: string): Promise<string>;
Parameters
fieldName
: specifies the name of the field.
Return Value
A promise resolving to a string which contains the field value.
Code Snippet
await parser.getFieldValue("passportNumber");
getFieldMappingStatus
Gets the mapping status of a specified field from the parsed result.
getFieldMappingStatus: (fieldName: string) => EnumMappingStatus;
Parameters
fieldName
: specifies the name of the field.
Return Value
A value that indicates whether the mapping succeeded.
Code Snippet
await parser.getFieldMappingStatus("nationality");
See Also
getFieldValidationStatus
Gets the validation status of a specified field from the parsed result.
getFieldValidationStatus: (fieldName: string) => EnumValidationStatus;
Parameters
fieldName
: specifies the name of the field.
Return Value
A value that indicates whether the validation succeeded.
Code Snippet
await parser.getFieldValidationStatus("passportNumber");
See Also