@spotlab/range 0.2.0 → 0.3.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.
- package/dist/index.d.ts +9 -0
- package/dist/index.js +164 -144
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -18,5 +18,14 @@ export declare function handsOfCombo(combo: string): Hand[];
|
|
|
18
18
|
* serializes the underlying Rust map as a JS `Map`, not a plain object.
|
|
19
19
|
*/
|
|
20
20
|
export declare function toComboWeights(hands: HandFrequency[]): Map<string, number>;
|
|
21
|
+
/**
|
|
22
|
+
* Expand per-combo weights to a hand-keyed range: every hand of each combo
|
|
23
|
+
* takes that combo's weight, and zero-weight combos are dropped. The inverse
|
|
24
|
+
* of `toComboWeights` — `toComboWeights(expandComboWeights(m))` gives back `m`,
|
|
25
|
+
* up to float rounding — though not the other way round, since the collapse
|
|
26
|
+
* averages over a combo's hands. Throws `SpotlabInputError` for a key that
|
|
27
|
+
* isn't a combo or a weight outside `[0, 1]`, as `parseRange` does.
|
|
28
|
+
*/
|
|
29
|
+
export declare function expandComboWeights(weights: Map<string, number>): HandFrequency[];
|
|
21
30
|
/** Every hand in the deck at weight 1 — the unconstrained range. */
|
|
22
31
|
export declare function fullRange(): HandFrequency[];
|