Skip to content

Commit e62019f

Browse files
update to internal commit aad5466b
1 parent 784c2c8 commit e62019f

File tree

7 files changed

+203
-107
lines changed

7 files changed

+203
-107
lines changed

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ repositoryUrl: https://github.com/dynamsoft-docs/code-parser-docs-js/blob/main
22
repository: dynamsoft-docs/code-parser-docs-js
33
docFullPath: https://www.dynamsoft.com/code-parser/docs/web
44
firstLevelUrl: /code-parser/docs/web/
5+
docRootName: "Code Parser JS Edition"
56
docHomePage: /code-parser/docs/core/introduction/
67

78
js: /code-parser/docs/web/programming/javascript/
89
dcp_js_api: /code-parser/docs/web/programming/javascript/api-reference/
910
dcp_enum: /code-parser/docs/web/programming/javascript/api-reference/enum/
1011
js_release_notes: /code-parser/docs/web/programming/javascript/release-notes/
12+
enums: /capture-vision/docs/core/enums/
1113

1214
dcv_enumerations: /capture-vision/docs/core/enums/
1315

_includes/sidelist-programming-javascript.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<a
2323
href="{{ site.dcp_js_api }}code-parser-module.html"
2424
class="otherLinkColour"
25-
>CodeParser</a
25+
>DynamsoftCodeParser</a
2626
>
2727
<ul>
2828
<li>
@@ -84,7 +84,7 @@
8484
<a
8585
href="{{ site.dcv_js_api }}license/license-module.html"
8686
class="otherLinkColour"
87-
>License</a
87+
>DynamsoftLicense</a
8888
>
8989
<ul>
9090
<li>
@@ -106,8 +106,9 @@
106106
<!-- Core -->
107107
<li>
108108
<a
109+
href="{{ site.dcv_js_api }}core/core-module.html"
109110
class="otherLinkColour"
110-
>Core</a
111+
>DynamsoftCore</a
111112
>
112113
<ul>
113114
<li>

_layouts/default-layout.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
<html lang="en-US">
33

44
{%- include head.html -%}
5+
{%- assign noTitleIndex = "" -%}
6+
{%- if page.noTitleIndex or page.url contains 'release-notes' -%}
7+
{%- assign noTitleIndex = "noTitleIndex" -%}
8+
{%- endif -%}
59

610
<body class="dlrDoc">
711
{% assign url = 'https://www.dynamsoft.com/shared/head/' %}

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

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,41 @@ noTitleIndex: true
1212

1313
The `CodeParserModule` class is defined in the namespace `Dynamsoft.DCP`.
1414

15-
| API Name | Description |
16-
| ---------------------------------- | ----------------------------------------------- |
17-
| static [getVersion()](#getversion) | Returns the version of the `CodeParser` module. |
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. |
1819

1920
### getVersion
2021

2122
Returns the version of the `CodeParser` module.
2223

24+
```typescript
25+
static getVersion(): string;
26+
```
27+
2328
**Code snippet**
2429

2530
```javascript
26-
const version = Dynamsoft.DBR.CodeParserModule.getVersion();
31+
const version = Dynamsoft.DCP.CodeParserModule.getVersion();
2732
console.log(version);
28-
```
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/[email protected]/dist/", then calling `Dynamsoft.DCP.CodeParserModule.loadSpec("AADHAAR")` will load the file "AADHAAR.data" from "https://cdn.jsdelivr.net/npm/[email protected]/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.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ noTitleIndex: true
99
---
1010
<!-- 2.0.20 -- Updated on 12/11/2023-->
1111

12-
# CodeParser Module
12+
# DynamsoftCodeParser Module
1313

1414
The CodeParser module is defined in the namespace `Dynamsoft.DCP`. It includes the classes `CodeParser` and `CodeParserModule` along with a few interfaces and enumerations.
1515

1616
## CodeParserModule Class
1717

1818
This class defines common functionality in the `CodeParser` module. At present, there is only one API.
1919

20-
| API Name | Description |
21-
| ----------------------------------------------------------------- | --------------------------------------------- |
22-
| `static` [getVersion()](./code-parser-module-class.md#getversion) | Returns the version of the CodeParser module. |
20+
| API Name | Description |
21+
| ----------------------------------------------------------------- | ----------------------------------------------------------- |
22+
| `static` [getVersion()](./code-parser-module-class.md#getversion) | Returns the version of the CodeParser module. |
23+
| `static` [loadSpec()](./code-parser-module-class.md#loadspec) | Loads the specification for a certain type of code strings. |
2324

2425
## CodeParser Class
2526

@@ -30,9 +31,9 @@ The `CodeParser` class enable users to parse given bytes or a string.
3031
| `static` [createInstance()](./code-parser.md#createinstance) | Initializes a new instance of the `CodeParser` class. |
3132
| [dispose()](./code-parser.md#dispose) | Releases all resources used by the `CodeParser` object. |
3233
| [disposed](./code-parser.md#disposed) | Returns whether the `CodeParser` object has been disposed of. |
33-
| [initSettings](./code-parser.md#initsettings) | Initializes runtime settings with the settings in a given JSON string. |
34-
| [resetSettings](./code-parser.md#resetsettings) | Resets runtime settings to default. |
35-
| [parse](./code-parser.md#parse) | Parses code data for readable results. |
34+
| [initSettings](./code-parser.md#initsettings) | Initializes runtime settings with the settings in a given JSON string. |
35+
| [resetSettings](./code-parser.md#resetsettings) | Resets runtime settings to default. |
36+
| [parse](./code-parser.md#parse) | Parses code data for readable results. |
3637

3738
## Interfaces
3839

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ The `CodeParser` class enable users to parse given bytes or a string.
1515
| `static` [createInstance()](#createinstance) | Initializes a new instance of the `CodeParser` class. |
1616
| [dispose()](#dispose) | Releases all resources used by the `CodeParser` object. |
1717
| [disposed](#disposed) | Returns whether the `CodeParser` object has been disposed of. |
18-
| [initSettings](#initsettings) | Initializes runtime settings with the settings in a given JSON string. |
19-
| [resetSettings](#resetsettings) | Resets runtime settings to default. |
20-
| [parse](#parse) | Parses code data for readable results. |
18+
| [initSettings](#initsettings) | Initializes runtime settings with the settings in a given JSON string. |
19+
| [resetSettings](#resetsettings) | Resets runtime settings to default. |
20+
| [parse](#parse) | Parses code data for readable results. |
2121

2222
## createInstance
2323

@@ -40,7 +40,7 @@ A promise that resolves to the initialized `CodeParser` object.
4040
**Code snippet**
4141

4242
```javascript
43-
let parser = await Dynamsoft.CVR.CodeParser.createInstance();
43+
let parser = await Dynamsoft.DCP.CodeParser.createInstance();
4444
```
4545

4646
## dispose
@@ -64,7 +64,7 @@ Returns a promise that resolves when the resources have been successfully releas
6464
**Code snippet**
6565

6666
```javascript
67-
let parser = await Dynamsoft.CVR.CodeParser.createInstance();
67+
let parser = await Dynamsoft.DCP.CodeParser.createInstance();
6868
// Use the parser to perform a job.
6969
// ...
7070
// Release the resources after the job is finished.
@@ -120,7 +120,7 @@ Returns a promise that resolves when the initializing finishes.
120120
Resets all parameters to default values.
121121

122122
```typescript
123-
resetSettings: () => void;
123+
resetSettings: () => Promise<void>;
124124
```
125125

126126
**Parameters**
@@ -129,14 +129,14 @@ None.
129129

130130
**Return value**
131131

132-
`void`
132+
Returns a promise that resolves when the settings have been successfully reset to their default values.
133133

134134
## parse
135135

136136
Parses code data for human-readable results.
137137

138138
```typescript
139-
parse: (source: Array<number> | string, taskSettingName?: string) => Promise<ParsedResultItem>;
139+
parse: (source: Uint8Array | string, taskSettingName?: string) => Promise<ParsedResultItem>;
140140
```
141141

142142
**Parameters**

0 commit comments

Comments
 (0)