Skip to content

Commit

Permalink
feat: add type for agent connection options
Browse files Browse the repository at this point in the history
  • Loading branch information
mastudillot committed Aug 5, 2024
1 parent 36641f6 commit f55ef8c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion types/pos.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -13,7 +21,7 @@ export class TransbankPOSWebSocket extends EventEmitter {

socket(): Socket | null;

connect(socketIoUrl?: string, options?: object): Promise<boolean>;
connect(socketIoUrl?: string, options?: AgentConnectionOptions): Promise<boolean>;

disconnect(): Promise<boolean>;

Expand Down

0 comments on commit f55ef8c

Please sign in to comment.