poker-irongrid 1.0.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.
@@ -0,0 +1,334 @@
1
+ export class PokerGridManager {
2
+ constructor(options?: {});
3
+ hands: any;
4
+ deadCards: any;
5
+ boardCards: any;
6
+ heroCards: any;
7
+ colors: any;
8
+ defaultColor: any;
9
+ defaultSelectedColor: any;
10
+ selectedColor: any;
11
+ lastHandsLength: number;
12
+ /**
13
+ * Convert hands array to object if needed.
14
+ * @param {Array|Object} handsInput
15
+ * @returns {Object}
16
+ */
17
+ convertHandsArrayToObject(handsInput: any[] | any): any;
18
+ /**
19
+ * Get all combinations for a hand type (AA, AKs, AKo).
20
+ * @param {string} hand - Hand notation (e.g., 'AA', 'AKs', 'AKo')
21
+ * @returns {string[]} Array of combo strings (e.g., ['AcAd', 'AcAh', ...])
22
+ */
23
+ getCombinations(hand: string): string[];
24
+ /**
25
+ * Get hand data (color, selection state) for a combo.
26
+ * @param {string} combo - Combo string (e.g., 'AcKd')
27
+ * @param {string} hand - Hand abstraction (e.g., 'AKo')
28
+ * @param {Object} hands - Hands object to check
29
+ * @returns {{color: string, isSelected: boolean, hasExplicitColor: boolean}}
30
+ */
31
+ getHandData(combo: string, hand: string, hands?: any): {
32
+ color: string;
33
+ isSelected: boolean;
34
+ hasExplicitColor: boolean;
35
+ };
36
+ /**
37
+ * Filter hands by dead cards.
38
+ * @param {Object} hands - Hands object
39
+ * @param {string[]} deadCards - Dead cards array
40
+ * @returns {Object} Filtered hands object
41
+ */
42
+ filterByDeadCards(hands: any, deadCards?: string[]): any;
43
+ /**
44
+ * Get cell info for grid position.
45
+ * @param {number} rowIndex - Row index (0-12)
46
+ * @param {number} colIndex - Column index (0-12)
47
+ * @returns {{hand: string, display: string, type: string}}
48
+ */
49
+ getCellInfo(rowIndex: number, colIndex: number): {
50
+ hand: string;
51
+ display: string;
52
+ type: string;
53
+ };
54
+ /**
55
+ * Calculate gradient string for a hand.
56
+ * @param {string} hand - Hand notation
57
+ * @param {Object} hands - Hands object
58
+ * @param {string[]} deadCards - Dead cards
59
+ * @returns {string} CSS gradient string
60
+ */
61
+ getGradient(hand: string, hands?: any, deadCards?: string[]): string;
62
+ /**
63
+ * Handle selection from grid click/drag.
64
+ * @param {Object} hands - Current hands object
65
+ * @param {Object} cellInfo - Cell info from getCellInfo
66
+ * @param {Object} modifiers - {ctrl: boolean, shift: boolean}
67
+ * @param {string[]} deadCards - Dead cards
68
+ * @returns {Object} Updated hands object
69
+ */
70
+ handleSelection(hands: any, cellInfo: any, modifiers: any, deadCards?: string[]): any;
71
+ /**
72
+ * Clear all selections.
73
+ * @param {Object} hands - Current hands object
74
+ * @returns {Object} Updated hands object
75
+ */
76
+ clearAll(hands?: any): any;
77
+ /**
78
+ * Inverse selection state.
79
+ * @param {Object} hands - Current hands object
80
+ * @returns {Object} Updated hands object
81
+ */
82
+ inverseSelection(hands?: any): any;
83
+ /**
84
+ * Unselect all hands.
85
+ * @param {Object} hands - Current hands object
86
+ * @returns {Object} Updated hands object
87
+ */
88
+ unselectAll(hands?: any): any;
89
+ /**
90
+ * Remove selected hands entirely.
91
+ * @param {Object} hands - Current hands object
92
+ * @returns {Object} Updated hands object
93
+ */
94
+ removeSelected(hands?: any): any;
95
+ /**
96
+ * Helper to create RangeManager from hands object with optional dead cards exclusion.
97
+ * @param {Object} hands - Hands object
98
+ * @param {string[]} deadCards - Dead cards to exclude
99
+ * @returns {RangeManager} RangeManager instance
100
+ */
101
+ getHandsRangeManager(hands?: any, deadCards?: string[]): RangeManager;
102
+ /**
103
+ * Helper to convert RangeManager result to matching hands object.
104
+ * @param {RangeManager} rmResult - RangeManager instance
105
+ * @param {Object} hands - Hands object to match against
106
+ * @returns {Object} Matching hands object
107
+ */
108
+ rangeManagerToMatching(rmResult: RangeManager, hands?: any): any;
109
+ /**
110
+ * Unified batch filtering function using RangeManager.hitsHand().
111
+ * @param {string[]} criteria - Array of RangeManager criteria
112
+ * @param {string[]} boardCards - Board cards
113
+ * @param {Object} hands - Hands object to filter
114
+ * @returns {Promise<Object>} Filtered hands object
115
+ */
116
+ getFilteredHandsByCriteria(criteria: string[], boardCards?: string[], hands?: any): Promise<any>;
117
+ /**
118
+ * Get hands matching a rank.
119
+ * @param {string} rank - Rank (A, K, Q, etc.)
120
+ * @param {Object} hands - Hands object
121
+ * @param {string[]} deadCards - Dead cards to exclude
122
+ * @returns {Object} Matching hands
123
+ */
124
+ getHandsByRank(rank: string, hands?: any, deadCards?: string[]): any;
125
+ /**
126
+ * Get hands matching a suit.
127
+ * @param {string} suitName - Suit name (clubs, diamonds, hearts, spades)
128
+ * @param {Object} hands - Hands object
129
+ * @param {string[]} deadCards - Dead cards to exclude
130
+ * @returns {Object} Matching hands
131
+ */
132
+ getHandsBySuit(suitName: string, hands?: any, deadCards?: string[]): any;
133
+ /**
134
+ * Get hands with both cards of a suit.
135
+ * @param {string} suitName - Suit name
136
+ * @param {Object} hands - Hands object
137
+ * @param {string[]} deadCards - Dead cards to exclude
138
+ * @returns {Object} Matching hands
139
+ */
140
+ getHandsByDoubleSuit(suitName: string, hands?: any, deadCards?: string[]): any;
141
+ /**
142
+ * Get paired hands.
143
+ * @param {Object} hands - Hands object
144
+ * @param {string[]} deadCards - Dead cards to exclude
145
+ * @returns {Object} Matching hands
146
+ */
147
+ getPairedHands(hands?: any, deadCards?: string[]): any;
148
+ /**
149
+ * Get suited hands.
150
+ * @param {Object} hands - Hands object
151
+ * @param {string[]} deadCards - Dead cards to exclude
152
+ * @returns {Object} Matching hands
153
+ */
154
+ getSuitedHands(hands?: any, deadCards?: string[]): any;
155
+ /**
156
+ * Get offsuit hands.
157
+ * @param {Object} hands - Hands object
158
+ * @param {string[]} deadCards - Dead cards to exclude
159
+ * @returns {Object} Matching hands
160
+ */
161
+ getOffsuitHands(hands?: any, deadCards?: string[]): any;
162
+ /**
163
+ * Get hands with explicit colors.
164
+ * @param {Object} hands - Hands object
165
+ * @returns {Object} Matching hands
166
+ */
167
+ getHandsWithColors(hands?: any): any;
168
+ /**
169
+ * Get array of hand strings with a specific color.
170
+ * @param {string} color - Color to find
171
+ * @param {Object} hands - Hands object
172
+ * @returns {string[]} Array of hand strings
173
+ */
174
+ getHandsWithColor(color: string, hands?: any): string[];
175
+ /**
176
+ * Get selected hands.
177
+ * @param {Object} hands - Hands object
178
+ * @returns {Object} Matching hands
179
+ */
180
+ getSelectedHands(hands?: any): any;
181
+ /**
182
+ * Get hand strength type.
183
+ * @param {string} hand - Hand code
184
+ * @param {string[]} boardCards - Board cards
185
+ * @returns {string|null} Hand strength type
186
+ */
187
+ getHandStrengthType(hand: string, boardCards?: string[]): string | null;
188
+ /**
189
+ * Get hands by hand strength.
190
+ * @param {string} targetStrength - Strength type
191
+ * @param {Object} hands - Hands object
192
+ * @param {string[]} boardCards - Board cards
193
+ * @returns {Promise<Object>} Matching hands
194
+ */
195
+ getHandsByStrength(targetStrength: string, hands?: any, boardCards?: string[]): Promise<any>;
196
+ /**
197
+ * Get hands by draw type.
198
+ * @param {string} targetDraw - Draw type
199
+ * @param {Object} hands - Hands object
200
+ * @param {string[]} boardCards - Board cards
201
+ * @param {number} boardLength - Board length
202
+ * @returns {Promise<Object>} Matching hands
203
+ */
204
+ getHandsByDraw(targetDraw: string, hands?: any, boardCards?: string[], boardLength?: number): Promise<any>;
205
+ /**
206
+ * Apply color to hands.
207
+ * @param {Object} hands - Current hands object
208
+ * @param {string} color - Color to apply
209
+ * @param {string[]} targetHands - Array of hand strings to color
210
+ * @returns {Object} Updated hands object
211
+ */
212
+ applyColor(hands: any, color: string, targetHands: string[]): any;
213
+ /**
214
+ * Remove color from hands.
215
+ * @param {Object} hands - Current hands object
216
+ * @param {string} color - Color to remove
217
+ * @returns {Object} Updated hands object
218
+ */
219
+ removeColor(hands: any, color: string): any;
220
+ /**
221
+ * Calculate color equities.
222
+ * @param {Object} hands - Hands object
223
+ * @param {string[]} heroCards - Hero cards
224
+ * @param {string[]} boardCards - Board cards
225
+ * @param {string[]} deadCards - Dead cards
226
+ * @param {string[]} colors - Colors array
227
+ * @returns {Promise<Object>} Color equities object
228
+ */
229
+ calculateColorEquities(hands?: any, heroCards?: string[], boardCards?: string[], deadCards?: string[], colors?: string[]): Promise<any>;
230
+ /**
231
+ * Apply predefined range.
232
+ * @param {string} rangeName - Range name
233
+ * @param {Array} ranges - Ranges array
234
+ * @param {Object} hands - Current hands object
235
+ * @returns {{hands: Object, rangeName: string}} Updated hands and range name
236
+ */
237
+ applyRange(rangeName: string, ranges: any[], hands?: any): {
238
+ hands: any;
239
+ rangeName: string;
240
+ };
241
+ /**
242
+ * Check if values array has explicit color.
243
+ * @param {Array} values - Values array
244
+ * @returns {boolean}
245
+ */
246
+ hasExplicitColor(values: any[]): boolean;
247
+ /**
248
+ * Check if values array has selected state.
249
+ * @param {Array} values - Values array
250
+ * @returns {boolean}
251
+ */
252
+ isSelected(values: any[]): boolean;
253
+ /**
254
+ * Check if any hands are selected.
255
+ * @param {Object} hands - Hands object
256
+ * @returns {boolean}
257
+ */
258
+ hasAnySelectedHands(hands?: any): boolean;
259
+ /**
260
+ * Make color faint (reduce saturation and lightness).
261
+ * @param {string} color - HSL color string
262
+ * @returns {string} Faint color
263
+ */
264
+ makeFaint(color: string): string;
265
+ /**
266
+ * Apply visual effects to color based on selection state.
267
+ * @param {string} color - Base color
268
+ * @param {boolean} isSelected - Is selected
269
+ * @param {boolean} hasExplicitColor - Has explicit color
270
+ * @param {boolean} hasAnySelected - Any hands selected
271
+ * @returns {string} Final color
272
+ */
273
+ applyEffects(color: string, isSelected: boolean, hasExplicitColor: boolean, hasAnySelected?: boolean): string;
274
+ /**
275
+ * Get highlighted hands from visible hands.
276
+ * @param {Object} visibleHands - Visible hands object
277
+ * @returns {string[]} Array of hand strings
278
+ */
279
+ getHighlightedHands(visibleHands: any): string[];
280
+ /**
281
+ * Get selected hands from visible hands.
282
+ * @param {Object} visibleHands - Visible hands object
283
+ * @returns {string[]} Array of hand strings
284
+ */
285
+ getSelectedHandsFromVisible(visibleHands: any): string[];
286
+ /**
287
+ * Apply selection state based on modifiers (ctrl, shift, normal).
288
+ * @param {Object} hands - Current hands object
289
+ * @param {Object} filteredHands - Filtered hands to apply selection to
290
+ * @param {Object} modifiers - {ctrl: boolean, shift: boolean}
291
+ * @param {string[]} strengthFilters - Array of filter types that are strength-based
292
+ * @param {string} filterType - Filter type for determining if it's a strength filter
293
+ * @returns {Object} Updated hands object
294
+ */
295
+ applySelectionWithModifiers(hands: any, filteredHands: any, modifiers: any, strengthFilters?: string[], filterType?: string): any;
296
+ /**
297
+ * Apply filter selection with modifiers (consolidates handleButtonClick logic).
298
+ * @param {string} filterType - Filter type (rank, suit, paired, etc.)
299
+ * @param {string|null} filterValue - Filter value (rank letter, suit name, etc.)
300
+ * @param {Object} modifiers - {ctrl: boolean, shift: boolean}
301
+ * @param {Object} hands - Current hands object
302
+ * @param {string[]} boardCards - Board cards
303
+ * @returns {Promise<Object>} Updated hands object
304
+ */
305
+ applyFilterSelection(filterType: string, filterValue: string | null, modifiers: any, hands: any, boardCards?: string[]): Promise<any>;
306
+ /**
307
+ * Handle color action with modifiers (consolidates handleColorClick logic).
308
+ * @param {string} color - Color to apply
309
+ * @param {Object} modifiers - {ctrl: boolean, shift: boolean}
310
+ * @param {Object} hands - Current hands object
311
+ * @returns {Object} Updated hands object
312
+ */
313
+ handleColorAction(color: string, modifiers: any, hands?: any): any;
314
+ /**
315
+ * Check if a filter button should be active (consolidates isButtonActive logic).
316
+ * @param {string} filterType - Filter type
317
+ * @param {string|null} filterValue - Filter value
318
+ * @param {Object} hands - Hands object
319
+ * @param {string[]} boardCards - Board cards
320
+ * @returns {boolean} True if button should be active
321
+ */
322
+ isFilterActive(filterType: string, filterValue: string | null, hands?: any, boardCards?: string[]): boolean;
323
+ /**
324
+ * Get color statistics (counts and percentages).
325
+ * @param {Object} hands - Hands object
326
+ * @param {string[]} colors - Colors array
327
+ * @returns {{counts: Object, percentages: Object}} Color statistics
328
+ */
329
+ getColorStatistics(hands?: any, colors?: string[]): {
330
+ counts: any;
331
+ percentages: any;
332
+ };
333
+ }
334
+ import { RangeManager } from 'poker-rangeman';