Skip to content

Commit 913befd

Browse files
authored
Merge pull request #10 from dynamsoft-docs/preview
Preview
2 parents 9e47c03 + 5ea3221 commit 913befd

File tree

12 files changed

+453
-31
lines changed

12 files changed

+453
-31
lines changed

_data/product_version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
useGroupedVersion: true
22

33
version_info_list_js:
4-
- value: latest version
4+
- value: latest version(2.2.10)
55
- value: 2.x
66
child:
77
- 2.0.20

assets/js/dcpWebVersionSearch.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,57 @@
11
[
2+
{
3+
"version": "2.0.20",
4+
"matchList": {
5+
"js":{
6+
"dcvRepoWeb": [
7+
{
8+
"path": "/programming/javascript/api-reference/utility",
9+
"version": "1.2.10"
10+
}, {
11+
"path": "/programming/javascript/api-reference/license",
12+
"version": "3.2.10"
13+
}, {
14+
"path": "/programming/javascript/api-reference/capture-vision-router",
15+
"version": "2.2.10"
16+
}, {
17+
"path": "/programming/javascript/api-reference/core",
18+
"version": "3.2.10"
19+
}, {
20+
"path": "/programming/javascript/api-reference/image-processing",
21+
"version": "2.2.10"
22+
}
23+
],
24+
"dcvRepoCore": [
25+
{
26+
"path": "/enums/capture-vision-router",
27+
"version": "2.2.10"
28+
}, {
29+
"path": "/enums/core",
30+
"version": "3.2.10"
31+
},{
32+
"path": "/parameters/reference/capture-vision-template",
33+
"version": "2.2.10"
34+
},{
35+
"path": "/parameters/reference/target-roi-def",
36+
"version": "2.2.10"
37+
},{
38+
"path": "/parameters/reference/document-normalizer-task-settings",
39+
"version": "2.2.10"
40+
},{
41+
"path": "/parameters/reference/image-parameter",
42+
"version": "2.2.10"
43+
},{
44+
"path": "/parameters/reference/image-source-options",
45+
"version": "3.2.10"
46+
},{
47+
"path": "/parameters/reference/global-parameter",
48+
"version": "2.2.10"
49+
}
50+
],
51+
"dce": "4.0.2"
52+
}
53+
}
54+
},
255
{
356
"version": "2.0.20",
457
"matchList": {
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
layout: default-layout
3+
title: CodeParserModule Class - Dynamsoft Code Parser JavaScript Edition API
4+
description: This page introduces APIs related to the CodeParserModule Class of Dynamsoft Code Parser JavaScript Edition.
5+
keywords: capture vision, code parser Module, api reference, javascript, js
6+
needAutoGenerateSidebar: true
7+
needGenerateH3Content: true
8+
noTitleIndex: true
9+
---
10+
11+
# CodeParserModule Class
12+
13+
The `CodeParserModule` class is defined in the namespace `Dynamsoft.DCP`.
14+
15+
| API Name | Description |
16+
| ------------------------------------ | ----------------------------------------------------------- |
17+
| `static` [getVersion()](#getversion) | Returns the version of the `CodeParser` module. |
18+
| `static` [loadSpec()](#loadspec) | Loads the specification for a certain type of code strings. |
19+
20+
### getVersion
21+
22+
Returns the version of the `CodeParser` module.
23+
24+
```typescript
25+
static getVersion(): string;
26+
```
27+
28+
**Code snippet**
29+
30+
```javascript
31+
const version = Dynamsoft.DCP.CodeParserModule.getVersion();
32+
console.log(version);
33+
```
34+
35+
### loadSpec
36+
37+
Loads the specification for a certain type of code strings.
38+
39+
```typescript
40+
loadSpec(specificationName: string, specificationPath?: string): Promise<void>;
41+
```
42+
43+
**Parameters**
44+
45+
* `specificationName`: specifies the name of the specification.
46+
* `specificationPath`: specifies the path to find the specification file. If not specified, the method will try to load the file from the path specified for the "dcp" module in `Dynamsoft.Core.CoreModule.engineResourcePaths`. For example, if the path for the "dcp" module is "https://cdn.jsdelivr.net/npm/dynamsoft-code-parser@2.0.20/dist/", then calling `Dynamsoft.DCP.CodeParserModule.loadSpec("AADHAAR")` will load the file "AADHAAR.data" from "https://cdn.jsdelivr.net/npm/dynamsoft-code-parser@2.0.20/dist/specification/AADHAAR.data".
47+
48+
**Code Snippet**
49+
50+
```javascript
51+
await Dynamsoft.DCP.CodeParserModule.loadSpec("AADHAAR");
52+
```

programming/javascript/api-reference/code-parser-module-class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ console.log(version);
3737
Loads the specification for a certain type of code strings.
3838

3939
```typescript
40-
loadSpec(specificationName: string, specificationPath?: string): Promise<void>;
40+
loadSpec(specificationName: string | Array<string>, specificationPath?: string): Promise<void>;
4141
```
4242

4343
**Parameters**

programming/javascript/api-reference/code-parser-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ The `CodeParser` class enable users to parse given bytes or a string.
3737

3838
## Interfaces
3939

40-
* [ParsedResultItem](./interfaces/parsed-result-item.md)
4140
* [ParsedResult](./interfaces/parsed-result.md)
41+
* [ParsedResultItem](./interfaces/parsed-result-item.md)
4242

4343
## Enumerations
4444

programming/javascript/api-reference/code-parser.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ needAutoGenerateSidebar: true
88

99
# CodeParser Class
1010

11-
The `CodeParser` class enable users to parse given bytes or a string.
11+
The `CodeParser` class enable users to parse given bytes or a string to be human-readable.
1212

1313
| Method | Description |
1414
| -------------------------------------------- | ---------------------------------------------------------------------- |
@@ -113,7 +113,7 @@ initSettings: (settings: string) => Promise<void>;
113113

114114
**Return value**
115115

116-
Returns a promise that resolves when the initializing finishes.
116+
A promise that resolves when the operation has completed. It does not provide any value upon resolution.
117117

118118
## resetSettings
119119

@@ -133,7 +133,7 @@ Returns a promise that resolves when the settings have been successfully reset t
133133

134134
## parse
135135

136-
Parses code data for human-readable results.
136+
Parses a single string to be human-readable.
137137

138138
```typescript
139139
parse: (source: Uint8Array | string, taskSettingName?: string) => Promise<ParsedResultItem>;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ interface ParsedResultItem extends Core.CapturedResultItem {
2222
}
2323
```
2424

25-
| API Name | Description |
25+
<!-- | API Name | Description |
2626
| ------------------------------------------------------- | ----------------------------------------------------------------------- |
2727
| [codeType](#codetype) | Returns the code type of the parsed result. |
2828
| [jsonString](#jsonstring) | Returns the parsed result as a JSON formatted string. |
2929
| [getFieldValue()](#getfieldvalue) | Gets the value of a specified field from the parsed result. |
3030
| [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. |
31+
| [getFieldValidationStatus()](#getfieldvalidationstatus) | Gets the validation status of a specified field from the parsed result. | -->
3232

3333
## codeType
3434

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ interface ParsedResult {
2424
}
2525
```
2626

27-
| API Name | Description |
27+
<!-- | API Name | Description |
2828
| ------------------------------------------- | ----------------------------------------------------------- |
2929
| [originalImageHashId](#originalimagehashid) | Returns the hash id of the original image. |
3030
| [originalImageTag](#originalimagetag) | Returns the tag of the original image. |
3131
| [parsedResultItems](#parsedresultitems) | Returns an array that contains all `ParsedResultItem`s. |
3232
| [hasItem()](#hasitem) | Checks whether the specified `ParsedResultItem` exists. |
3333
| [removeItem()](#removeitem) | Removes the specified `ParsedResultItem`. |
3434
| [errorCode](#errorcode) | Returns the error code for the parsing operation. |
35-
| [errorString](#errorstring) | Returns the error string that corresponds with `errorCode`. |
35+
| [errorString](#errorstring) | Returns the error string that corresponds with `errorCode`. | -->
3636

3737
## originalImageHashId
3838

programming/javascript/release-notes/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ breadcrumbText: Release Notes
99

1010
# Dynamsoft Code Parser JavaScript SDK - Release Notes
1111

12+
- [2.2.10 (04/11/2024)](js-2.md/#2210-04112024)
1213
- [2.0.20 (01/19/2024)](js-2.md/#2020-01192024)
1314
- [1.1.0 (07/19/2022)](js-1.md/#110-07192022)
1415
- [1.0.2 (06/08/2022)](js-1.md/#102-06082022)

programming/javascript/release-notes/js-2.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ noTitleIndex: true
1010

1111
# Release Notes for JavaScript SDK - 2.x
1212

13+
## 2.2.10 (04/11/2024)
14+
15+
### Improved
16+
17+
* Security update for `DynamsoftCodeParser` library and other corresponding libraries.
18+
19+
* Update the API [`loadSpec`]({{ site.dcp_js_api }}code-parser-module-class.html#loadspec) to supporting loading multiple specifications at a time.
20+
21+
### Fixed
22+
23+
* Fixed a bug where the same map file is requested more than once.
24+
25+
* Fixed type definition not found issue under TypeScript 5.x version.
26+
1327
## 2.0.20 (01/19/2024)
1428

1529
### Changelog

0 commit comments

Comments
 (0)