libniimai 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/thermal.d.ts CHANGED
@@ -17,7 +17,17 @@ export interface ThermalModel {
17
17
  prefix: string;
18
18
  confidence: Confidence;
19
19
  note?: string;
20
+ /** The prefix names a brand or a generic Bluetooth module, not a model; the printer's own name is shown. */
21
+ generic?: boolean;
22
+ /** Maker and model, where the Bluetooth name does not say. */
23
+ brand?: string;
24
+ /** Dots across the head, where it differs from the family's usual one: 576 on 80 mm receipt printers. */
25
+ headDots?: number;
20
26
  }
27
+ /** The name a printer shows: its model, or its own Bluetooth name when the model entry is only a brand or a stock name. */
28
+ export declare const shownName: (model: ThermalModel | null, transport: {
29
+ name?: string;
30
+ }, fallback: string) => string;
21
31
  /** The known model a Bluetooth name belongs to, longest prefix first. */
22
32
  export declare function modelFor<M extends ThermalModel>(models: M[], name: string | undefined): M | null;
23
33
  /** Sizes that suit 58 mm continuous paper: the full 48 mm print width at common lengths. */
@@ -70,7 +80,8 @@ export declare abstract class ThermalPrinterClient implements ClientLike {
70
80
  /** Label sizes common for this printer, offered in place of NIIMBOT roll sizes. */
71
81
  protected readonly labelSizes: LabelSize[] | undefined;
72
82
  protected abstract encodeRows(data: ArrayLike<number>, width: number, height: number): Uint8Array[];
73
- protected abstract job(rows: Uint8Array[], density: number, copies: number, labelType: number): Uint8Array;
83
+ /** `gapDots`: labels with gaps on a printer that cannot sense them; each label is followed by exactly this much feed. */
84
+ protected abstract job(rows: Uint8Array[], density: number, copies: number, labelType: number, gapDots?: number): Uint8Array;
74
85
  /** Called after each page is sent; printers that confirm a job wait here. */
75
86
  protected afterPage(): Promise<void>;
76
87
  constructor(transport: ThermalTransport, pace: Pace, firstChunk: number);
package/dist/tspl.d.ts CHANGED
@@ -14,7 +14,7 @@ export declare const TSPL_NOTIFY = "00002af0-0000-1000-8000-00805f9b34fb";
14
14
  export declare const TSPL_HEAD_DOTS = 640;
15
15
  /**
16
16
  * Models known to take TSPL over 18F0. "tested": printed with niimai on real
17
- * hardware.
17
+ * hardware. "medium": reported by open-source printer projects, untested here.
18
18
  */
19
19
  export declare const TSPL_MODELS: ThermalModel[];
20
20
  export declare const tsplModelFor: (name: string | undefined) => ThermalModel | null;
@@ -43,7 +43,7 @@ export declare class TsplPrinterClient extends ThermalPrinterClient {
43
43
  private ackTimeoutMs;
44
44
  protected readonly densityLevels = 15;
45
45
  protected readonly modelName: string;
46
- protected readonly headDots = 640;
46
+ protected readonly headDots: number;
47
47
  protected readonly kind: undefined;
48
48
  protected readonly labelSizes: LabelSize[];
49
49
  private oks;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libniimai",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Print to NIIMBOT, TSPL, ESC/POS and cat printers from the browser over Web Bluetooth and Web Serial.",
5
5
  "keywords": [
6
6
  "niimbot",