@pokertools/types 1.0.0 → 1.0.1
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/Action.d.ts +26 -1
- package/dist/Action.js +2 -0
- package/dist/Player.d.ts +12 -1
- package/dist/Player.js +10 -1
- package/package.json +1 -1
package/dist/Action.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { SitInOption } from "./Player";
|
|
1
2
|
/**
|
|
2
3
|
* Action types that can be performed in the game
|
|
3
4
|
*/
|
|
4
5
|
export declare const enum ActionType {
|
|
5
6
|
SIT = "SIT",
|
|
6
7
|
STAND = "STAND",
|
|
8
|
+
ADD_CHIPS = "ADD_CHIPS",
|
|
9
|
+
RESERVE_SEAT = "RESERVE_SEAT",
|
|
7
10
|
DEAL = "DEAL",
|
|
8
11
|
FOLD = "FOLD",
|
|
9
12
|
CHECK = "CHECK",
|
|
@@ -33,6 +36,7 @@ export interface SitAction extends BaseAction {
|
|
|
33
36
|
readonly playerName: string;
|
|
34
37
|
readonly seat: number;
|
|
35
38
|
readonly stack: number;
|
|
39
|
+
readonly sitInOption?: SitInOption;
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
42
|
* Stand from table
|
|
@@ -41,6 +45,27 @@ export interface StandAction extends BaseAction {
|
|
|
41
45
|
readonly type: ActionType.STAND;
|
|
42
46
|
readonly playerId: string;
|
|
43
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Add chips to player stack (rebuy/top-up)
|
|
50
|
+
* Chips are held in pendingAddOn and merged into stack at start of next hand
|
|
51
|
+
*/
|
|
52
|
+
export interface AddChipsAction extends BaseAction {
|
|
53
|
+
readonly type: ActionType.ADD_CHIPS;
|
|
54
|
+
readonly playerId: string;
|
|
55
|
+
readonly amount: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Reserve a seat at the table
|
|
59
|
+
* Marks seat as RESERVED with expiry timestamp
|
|
60
|
+
* API can use this to lock a seat while processing payment
|
|
61
|
+
*/
|
|
62
|
+
export interface ReserveSeatAction extends BaseAction {
|
|
63
|
+
readonly type: ActionType.RESERVE_SEAT;
|
|
64
|
+
readonly playerId: string;
|
|
65
|
+
readonly playerName: string;
|
|
66
|
+
readonly seat: number;
|
|
67
|
+
readonly expiryTimestamp: number;
|
|
68
|
+
}
|
|
44
69
|
/**
|
|
45
70
|
* Deal new hand
|
|
46
71
|
*/
|
|
@@ -130,7 +155,7 @@ export interface NextBlindLevelAction extends BaseAction {
|
|
|
130
155
|
/**
|
|
131
156
|
* Union type of all possible actions
|
|
132
157
|
*/
|
|
133
|
-
export type Action = SitAction | StandAction | DealAction | FoldAction | CheckAction | CallAction | BetAction | RaiseAction | ShowAction | MuckAction | TimeoutAction | TimeBankAction | UncalledBetReturnedAction | NextBlindLevelAction;
|
|
158
|
+
export type Action = SitAction | StandAction | AddChipsAction | ReserveSeatAction | DealAction | FoldAction | CheckAction | CallAction | BetAction | RaiseAction | ShowAction | MuckAction | TimeoutAction | TimeBankAction | UncalledBetReturnedAction | NextBlindLevelAction;
|
|
134
159
|
/**
|
|
135
160
|
* Action record for history tracking
|
|
136
161
|
*/
|
package/dist/Action.js
CHANGED
package/dist/Player.d.ts
CHANGED
|
@@ -7,7 +7,15 @@ export declare const enum PlayerStatus {
|
|
|
7
7
|
ALL_IN = "ALL_IN",// No more chips to bet
|
|
8
8
|
SITTING_OUT = "SITTING_OUT",// Not playing
|
|
9
9
|
WAITING = "WAITING",// At table but not in hand yet
|
|
10
|
-
BUSTED = "BUSTED"
|
|
10
|
+
BUSTED = "BUSTED",// Stack = 0
|
|
11
|
+
RESERVED = "RESERVED"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Sit-in timing options for cash games
|
|
15
|
+
*/
|
|
16
|
+
export declare const enum SitInOption {
|
|
17
|
+
IMMEDIATE = "IMMEDIATE",// Sit in immediately
|
|
18
|
+
WAIT_FOR_BB = "WAIT_FOR_BB"
|
|
11
19
|
}
|
|
12
20
|
/**
|
|
13
21
|
* Represents a player seated at the table
|
|
@@ -24,4 +32,7 @@ export interface Player {
|
|
|
24
32
|
readonly totalInvestedThisHand: number;
|
|
25
33
|
readonly isSittingOut: boolean;
|
|
26
34
|
readonly timeBank: number;
|
|
35
|
+
readonly pendingAddOn: number;
|
|
36
|
+
readonly sitInOption: SitInOption;
|
|
37
|
+
readonly reservationExpiry: number | null;
|
|
27
38
|
}
|
package/dist/Player.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlayerStatus = void 0;
|
|
3
|
+
exports.SitInOption = exports.PlayerStatus = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Player status within a hand
|
|
6
6
|
*/
|
|
@@ -12,4 +12,13 @@ var PlayerStatus;
|
|
|
12
12
|
PlayerStatus["SITTING_OUT"] = "SITTING_OUT";
|
|
13
13
|
PlayerStatus["WAITING"] = "WAITING";
|
|
14
14
|
PlayerStatus["BUSTED"] = "BUSTED";
|
|
15
|
+
PlayerStatus["RESERVED"] = "RESERVED";
|
|
15
16
|
})(PlayerStatus || (exports.PlayerStatus = PlayerStatus = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Sit-in timing options for cash games
|
|
19
|
+
*/
|
|
20
|
+
var SitInOption;
|
|
21
|
+
(function (SitInOption) {
|
|
22
|
+
SitInOption["IMMEDIATE"] = "IMMEDIATE";
|
|
23
|
+
SitInOption["WAIT_FOR_BB"] = "WAIT_FOR_BB";
|
|
24
|
+
})(SitInOption || (exports.SitInOption = SitInOption = {}));
|