Skip to content

feat: release v2.1.0-beta-0514202501 #23

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Let's now go through the code of the Hello World sample and understand the purpo
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Dynamsoft MRZ Scanner - Hello World</title>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-mrz-scanner@2.0.0/dist/mrz-scanner.bundle.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-mrz-scanner@2.1.0-beta.0514202501/dist/mrz-scanner.bundle.js"></script>
</head>

<body>
Expand Down
8 changes: 8 additions & 0 deletions dev-server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ app.get("/hello-world", (req, res) => {
res.sendFile(path.join(__dirname, "../samples/hello-world.html"));
});

app.get("/scenarios/use-file-input", (req, res) => {
res.sendFile(path.join(__dirname, "../samples/scenarios/use-file-input.html"));
});

let httpPort = 3002;
let httpsPort = 3003;

Expand Down Expand Up @@ -113,6 +117,8 @@ httpServer.listen(httpPort, () => {
console.log("\x1b[90m-------------------\x1b[0m");
console.log("\x1b[33m Hello World:\x1b[0m http://localhost:" + httpPort + "/hello-world");
console.log("\x1b[33m Demo:\x1b[0m http://localhost:" + httpPort + "/demo");
console.log("\x1b[90m-------------------\x1b[0m");
console.log("\x1b[33m Use File Input:\x1b[0m http://localhost:" + httpPort + "/scenarios/use-file-input");
});

httpsServer.listen(httpsPort, "0.0.0.0", () => {
Expand All @@ -132,6 +138,8 @@ httpsServer.listen(httpsPort, "0.0.0.0", () => {
ipv4Addresses.forEach((localIP) => {
console.log("\x1b[32m Hello World:\x1b[0m https://" + localIP + ":" + httpsPort + "/hello-world");
console.log("\x1b[32m Demo:\x1b[0m https://" + localIP + ":" + httpsPort + "/demo");
console.log("\x1b[90m-------------------\x1b[0m");
console.log("\x1b[32m Use File Input:\x1b[0m https://" + localIP + ":" + httpsPort + "/scenarios/use-file-input");
});
console.log("\n");
console.log("\x1b[90mPress Ctrl+C to stop the server\x1b[0m\n");
Expand Down
19 changes: 17 additions & 2 deletions dist/mrz-scanner.bundle.esm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,17 @@ declare enum EnumMRZData {
Age = "age",
Sex = "sex",
IssuingState = "issuingState",
IssuingStateRaw = "issuingStateRaw",
Nationality = "nationality",
NationalityRaw = "nationalityRaw",
DateOfBirth = "dateOfBirth",
DateOfExpiry = "dateOfExpiry"
}
interface MRZResult {
status: ResultStatus;
originalImageResult?: DSImageData;
data?: MRZData;
imageData?: boolean;
_imageData?: DSImageData;
}
interface MRZData {
Expand All @@ -87,7 +90,9 @@ interface MRZData {
[EnumMRZData.Age]: number;
[EnumMRZData.Sex]: string;
[EnumMRZData.IssuingState]: string;
[EnumMRZData.IssuingStateRaw]: string;
[EnumMRZData.Nationality]: string;
[EnumMRZData.NationalityRaw]: string;
[EnumMRZData.DateOfBirth]: MRZDate;
[EnumMRZData.DateOfExpiry]: MRZDate;
}
Expand All @@ -109,7 +114,10 @@ interface MRZScannerViewConfig {
showUploadImage?: boolean;
showFormatSelector?: boolean;
showSoundToggle?: boolean;
showPoweredByDynamsoft?: boolean;
enableMultiFrameCrossFilter?: boolean;
uploadAcceptedTypes?: string;
uploadFileConverter?: (file: File) => Promise<Blob>;
}
declare class MRZScannerView {
private resources;
Expand Down Expand Up @@ -137,7 +145,8 @@ declare class MRZScannerView {
private attachOptionClickListeners;
private highlightCameraAndResolutionOption;
private toggleSelectCameraBox;
private uploadImage;
private relaunch;
private uploadFile;
private toggleSoundFeedback;
private calculateScanRegion;
private toggleScanGuide;
Expand Down Expand Up @@ -229,7 +238,13 @@ declare class MRZScanner {
private initializeMRZScannerConfig;
private createViewContainers;
dispose(): void;
launch(): Promise<MRZResult>;
/**
* Processes an uploaded image file
* @param imageOrFile The file to process
* @returns Promise with the document result
*/
private processUploadedFile;
launch(imageOrFile: Blob | string | DSImageData | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement): Promise<MRZResult>;
}

declare const DynamsoftMRZScanner: {
Expand Down
2 changes: 1 addition & 1 deletion dist/mrz-scanner.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mrz-scanner.bundle.mjs

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions dist/mrz-scanner.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ declare enum EnumMRZData {
Age = "age",
Sex = "sex",
IssuingState = "issuingState",
IssuingStateRaw = "issuingStateRaw",
Nationality = "nationality",
NationalityRaw = "nationalityRaw",
DateOfBirth = "dateOfBirth",
DateOfExpiry = "dateOfExpiry"
}
interface MRZResult {
status: ResultStatus;
originalImageResult?: DSImageData;
data?: MRZData;
imageData?: boolean;
_imageData?: DSImageData;
}
interface MRZData {
Expand All @@ -94,7 +97,9 @@ interface MRZData {
[EnumMRZData.Age]: number;
[EnumMRZData.Sex]: string;
[EnumMRZData.IssuingState]: string;
[EnumMRZData.IssuingStateRaw]: string;
[EnumMRZData.Nationality]: string;
[EnumMRZData.NationalityRaw]: string;
[EnumMRZData.DateOfBirth]: MRZDate;
[EnumMRZData.DateOfExpiry]: MRZDate;
}
Expand All @@ -116,7 +121,10 @@ interface MRZScannerViewConfig {
showUploadImage?: boolean;
showFormatSelector?: boolean;
showSoundToggle?: boolean;
showPoweredByDynamsoft?: boolean;
enableMultiFrameCrossFilter?: boolean;
uploadAcceptedTypes?: string;
uploadFileConverter?: (file: File) => Promise<Blob>;
}
declare class MRZScannerView {
private resources;
Expand Down Expand Up @@ -144,7 +152,8 @@ declare class MRZScannerView {
private attachOptionClickListeners;
private highlightCameraAndResolutionOption;
private toggleSelectCameraBox;
private uploadImage;
private relaunch;
private uploadFile;
private toggleSoundFeedback;
private calculateScanRegion;
private toggleScanGuide;
Expand Down Expand Up @@ -236,7 +245,13 @@ declare class MRZScanner {
private initializeMRZScannerConfig;
private createViewContainers;
dispose(): void;
launch(): Promise<MRZResult>;
/**
* Processes an uploaded image file
* @param imageOrFile The file to process
* @returns Promise with the document result
*/
private processUploadedFile;
launch(imageOrFile: Blob | string | DSImageData | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement): Promise<MRZResult>;
}

declare const DynamsoftMRZScanner: {
Expand Down
2 changes: 1 addition & 1 deletion dist/mrz-scanner.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mrz-scanner.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mrz-scanner.no-content-bundle.esm.js

Large diffs are not rendered by default.

Loading
Loading