Skip to content

Commit bef1c62

Browse files
committed
Add TypeScript support
+ TypeScript support + EasyQRCode-React-Native
1 parent 5e27307 commit bef1c62

File tree

5 files changed

+39
-7
lines changed

5 files changed

+39
-7
lines changed

index.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Type definitions for easyqrcodejs-nodejs.js
2+
// Project: [https://github.com/ushelp/EasyQRCodeJS-NodeJS]
3+
// Definitions by: Ray <[email protected]>
4+
5+
export = QRCode;
6+
7+
declare class QRCode {
8+
constructor(vOption: any);
9+
10+
saveImage(saveOptions: any): any;
11+
12+
toDataURL(format?: any): any;
13+
14+
static CorrectLevel: {
15+
H: number;
16+
L: number;
17+
M: number;
18+
Q: number;
19+
};
20+
21+
}
22+

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* NodeJS QRCode generator. Can get standard base64 image data url text or save image to file. Cross-browser QRCode generator for pure javascript. Support Dot style, Logo, Background image, Colorful, Title etc. settings. Support binary(hex) data mode. (Running without DOM on server side)
55
*
6-
* Version 3.7.0
6+
* Version 3.7.1
77
*
88
* @author [ [email protected] ]
99
*

index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "easyqrcodejs-nodejs",
3-
"version": "3.7.0",
3+
"version": "3.7.1",
44
"description": "NodeJS QRCode generator. Can get standard base64 image data url text or save image to file. Cross-browser QRCode generator for pure javascript. Support Dot style, Logo, Background image, Colorful, Title etc. settings. support binary mode.(Running without DOM on server side)",
55
"main": "index.min.js",
66
"scripts": {},

readme.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ EasyQRCodeJS-NodeJS 是一个 NodeJS 环境下的服务端 JavaScript QRCode 图
1515
- [Installation](#installation)
1616
- [Basic Usages](#basic-usages)
1717
- [QRCode API](#qrcode-api)
18-
- [Object](#object)
19-
- [Options](#options)
20-
- [Methods](#methods)
18+
- [Object](#object)
19+
- [Options](#options)
20+
- [Methods](#methods)
21+
- [TypeScript Support](#typescript-support)
2122
- [License](#license)
2223
- [EasyQRCodeJS-NodeJS-Premium](#easyqrcodejs-nodejs-premium)
2324
- [End](#end)
@@ -28,7 +29,7 @@ EasyQRCodeJS-NodeJS 是一个 NodeJS 环境下的服务端 JavaScript QRCode 图
2829
| --- | --- |
2930
| [EasyQRCodeJS](https://github.com/ushelp/EasyQRCodeJS) | **Running with DOM on CLIENT-SIDE .** Browser(IE6+, Chrome, Firefox, Safari, Opera, Mobile Safari, Android, Windows Mobile, ETC.), Electron, NW.js, ETC. |
3031
| [EasyQRCodeJS-NodeJS](https://github.com/ushelp/EasyQRCodeJS-NodeJS) | **Running without DOM on SERVER-SIDE**. Save image to file or get data url text. NodeJS, Electron, NW.js, ETC.|
31-
32+
| [EasyQRCode-React-Native](https://github.com/ushelp/EasyQRCode-React-Native) | **A QRCode generator for React Native**. Generate QRCode image or get base64 data url text. |
3233

3334
## Feature
3435

@@ -58,6 +59,7 @@ EasyQRCodeJS-NodeJS 是一个 NodeJS 环境下的服务端 JavaScript QRCode 图
5859

5960
- Support binary(hex) data mode
6061

62+
- Support TypeScript
6163

6264
- **中文**
6365

@@ -85,6 +87,7 @@ EasyQRCodeJS-NodeJS 是一个 NodeJS 环境下的服务端 JavaScript QRCode 图
8587

8688
- 二进制数据模式支持
8789

90+
- TypeScript 支持
8891

8992
## Try It!
9093

@@ -324,6 +327,13 @@ var qrcode = new QRCode(options);
324327
});
325328
```
326329

330+
## TypeScript Support
331+
332+
Update to version `3.7.1+`.
333+
334+
```Javascript
335+
import QRCode = require("easyqrcodejs-nodejs")
336+
```
327337

328338
## License
329339
MIT License

0 commit comments

Comments
 (0)