Skip to content

Commit

Permalink
调整好了开发环境
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhijun committed Mar 24, 2020
1 parent e366ff7 commit 25340c0
Show file tree
Hide file tree
Showing 9 changed files with 3,261 additions and 597 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
dist
test
16 changes: 12 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6
"ecmaVersion": 6,
"sourceType": "module"
},
"env": {
"node": true,
"es6": true
},
"extends": [
"eslint:recommended",
"google"
"google",
"plugin:jsdoc/recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"max-len": [
1,
120
]
}
],
"valid-jsdoc": 0
},
"plugins": [
"jsdoc"
]
}
102 changes: 56 additions & 46 deletions dist/esc-pos-encoder.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
declare module 'iconv-lite' {
const encodings: Array<string>;
}
/**
* Create a byte stream based on commands for ESC/POS printers
*/
Expand All @@ -8,149 +11,156 @@ export default class EscPosEncoder {
/**
* Create a new object
*
*/
*/
constructor();
/**
* Reset the state of the object
*
*/
*/
private _reset;
/**
* Encode a string with the current code page
*
* @param {string} value String to encode
* @return {object} Encoded string as a ArrayBuffer
* @returns {object} Encoded string as a ArrayBuffer
*
*/
*/
private _encode;
/**
* Add commands to the buffer
*
* @param {array} value And array of numbers, arrays, buffers or Uint8Arrays to add to the buffer
* @param {Array} value And array of numbers, arrays, buffers or Uint8Arrays to add to the buffer
*
*/
*/
private _queue;
/**
* Initialize the printer
*
* @return {object} Return the object, for easy chaining commands
* @returns {object} Return the object, for easy chaining commands
*
*/
initialize(): this;
initialize(): object;
/**
* Initialize the printer
*
* @param {string} a dddd
* @returns {object} Return the object, for easy chaining commands
*/
printLine(a: string): object;
/**
* Change the code page
*
* @param {string} value The codepage that we set the printer to
* @return {object} Return the object, for easy chaining commands
* @returns {object} Return the object, for easy chaining commands
*
*/
codepage(value: any): this;
codepage(value: string): object;
/**
* Print text
*
* @param {string} value Text that needs to be printed
* @param {number} wrap Wrap text after this many positions
* @return {object} Return the object, for easy chaining commands
* @returns {object} Return the object, for easy chaining commands
*
*/
text(value: any, wrap?: any): this;
text(value: string, wrap?: number): object;
/**
* Print a newline
*
* @return {object} Return the object, for easy chaining commands
* @returns {object} Return the object, for easy chaining commands
*
*/
newline(): this;
newline(): object;
/**
* Print text, followed by a newline
*
* @param {string} value Text that needs to be printed
* @param {number} wrap Wrap text after this many positions
* @return {object} Return the object, for easy chaining commands
* @returns {object} Return the object, for easy chaining commands
*
*/
line(value: any, wrap?: any): this;
line(value: string, wrap?: number): object;
/**
* Underline text
*
* @param {boolean|number} value true to turn on underline, false to turn off, or 2 for double underline
* @return {object} Return the object, for easy chaining commands
* @returns {object} Return the object, for easy chaining commands
*
*/
underline(value: any): this;
underline(value: boolean | number): object;
/**
* Italic text
*
* @param {boolean} value true to turn on italic, false to turn off
* @return {object} Return the object, for easy chaining commands
* @returns {object} Return the object, for easy chaining commands
*
*/
italic(value: any): this;
italic(value: boolean): object;
/**
* Bold text
*
* @param {boolean} value true to turn on bold, false to turn off, or 2 for double underline
* @return {object} Return the object, for easy chaining commands
* @returns {object} Return the object, for easy chaining commands
*
*/
bold(value: any): this;
bold(value: boolean): object;
/**
* Change text size
*
* @param {string} value small or normal
* @return {object} Return the object, for easy chaining commands
*
*/
size(value: any): this;
* Change text size
*
* @param {number} value small or normal
* @returns {object} Return the object, for easy chaining commands
*
*/
size(value: number): object;
/**
* Change text alignment
*
* @param {string} value left, center or right
* @return {object} Return the object, for easy chaining commands
*
*/
align(value: any): this;
* Change text alignment
*
* @param {string} value left, center or right
* @returns {object} Return the object, for easy chaining commands
*
*/
align(value: string): object;
/**
* Barcode
*
* @param {string} value the value of the barcode
* @param {string} symbology the type of the barcode
* @param {number} height height of the barcode
* @return {object} Return the object, for easy chaining commands
* @returns {object} Return the object, for easy chaining commands
*
*/
barcode(value: any, symbology: any, height: any): this;
barcode(value: string, symbology: string, height: number): object;
/**
* QR code
*
* @param {string} value the value of the qr code
* @param {number} model model of the qrcode, either 1 or 2
* @param {number} size size of the qrcode, a value between 1 and 8
* @param {string} errorlevel the amount of error correction used, either 'l', 'm', 'q', 'h'
* @return {object} Return the object, for easy chaining commands
* @returns {object} Return the object, for easy chaining commands
*
*/
qrcode(value: any, model: any, size: any, errorlevel: any): this;
qrcode(value: string, model: number, size: number, errorlevel: string): object;
/**
* Cut paper
*
* @param {string} value full or partial. When not specified a full cut will be assumed
* @return {object} Return the object, for easy chaining commands
* @returns {object} Return the object, for easy chaining commands
*
*/
cut(value: any): this;
cut(value: string): object;
/**
* Add raw printer commands
*
* @param {array} data raw bytes to be included
* @return {object} Return the object, for easy chaining commands
* @param {Array} data raw bytes to be included
* @returns {object} Return the object, for easy chaining commands
*
*/
raw(data: any): this;
raw(data: Array<number>): object;
/**
* Encode all previous commands
*
* @return {Uint8Array} Return the encoded bytes
* @returns {Uint8Array} Return the encoded bytes
*
*/
encode(): Uint8Array;
Expand Down
Loading

0 comments on commit 25340c0

Please sign in to comment.