@maxr0ssi/chaos-chess 0.1.7 → 0.2.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/index.d.ts CHANGED
@@ -30,6 +30,8 @@ export declare interface ChaosChessProps {
30
30
  skipSetup?: boolean;
31
31
  showControls?: boolean;
32
32
  showMuteButton?: boolean;
33
+ initialState?: ChaosChessState;
34
+ onStateChange?: (state: ChaosChessState) => void;
33
35
  onGameOver?: (status: GameStatus) => void;
34
36
  onMove?: (fen: string, san: string, color: Color) => void;
35
37
  onChaosAction?: (action: ChaosAction, newFen: string) => void;
@@ -37,11 +39,26 @@ export declare interface ChaosChessProps {
37
39
  className?: string;
38
40
  }
39
41
 
42
+ /**
43
+ * A serializable snapshot of a game, from `onStateChange`. Pass it back as
44
+ * `initialState` to restore the game after the component was unmounted.
45
+ * Move history and the last-move highlight are not included.
46
+ */
47
+ export declare interface ChaosChessState {
48
+ version: 1;
49
+ phase: 'setup' | 'playing';
50
+ fen: string;
51
+ humanColor: 'w' | 'b';
52
+ depth: number;
53
+ stupidLevel: number;
54
+ muted: boolean;
55
+ }
56
+
40
57
  declare type ChaosTarget = 'help_white' | 'help_black';
41
58
 
42
59
  export { Color }
43
60
 
44
- export declare type GameResult = 'checkmate' | 'stalemate' | 'draw' | 'insufficient' | 'threefold' | 'fifty-move';
61
+ export declare type GameResult = 'checkmate' | 'stalemate' | 'draw' | 'insufficient' | 'threefold' | 'fifty-move' | 'king-captured';
45
62
 
46
63
  export declare interface GameStatus {
47
64
  isGameOver: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxr0ssi/chaos-chess",
3
- "version": "0.1.7",
3
+ "version": "0.2.1",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org",
6
6
  "access": "public"
@@ -20,7 +20,9 @@
20
20
  "./styles": "./dist/chaos-chess.css"
21
21
  },
22
22
  "files": [
23
- "dist"
23
+ "dist",
24
+ "CHANGELOG.md",
25
+ "THIRD_PARTY_NOTICES.md"
24
26
  ],
25
27
  "scripts": {
26
28
  "dev": "vite",