unocab 0.8.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/LICENSE +21 -0
- package/README.md +108 -0
- package/esm/_dnt.shims.d.ts +4 -0
- package/esm/_dnt.shims.js +62 -0
- package/esm/_dnt.test_shims.d.ts +7 -0
- package/esm/deps/deno.land/std@0.190.0/fmt/colors.d.ts +270 -0
- package/esm/deps/deno.land/std@0.190.0/testing/_diff.d.ts +26 -0
- package/esm/deps/deno.land/std@0.190.0/testing/_format.d.ts +1 -0
- package/esm/deps/deno.land/std@0.190.0/testing/asserts.d.ts +284 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/ZodError.d.ts +163 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/ZodError.js +148 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/errors.d.ts +5 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/errors.js +9 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/external.d.ts +6 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/external.js +6 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/helpers/enumUtil.d.ts +8 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/helpers/enumUtil.js +1 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/helpers/errorUtil.d.ts +9 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/helpers/errorUtil.js +5 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/helpers/parseUtil.d.ts +78 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/helpers/parseUtil.js +104 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/helpers/partialUtil.d.ts +8 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/helpers/partialUtil.js +1 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/helpers/typeAliases.d.ts +2 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/helpers/typeAliases.js +1 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/helpers/util.d.ts +68 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/helpers/util.js +138 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/index.d.ts +4 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/index.js +4 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/locales/en.d.ts +3 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/locales/en.js +127 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/mod.d.ts +1 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/mod.js +1 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/types.d.ts +965 -0
- package/esm/deps/deno.land/x/zod@v3.21.4/types.js +3689 -0
- package/esm/errors.d.ts +72 -0
- package/esm/errors.js +39 -0
- package/esm/game.d.ts +868 -0
- package/esm/game.js +868 -0
- package/esm/mod.d.ts +3 -0
- package/esm/mod.js +3 -0
- package/esm/package.json +3 -0
- package/esm/tests/basic-tests.d.ts +8 -0
- package/esm/tests/draw-tests.d.ts +8 -0
- package/esm/tests/non-specific-tests.test.d.ts +1 -0
- package/esm/tests/rule-violation-tests.d.ts +8 -0
- package/esm/tests/specific-tests.test.d.ts +1 -0
- package/esm/tests/test-utils.d.ts +91 -0
- package/esm/tests/turn-tests.d.ts +8 -0
- package/esm/types.d.ts +2280 -0
- package/esm/types.js +152 -0
- package/esm/utils.d.ts +19 -0
- package/esm/utils.js +44 -0
- package/package.json +32 -0
- package/script/_dnt.shims.d.ts +4 -0
- package/script/_dnt.shims.js +66 -0
- package/script/_dnt.test_shims.d.ts +7 -0
- package/script/deps/deno.land/std@0.190.0/fmt/colors.d.ts +270 -0
- package/script/deps/deno.land/std@0.190.0/testing/_diff.d.ts +26 -0
- package/script/deps/deno.land/std@0.190.0/testing/_format.d.ts +1 -0
- package/script/deps/deno.land/std@0.190.0/testing/asserts.d.ts +284 -0
- package/script/deps/deno.land/x/zod@v3.21.4/ZodError.d.ts +163 -0
- package/script/deps/deno.land/x/zod@v3.21.4/ZodError.js +152 -0
- package/script/deps/deno.land/x/zod@v3.21.4/errors.d.ts +5 -0
- package/script/deps/deno.land/x/zod@v3.21.4/errors.js +17 -0
- package/script/deps/deno.land/x/zod@v3.21.4/external.d.ts +6 -0
- package/script/deps/deno.land/x/zod@v3.21.4/external.js +22 -0
- package/script/deps/deno.land/x/zod@v3.21.4/helpers/enumUtil.d.ts +8 -0
- package/script/deps/deno.land/x/zod@v3.21.4/helpers/enumUtil.js +2 -0
- package/script/deps/deno.land/x/zod@v3.21.4/helpers/errorUtil.d.ts +9 -0
- package/script/deps/deno.land/x/zod@v3.21.4/helpers/errorUtil.js +8 -0
- package/script/deps/deno.land/x/zod@v3.21.4/helpers/parseUtil.d.ts +78 -0
- package/script/deps/deno.land/x/zod@v3.21.4/helpers/parseUtil.js +119 -0
- package/script/deps/deno.land/x/zod@v3.21.4/helpers/partialUtil.d.ts +8 -0
- package/script/deps/deno.land/x/zod@v3.21.4/helpers/partialUtil.js +2 -0
- package/script/deps/deno.land/x/zod@v3.21.4/helpers/typeAliases.d.ts +2 -0
- package/script/deps/deno.land/x/zod@v3.21.4/helpers/typeAliases.js +2 -0
- package/script/deps/deno.land/x/zod@v3.21.4/helpers/util.d.ts +68 -0
- package/script/deps/deno.land/x/zod@v3.21.4/helpers/util.js +142 -0
- package/script/deps/deno.land/x/zod@v3.21.4/index.d.ts +4 -0
- package/script/deps/deno.land/x/zod@v3.21.4/index.js +33 -0
- package/script/deps/deno.land/x/zod@v3.21.4/locales/en.d.ts +3 -0
- package/script/deps/deno.land/x/zod@v3.21.4/locales/en.js +129 -0
- package/script/deps/deno.land/x/zod@v3.21.4/mod.d.ts +1 -0
- package/script/deps/deno.land/x/zod@v3.21.4/mod.js +17 -0
- package/script/deps/deno.land/x/zod@v3.21.4/types.d.ts +965 -0
- package/script/deps/deno.land/x/zod@v3.21.4/types.js +3739 -0
- package/script/errors.d.ts +72 -0
- package/script/errors.js +43 -0
- package/script/game.d.ts +868 -0
- package/script/game.js +895 -0
- package/script/mod.d.ts +3 -0
- package/script/mod.js +19 -0
- package/script/package.json +3 -0
- package/script/tests/basic-tests.d.ts +8 -0
- package/script/tests/draw-tests.d.ts +8 -0
- package/script/tests/non-specific-tests.test.d.ts +1 -0
- package/script/tests/rule-violation-tests.d.ts +8 -0
- package/script/tests/specific-tests.test.d.ts +1 -0
- package/script/tests/test-utils.d.ts +91 -0
- package/script/tests/turn-tests.d.ts +8 -0
- package/script/types.d.ts +2280 -0
- package/script/types.js +155 -0
- package/script/utils.d.ts +19 -0
- package/script/utils.js +50 -0
package/esm/mod.d.ts
ADDED
package/esm/mod.js
ADDED
package/esm/package.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: (makeGame: (customRandomCards?: ({
|
|
2
|
+
type: "reverse" | "zero" | "one" | "two" | "three" | "four" | "five" | "six" | "seven" | "eight" | "nine" | "plus-two" | "skip";
|
|
3
|
+
color: "red" | "blue" | "green" | "yellow";
|
|
4
|
+
} | {
|
|
5
|
+
type: "plus-four" | "color-chooser";
|
|
6
|
+
color?: undefined;
|
|
7
|
+
})[], playerCount?: number, stackPlusTwos?: boolean) => [import("./test-utils.js").TestGame<boolean>, ...string[]], suffix: string) => void;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: (makeGame: (customRandomCards?: ({
|
|
2
|
+
type: "reverse" | "zero" | "one" | "two" | "three" | "four" | "five" | "six" | "seven" | "eight" | "nine" | "plus-two" | "skip";
|
|
3
|
+
color: "red" | "blue" | "green" | "yellow";
|
|
4
|
+
} | {
|
|
5
|
+
type: "plus-four" | "color-chooser";
|
|
6
|
+
color?: undefined;
|
|
7
|
+
})[], playerCount?: number, stackPlusTwos?: boolean) => [import("./test-utils.js").TestGame<boolean>, ...string[]], suffix: string) => void;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: (makeGame: (customRandomCards?: ({
|
|
2
|
+
type: "reverse" | "zero" | "one" | "two" | "three" | "four" | "five" | "six" | "seven" | "eight" | "nine" | "plus-two" | "skip";
|
|
3
|
+
color: "red" | "blue" | "green" | "yellow";
|
|
4
|
+
} | {
|
|
5
|
+
type: "plus-four" | "color-chooser";
|
|
6
|
+
color?: undefined;
|
|
7
|
+
})[], playerCount?: number, stackPlusTwos?: boolean) => [import("./test-utils.js").TestGame<boolean>, ...string[]], suffix: string) => void;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Game } from "../game.js";
|
|
2
|
+
import { Card } from "../types.js";
|
|
3
|
+
import { XOR } from "../utils.js";
|
|
4
|
+
export declare class TestGame<T extends boolean = false> extends Game<T> {
|
|
5
|
+
private customRandomCards;
|
|
6
|
+
private customRandomCard;
|
|
7
|
+
constructor(props?: XOR<{
|
|
8
|
+
serialisedState?: string;
|
|
9
|
+
}, {
|
|
10
|
+
shorthandMode?: T;
|
|
11
|
+
stackPlusTwos?: boolean;
|
|
12
|
+
initialSeed?: string | number;
|
|
13
|
+
noInit?: boolean;
|
|
14
|
+
customRandomCards?: Card[];
|
|
15
|
+
}>);
|
|
16
|
+
protected deckTopCard(): {
|
|
17
|
+
type: "reverse" | "zero" | "one" | "two" | "three" | "four" | "five" | "six" | "seven" | "eight" | "nine" | "plus-two" | "skip";
|
|
18
|
+
color: "red" | "blue" | "green" | "yellow";
|
|
19
|
+
} | {
|
|
20
|
+
type: "plus-four" | "color-chooser";
|
|
21
|
+
color?: undefined;
|
|
22
|
+
};
|
|
23
|
+
jumpToEventIndex(index: number): ({
|
|
24
|
+
type: "card_played";
|
|
25
|
+
by: string;
|
|
26
|
+
card: {
|
|
27
|
+
type: "reverse" | "zero" | "one" | "two" | "three" | "four" | "five" | "six" | "seven" | "eight" | "nine" | "plus-two" | "skip";
|
|
28
|
+
color: "red" | "blue" | "green" | "yellow";
|
|
29
|
+
} | {
|
|
30
|
+
type: "plus-four" | "color-chooser";
|
|
31
|
+
color?: undefined;
|
|
32
|
+
};
|
|
33
|
+
} | {
|
|
34
|
+
type: "bluff_called";
|
|
35
|
+
by: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: "draw";
|
|
38
|
+
by: string;
|
|
39
|
+
} | {
|
|
40
|
+
type: "pass";
|
|
41
|
+
by: string;
|
|
42
|
+
} | {
|
|
43
|
+
type: "choose-color";
|
|
44
|
+
color: "red" | "blue" | "green" | "yellow";
|
|
45
|
+
by: string;
|
|
46
|
+
} | {
|
|
47
|
+
type: "game_info";
|
|
48
|
+
info: {
|
|
49
|
+
type: "bluff_called";
|
|
50
|
+
by: string;
|
|
51
|
+
} | {
|
|
52
|
+
type: "bluff_call_succeeded";
|
|
53
|
+
by: string;
|
|
54
|
+
of: string;
|
|
55
|
+
} | {
|
|
56
|
+
type: "bluff_call_failed";
|
|
57
|
+
by: string;
|
|
58
|
+
of: string;
|
|
59
|
+
} | {
|
|
60
|
+
type: "seed_changed";
|
|
61
|
+
newSeed: number;
|
|
62
|
+
} | {
|
|
63
|
+
type: "player_won";
|
|
64
|
+
id: string;
|
|
65
|
+
} | {
|
|
66
|
+
type: "game_ended";
|
|
67
|
+
loser: string;
|
|
68
|
+
} | {
|
|
69
|
+
type: "player_joined";
|
|
70
|
+
id: string;
|
|
71
|
+
} | {
|
|
72
|
+
type: "player_left";
|
|
73
|
+
id: string;
|
|
74
|
+
} | {
|
|
75
|
+
type: "pile_to_deck";
|
|
76
|
+
};
|
|
77
|
+
})[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* the make game function.
|
|
81
|
+
* the first card is the pile top card, and every 7 cards after that are the decks.
|
|
82
|
+
* @param shorthandMode whether to use shorthand mode for the game
|
|
83
|
+
* @returns a function that takes custom random cards and creates a game
|
|
84
|
+
*/
|
|
85
|
+
export declare const makeGame: (shorthandMode: boolean) => (customRandomCards?: Card[], playerCount?: number, stackPlusTwos?: boolean) => [TestGame<boolean>, ...string[]];
|
|
86
|
+
export type MakeGame = ReturnType<typeof makeGame>;
|
|
87
|
+
type testNameFn = (name: string) => string;
|
|
88
|
+
export declare function mkts(fn: (makeGame: MakeGame,
|
|
89
|
+
/** transforms the test name to include additional information about the test */
|
|
90
|
+
tn: testNameFn) => void): (makeGame: MakeGame, suffix: string) => void;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: (makeGame: (customRandomCards?: ({
|
|
2
|
+
type: "reverse" | "zero" | "one" | "two" | "three" | "four" | "five" | "six" | "seven" | "eight" | "nine" | "plus-two" | "skip";
|
|
3
|
+
color: "red" | "blue" | "green" | "yellow";
|
|
4
|
+
} | {
|
|
5
|
+
type: "plus-four" | "color-chooser";
|
|
6
|
+
color?: undefined;
|
|
7
|
+
})[], playerCount?: number, stackPlusTwos?: boolean) => [import("./test-utils.js").TestGame<boolean>, ...string[]], suffix: string) => void;
|
|
8
|
+
export default _default;
|