Interface: ReceiptEncoder
Defined in: shared/peripherals/encoder.ts:28
The fluent receipt-builder surface. Declared as our own interface (not an alias of the library class) so the published .d.mts never references @point-of-sale/receipt-printer-encoder, which ships no types.
Properties
columns
readonly columns: number;Defined in: shared/peripherals/encoder.ts:67
language
readonly language: string;Defined in: shared/peripherals/encoder.ts:68
Methods
align()
align(value: "left" | "center" | "right"): this;Defined in: shared/peripherals/encoder.ts:38
Parameters
| Parameter | Type |
|---|---|
value | "left" | "center" | "right" |
Returns
this
barcode()
barcode(
value: string,
symbology: string,
options?: {
height?: number;
text?: boolean;
width?: number;
}
): this;Defined in: shared/peripherals/encoder.ts:50
Parameters
| Parameter | Type |
|---|---|
value | string |
symbology | string |
options? | { height?: number; text?: boolean; width?: number; } |
options.height? | number |
options.text? | boolean |
options.width? | number |
Returns
this
bold()
bold(state?: boolean): this;Defined in: shared/peripherals/encoder.ts:34
Parameters
| Parameter | Type |
|---|---|
state? | boolean |
Returns
this
codepage()
codepage(value: string): this;Defined in: shared/peripherals/encoder.ts:30
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
this
cut()
cut(value?: "partial" | "full"): this;Defined in: shared/peripherals/encoder.ts:64
Parameters
| Parameter | Type |
|---|---|
value? | "partial" | "full" |
Returns
this
encode()
encode(): Uint8Array;Defined in: shared/peripherals/encoder.ts:66
Returns
Uint8Array
initialize()
initialize(): this;Defined in: shared/peripherals/encoder.ts:29
Returns
this
invert()
invert(state?: boolean): this;Defined in: shared/peripherals/encoder.ts:36
Parameters
| Parameter | Type |
|---|---|
state? | boolean |
Returns
this
italic()
italic(state?: boolean): this;Defined in: shared/peripherals/encoder.ts:37
Parameters
| Parameter | Type |
|---|---|
state? | boolean |
Returns
this
line()
line(value?: string): this;Defined in: shared/peripherals/encoder.ts:32
Parameters
| Parameter | Type |
|---|---|
value? | string |
Returns
this
newline()
newline(count?: number): this;Defined in: shared/peripherals/encoder.ts:33
Parameters
| Parameter | Type |
|---|---|
count? | number |
Returns
this
pulse()
pulse(
device?: 0 | 1,
on?: number,
off?: number
): this;Defined in: shared/peripherals/encoder.ts:63
Parameters
| Parameter | Type |
|---|---|
device? | 0 | 1 |
on? | number |
off? | number |
Returns
this
qrcode()
qrcode(value: string, options?: {
errorlevel?: "l" | "m" | "q" | "h";
model?: 1 | 2;
size?: number;
}): this;Defined in: shared/peripherals/encoder.ts:55
Parameters
| Parameter | Type |
|---|---|
value | string |
options? | { errorlevel?: "l" | "m" | "q" | "h"; model?: 1 | 2; size?: number; } |
options.errorlevel? | "l" | "m" | "q" | "h" |
options.model? | 1 | 2 |
options.size? | number |
Returns
this
raw()
raw(data: number[] | Uint8Array<ArrayBufferLike>): this;Defined in: shared/peripherals/encoder.ts:65
Parameters
| Parameter | Type |
|---|---|
data | number[] | Uint8Array<ArrayBufferLike> |
Returns
this
rule()
rule(options?: {
style?: "single" | "double";
width?: number;
}): this;Defined in: shared/peripherals/encoder.ts:49
Parameters
| Parameter | Type |
|---|---|
options? | { style?: "single" | "double"; width?: number; } |
options.style? | "single" | "double" |
options.width? | number |
Returns
this
size()
size(width: number, height?: number): this;Defined in: shared/peripherals/encoder.ts:39
Parameters
| Parameter | Type |
|---|---|
width | number |
height? | number |
Returns
this
table()
table(columns: {
align?: "left" | "right";
marginLeft?: number;
marginRight?: number;
width?: number;
}[], rows: (string | ((encoder: this) => this))[][]): this;Defined in: shared/peripherals/encoder.ts:40
Parameters
| Parameter | Type |
|---|---|
columns | { align?: "left" | "right"; marginLeft?: number; marginRight?: number; width?: number; }[] |
rows | (string | ((encoder: this) => this))[][] |
Returns
this
text()
text(value: string): this;Defined in: shared/peripherals/encoder.ts:31
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
this
underline()
underline(state?: boolean): this;Defined in: shared/peripherals/encoder.ts:35
Parameters
| Parameter | Type |
|---|---|
state? | boolean |
Returns
this