Skip to content

Commit 2da084f

Browse files
Add Print Types (#103)
1 parent 6934fc9 commit 2da084f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

types/terminal.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export declare type IClearCachedCredentialsResponse = Record<string, never>;
6767
export declare type IClearReaderDisplayResponse = Record<string, never>;
6868
export declare type ICollectRefundPaymentMethodResponse = Record<string, never>;
6969
export declare type IDisconnectResponse = Record<string, never>;
70+
export declare type IPrintResponse = Record<string, never>;
7071

7172
interface IPaymentMethod extends SdkIPaymentMethod {
7273
payment_intent?: IPaymentIntentExpandedMethod | null;
@@ -404,6 +405,9 @@ export interface NumericResult extends ICollectInputsResult {
404405
numericString?: string | null;
405406
}
406407

408+
// Represents the content to print to a reader's embedded printer.
409+
export type IPrintContent = HTMLCanvasElement;
410+
407411
export class Terminal {
408412
/**
409413
* Returns the current connection status of the PIN pad.
@@ -576,4 +580,10 @@ export class Terminal {
576580
* Retrieves current settings from the connected reader.
577581
*/
578582
getReaderSettings(): Promise<IReaderSettings | ErrorResponse>;
583+
584+
/**
585+
* Prints the specified content to the connected reader's printer, if available.
586+
* @param content The content to print. Currently only supports `HTMLCanvasElement`.
587+
*/
588+
print(content: IPrintContent): Promise<IPrintResponse | ErrorResponse>;
579589
}

0 commit comments

Comments
 (0)