Kaizen
Browse modulesPeripheralsperipherals/sharedTypes

Type Alias: ReceiptNode

type ReceiptNode = 
  | {
  bold?: boolean;
  invert?: boolean;
  kind: "text";
  underline?: boolean;
  value: string;
}
  | {
  bold?: boolean;
  invert?: boolean;
  kind: "line";
  underline?: boolean;
  value?: string;
}
  | {
  count?: number;
  kind: "newline";
}
  | {
  kind: "align";
  value: "left" | "center" | "right";
}
  | {
  height?: number;
  kind: "size";
  width: number;
}
  | {
  kind: "row";
  left: string;
  right: string;
}
  | {
  kind: "rule";
  style?: "single" | "double";
}
  | {
  errorLevel?: "l" | "m" | "q" | "h";
  kind: "qrcode";
  model?: 1 | 2;
  size?: number;
  value: string;
}
  | {
  height?: number;
  kind: "barcode";
  showText?: boolean;
  symbology: string;
  value: string;
}
  | {
  config?: CashDrawerConfig;
  kind: "pulse";
}
  | {
  kind: "cut";
  mode?: "full" | "partial";
}
  | {
  data: Uint8Array;
  kind: "raw";
};

Defined in: shared/peripherals/receipt-document.ts:9

A declarative, printer-agnostic receipt description. Consumers build the content (their domain); encodeReceiptDocument turns it into printer bytes for whichever language/width the target device speaks. Deliberately structural — no prices, line items, or other POS domain concepts.

Union Members

Type Literal

{
  bold?: boolean;
  invert?: boolean;
  kind: "text";
  underline?: boolean;
  value: string;
}

Type Literal

{
  bold?: boolean;
  invert?: boolean;
  kind: "line";
  underline?: boolean;
  value?: string;
}

Type Literal

{
  count?: number;
  kind: "newline";
}

Type Literal

{
  kind: "align";
  value: "left" | "center" | "right";
}

Type Literal

{
  height?: number;
  kind: "size";
  width: number;
}

Type Literal

{
  kind: "row";
  left: string;
  right: string;
}

kind

kind: "row";

left

left: string;

Left/right column pair, e.g. label + amount.

right: string;

Type Literal

{
  kind: "rule";
  style?: "single" | "double";
}

Type Literal

{
  errorLevel?: "l" | "m" | "q" | "h";
  kind: "qrcode";
  model?: 1 | 2;
  size?: number;
  value: string;
}

Type Literal

{
  height?: number;
  kind: "barcode";
  showText?: boolean;
  symbology: string;
  value: string;
}

Type Literal

{
  config?: CashDrawerConfig;
  kind: "pulse";
}

Type Literal

{
  kind: "cut";
  mode?: "full" | "partial";
}

Type Literal

{
  data: Uint8Array;
  kind: "raw";
}

On this page