move-by-move 1.0.4 → 1.0.6

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/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export interface GameAction {
1
+ export declare type GameAction<Payload = any> = Payload & {
2
2
  type: string;
3
- }
3
+ };
4
4
  export interface Game<Type> {
5
5
  subscribe(listener: Function): void;
6
6
  unsubscribe(listener: Function): void;
@@ -8,4 +8,4 @@ export interface Game<Type> {
8
8
  move(action: GameAction): void;
9
9
  }
10
10
  export declare type RuleIO<Type> = [action: GameAction, state: Type];
11
- export declare function createGame<Type>(rules: Array<(input: RuleIO<Type>) => RuleIO<Type>>, initialGameState: Type): Game<Type>;
11
+ export default function createGame<Type>(rules: Array<(input: RuleIO<Type>) => RuleIO<Type>>, initialGameState: Type): Game<Type>;
package/lib/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createGame = void 0;
4
3
  const helpers_1 = require("./helpers");
5
4
  function createGame(rules, initialGameState) {
6
5
  let listeners = [];
@@ -28,4 +27,4 @@ function createGame(rules, initialGameState) {
28
27
  move,
29
28
  };
30
29
  }
31
- exports.createGame = createGame;
30
+ exports.default = createGame;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "move-by-move",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Simple game engine for turn based games",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",