From f55ef8cc0b552d69de3fae108e41b381a867ba5c Mon Sep 17 00:00:00 2001 From: Mauricio Astudillo Toledo Date: Mon, 5 Aug 2024 17:56:04 -0400 Subject: [PATCH] feat: add type for agent connection options --- types/pos.d.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/types/pos.d.ts b/types/pos.d.ts index 427211b..23894d0 100644 --- a/types/pos.d.ts +++ b/types/pos.d.ts @@ -2,6 +2,14 @@ import { EventEmitter } from 'events'; import type { Socket } from 'socket.io-client'; import { SaleResponse, LoadKeysResponse, TotalsResponse, RefundResponse, DetailsResponse, CloseResponse, PortStatusResponse, IntermediateMessageResponse } from './responses'; +export type AgentConnectionOptions = { + reconnection?: boolean; + reconnectionAttempts?: number; + reconnectionDelay?: number; + reconnectionDelayMax?: number; + autoConnect?: boolean; +} + export class TransbankPOSWebSocket extends EventEmitter { isConnected: boolean; debugEnabled: boolean; @@ -13,7 +21,7 @@ export class TransbankPOSWebSocket extends EventEmitter { socket(): Socket | null; - connect(socketIoUrl?: string, options?: object): Promise; + connect(socketIoUrl?: string, options?: AgentConnectionOptions): Promise; disconnect(): Promise;