@gamepark/react-client 6.38.5 → 7.0.0-beta.2

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.
Files changed (317) hide show
  1. package/dist/Actions/ActionFailed.d.ts +6 -6
  2. package/dist/Actions/ActionFailed.js +4 -8
  3. package/dist/Actions/ActionFailed.js.map +1 -1
  4. package/dist/Actions/AnimationComplete.d.ts +6 -6
  5. package/dist/Actions/AnimationComplete.js +4 -8
  6. package/dist/Actions/AnimationComplete.js.map +1 -1
  7. package/dist/Actions/AnimationPaused.d.ts +6 -6
  8. package/dist/Actions/AnimationPaused.js +4 -8
  9. package/dist/Actions/AnimationPaused.js.map +1 -1
  10. package/dist/Actions/AnimationStart.d.ts +5 -5
  11. package/dist/Actions/AnimationStart.js +1 -4
  12. package/dist/Actions/AnimationStart.js.map +1 -1
  13. package/dist/Actions/ClearFailures.d.ts +1 -5
  14. package/dist/Actions/ClearFailures.js +3 -9
  15. package/dist/Actions/ClearFailures.js.map +1 -1
  16. package/dist/Actions/GameNotificationsReceived.d.ts +8 -10
  17. package/dist/Actions/GameNotificationsReceived.js +2 -9
  18. package/dist/Actions/GameNotificationsReceived.js.map +1 -1
  19. package/dist/Actions/GameOver.d.ts +16 -16
  20. package/dist/Actions/GameOver.js +4 -8
  21. package/dist/Actions/GameOver.js.map +1 -1
  22. package/dist/Actions/GameStateLoaded.d.ts +16 -16
  23. package/dist/Actions/GameStateLoaded.js +7 -20
  24. package/dist/Actions/GameStateLoaded.js.map +1 -1
  25. package/dist/Actions/MovePlayed.d.ts +11 -11
  26. package/dist/Actions/MovePlayed.js +3 -2
  27. package/dist/Actions/MovePlayed.js.map +1 -1
  28. package/dist/Actions/MoveUndone.d.ts +7 -7
  29. package/dist/Actions/MoveUndone.js +4 -9
  30. package/dist/Actions/MoveUndone.js.map +1 -1
  31. package/dist/Actions/PlayerQuit.d.ts +5 -11
  32. package/dist/Actions/PlayerQuit.js +2 -19
  33. package/dist/Actions/PlayerQuit.js.map +1 -1
  34. package/dist/Actions/SetAnimationsSpeed.d.ts +1 -6
  35. package/dist/Actions/SetAnimationsSpeed.js +3 -9
  36. package/dist/Actions/SetAnimationsSpeed.js.map +1 -1
  37. package/dist/Actions/giveUp.d.ts +1 -0
  38. package/dist/Actions/giveUp.js +3 -0
  39. package/dist/Actions/giveUp.js.map +1 -0
  40. package/dist/Actions/index.d.ts +7 -12
  41. package/dist/Actions/index.js +7 -28
  42. package/dist/Actions/index.js.map +1 -1
  43. package/dist/Actions/loadGameState.d.ts +14 -0
  44. package/dist/Actions/loadGameState.js +3 -0
  45. package/dist/Actions/loadGameState.js.map +1 -0
  46. package/dist/Actions/playMove.d.ts +10 -0
  47. package/dist/Actions/playMove.js +3 -0
  48. package/dist/Actions/playMove.js.map +1 -0
  49. package/dist/Actions/receiveNotifications.d.ts +8 -0
  50. package/dist/Actions/receiveNotifications.js +3 -0
  51. package/dist/Actions/receiveNotifications.js.map +1 -0
  52. package/dist/Actions/removePlayer.d.ts +5 -0
  53. package/dist/Actions/removePlayer.js +3 -0
  54. package/dist/Actions/removePlayer.js.map +1 -0
  55. package/dist/Actions/reportFailure.d.ts +1 -0
  56. package/dist/Actions/reportFailure.js +3 -0
  57. package/dist/Actions/reportFailure.js.map +1 -0
  58. package/dist/Actions/setGameOver.d.ts +2 -0
  59. package/dist/Actions/setGameOver.js +3 -0
  60. package/dist/Actions/setGameOver.js.map +1 -0
  61. package/dist/Actions/startAnimation.d.ts +1 -0
  62. package/dist/Actions/startAnimation.js +3 -0
  63. package/dist/Actions/startAnimation.js.map +1 -0
  64. package/dist/Actions/undoMove.d.ts +5 -0
  65. package/dist/Actions/undoMove.js +4 -0
  66. package/dist/Actions/undoMove.js.map +1 -0
  67. package/dist/Chat/ChatChannel.d.ts +5 -5
  68. package/dist/Chat/ChatChannel.js +1 -2
  69. package/dist/Chat/Message.d.ts +6 -6
  70. package/dist/Chat/Message.js +1 -2
  71. package/dist/Chat/index.d.ts +2 -2
  72. package/dist/Chat/index.js +2 -18
  73. package/dist/Chat/index.js.map +1 -1
  74. package/dist/Deckbuilding/Deck.d.ts +5 -5
  75. package/dist/Deckbuilding/Deck.js +1 -2
  76. package/dist/Deckbuilding/index.d.ts +4 -4
  77. package/dist/Deckbuilding/index.js +4 -24
  78. package/dist/Deckbuilding/index.js.map +1 -1
  79. package/dist/Deckbuilding/useDeleteDeck.d.ts +5 -2
  80. package/dist/Deckbuilding/useDeleteDeck.js +9 -15
  81. package/dist/Deckbuilding/useDeleteDeck.js.map +1 -1
  82. package/dist/Deckbuilding/useMyDecks.d.ts +3 -2
  83. package/dist/Deckbuilding/useMyDecks.js +8 -14
  84. package/dist/Deckbuilding/useMyDecks.js.map +1 -1
  85. package/dist/Deckbuilding/useSaveDeck.d.ts +5 -2
  86. package/dist/Deckbuilding/useSaveDeck.js +9 -15
  87. package/dist/Deckbuilding/useSaveDeck.js.map +1 -1
  88. package/dist/EjectPlayer/EjectPlayer.d.ts +1 -6
  89. package/dist/EjectPlayer/EjectPlayer.js +2 -8
  90. package/dist/EjectPlayer/EjectPlayer.js.map +1 -1
  91. package/dist/EjectPlayer/index.d.ts +1 -1
  92. package/dist/EjectPlayer/index.js +1 -17
  93. package/dist/EjectPlayer/index.js.map +1 -1
  94. package/dist/Failure/Failure.d.ts +6 -6
  95. package/dist/Failure/Failure.js +6 -9
  96. package/dist/Failure/Failure.js.map +1 -1
  97. package/dist/Failure/index.d.ts +1 -1
  98. package/dist/Failure/index.js +1 -17
  99. package/dist/Failure/index.js.map +1 -1
  100. package/dist/GiveUp/GiveUp.d.ts +7 -7
  101. package/dist/GiveUp/GiveUp.js +2 -5
  102. package/dist/GiveUp/GiveUp.js.map +1 -1
  103. package/dist/GiveUp/index.d.ts +1 -1
  104. package/dist/GiveUp/index.js +1 -17
  105. package/dist/GiveUp/index.js.map +1 -1
  106. package/dist/Hooks/index.d.ts +5 -5
  107. package/dist/Hooks/index.js +5 -21
  108. package/dist/Hooks/index.js.map +1 -1
  109. package/dist/Hooks/useChatMessages.d.ts +7 -12
  110. package/dist/Hooks/useChatMessages.js +44 -51
  111. package/dist/Hooks/useChatMessages.js.map +1 -1
  112. package/dist/Hooks/useMessageAuthor.d.ts +4 -4
  113. package/dist/Hooks/useMessageAuthor.js +13 -18
  114. package/dist/Hooks/useMessageAuthor.js.map +1 -1
  115. package/dist/Hooks/useOptions.d.ts +2 -2
  116. package/dist/Hooks/useOptions.js +4 -8
  117. package/dist/Hooks/useOptions.js.map +1 -1
  118. package/dist/Hooks/useRematch.d.ts +7 -7
  119. package/dist/Hooks/useRematch.js +18 -19
  120. package/dist/Hooks/useRematch.js.map +1 -1
  121. package/dist/Hooks/useSendMessage.d.ts +4 -1
  122. package/dist/Hooks/useSendMessage.js +6 -14
  123. package/dist/Hooks/useSendMessage.js.map +1 -1
  124. package/dist/Log/StartLiveLog.d.ts +1 -4
  125. package/dist/Log/StartLiveLog.js +3 -5
  126. package/dist/Log/StartLiveLog.js.map +1 -1
  127. package/dist/Log/StopLiveLog.d.ts +2 -5
  128. package/dist/Log/StopLiveLog.js +6 -9
  129. package/dist/Log/StopLiveLog.js.map +1 -1
  130. package/dist/Log/index.d.ts +4 -4
  131. package/dist/Log/index.js +4 -20
  132. package/dist/Log/index.js.map +1 -1
  133. package/dist/Log/useLogControls.d.ts +7 -7
  134. package/dist/Log/useLogControls.js +18 -22
  135. package/dist/Log/useLogControls.js.map +1 -1
  136. package/dist/PlayerTime/PlayerTime.d.ts +11 -11
  137. package/dist/PlayerTime/PlayerTime.js +1 -2
  138. package/dist/PlayerTime/index.d.ts +1 -1
  139. package/dist/PlayerTime/index.js +1 -17
  140. package/dist/PlayerTime/index.js.map +1 -1
  141. package/dist/Rematch/RematchQueries.d.ts +19 -19
  142. package/dist/Rematch/RematchQueries.js +23 -13
  143. package/dist/Rematch/RematchQueries.js.map +1 -1
  144. package/dist/Rematch/index.d.ts +1 -1
  145. package/dist/Rematch/index.js +1 -17
  146. package/dist/Rematch/index.js.map +1 -1
  147. package/dist/Sound/MuteSounds.d.ts +2 -5
  148. package/dist/Sound/MuteSounds.js +7 -10
  149. package/dist/Sound/MuteSounds.js.map +1 -1
  150. package/dist/Sound/UnmuteSounds.d.ts +1 -4
  151. package/dist/Sound/UnmuteSounds.js +3 -5
  152. package/dist/Sound/UnmuteSounds.js.map +1 -1
  153. package/dist/Sound/index.d.ts +3 -3
  154. package/dist/Sound/index.js +3 -19
  155. package/dist/Sound/index.js.map +1 -1
  156. package/dist/Sound/useSoundControls.d.ts +7 -7
  157. package/dist/Sound/useSoundControls.js +18 -22
  158. package/dist/Sound/useSoundControls.js.map +1 -1
  159. package/dist/Store/DisplayedAction.d.ts +15 -15
  160. package/dist/Store/DisplayedAction.js +12 -19
  161. package/dist/Store/DisplayedAction.js.map +1 -1
  162. package/dist/Store/GamePageState.d.ts +27 -28
  163. package/dist/Store/GamePageState.js +1 -2
  164. package/dist/Store/PlayedMove.d.ts +5 -5
  165. package/dist/Store/PlayedMove.js +1 -2
  166. package/dist/Store/endAnimation.d.ts +1 -0
  167. package/dist/Store/endAnimation.js +3 -0
  168. package/dist/Store/endAnimation.js.map +1 -0
  169. package/dist/Store/gameMiddleware.d.ts +4 -4
  170. package/dist/Store/gameMiddleware.js +34 -41
  171. package/dist/Store/gameMiddleware.js.map +1 -1
  172. package/dist/Store/gameReducer.d.ts +14 -20
  173. package/dist/Store/gameReducer.js +462 -525
  174. package/dist/Store/gameReducer.js.map +1 -1
  175. package/dist/Store/index.d.ts +4 -3
  176. package/dist/Store/index.js +4 -19
  177. package/dist/Store/index.js.map +1 -1
  178. package/dist/Store/localMovePreviewMiddleware.d.ts +4 -4
  179. package/dist/Store/localMovePreviewMiddleware.js +19 -18
  180. package/dist/Store/localMovePreviewMiddleware.js.map +1 -1
  181. package/dist/Store/store.d.ts +13 -0
  182. package/dist/Store/store.js +27 -0
  183. package/dist/Store/store.js.map +1 -0
  184. package/dist/Tutorial/PlayTutorialMoves.d.ts +1 -9
  185. package/dist/Tutorial/PlayTutorialMoves.js +2 -6
  186. package/dist/Tutorial/PlayTutorialMoves.js.map +1 -1
  187. package/dist/Tutorial/Tutorial.d.ts +5 -5
  188. package/dist/Tutorial/Tutorial.js +1 -2
  189. package/dist/Tutorial/TutorialDescription.d.ts +7 -7
  190. package/dist/Tutorial/TutorialDescription.js +1 -2
  191. package/dist/Tutorial/index.d.ts +4 -4
  192. package/dist/Tutorial/index.js +4 -20
  193. package/dist/Tutorial/index.js.map +1 -1
  194. package/dist/Tutorial/useTutorial.d.ts +2 -2
  195. package/dist/Tutorial/useTutorial.js +12 -22
  196. package/dist/Tutorial/useTutorial.js.map +1 -1
  197. package/dist/Types/GameAI.d.ts +1 -1
  198. package/dist/Types/GameAI.js +1 -2
  199. package/dist/Types/GameData.d.ts +18 -18
  200. package/dist/Types/GameData.js +1 -2
  201. package/dist/Types/GameMessage.d.ts +8 -8
  202. package/dist/Types/GameMessage.js +1 -2
  203. package/dist/Types/GameMode.d.ts +6 -6
  204. package/dist/Types/GameMode.js +7 -10
  205. package/dist/Types/GameMode.js.map +1 -1
  206. package/dist/Types/GameNotification.d.ts +6 -6
  207. package/dist/Types/GameNotification.js +1 -2
  208. package/dist/Types/GameOptions.d.ts +9 -9
  209. package/dist/Types/GameOptions.js +5 -8
  210. package/dist/Types/GameOptions.js.map +1 -1
  211. package/dist/Types/MovePlayedNotification.d.ts +9 -9
  212. package/dist/Types/MovePlayedNotification.js +6 -12
  213. package/dist/Types/MovePlayedNotification.js.map +1 -1
  214. package/dist/Types/MoveUndoneNotification.d.ts +8 -8
  215. package/dist/Types/MoveUndoneNotification.js +6 -12
  216. package/dist/Types/MoveUndoneNotification.js.map +1 -1
  217. package/dist/Types/Player.d.ts +13 -13
  218. package/dist/Types/Player.js +1 -2
  219. package/dist/Types/PlayerQuitReason.d.ts +4 -4
  220. package/dist/Types/PlayerQuitReason.js +5 -8
  221. package/dist/Types/PlayerQuitReason.js.map +1 -1
  222. package/dist/Types/ProxyGameData.d.ts +13 -13
  223. package/dist/Types/ProxyGameData.js +1 -2
  224. package/dist/Types/Tournament.d.ts +4 -4
  225. package/dist/Types/Tournament.js +1 -2
  226. package/dist/Types/index.d.ts +12 -12
  227. package/dist/Types/index.js +12 -28
  228. package/dist/Types/index.js.map +1 -1
  229. package/dist/User/User.d.ts +6 -6
  230. package/dist/User/User.js +1 -2
  231. package/dist/User/index.d.ts +2 -2
  232. package/dist/User/index.js +2 -18
  233. package/dist/User/index.js.map +1 -1
  234. package/dist/User/useMe.d.ts +4 -4
  235. package/dist/User/useMe.js +10 -21
  236. package/dist/User/useMe.js.map +1 -1
  237. package/dist/animations/Animation.d.ts +6 -6
  238. package/dist/animations/Animation.js +1 -2
  239. package/dist/animations/AnimationContext.d.ts +8 -8
  240. package/dist/animations/AnimationContext.js +1 -2
  241. package/dist/animations/AnimationState.d.ts +6 -6
  242. package/dist/animations/AnimationState.js +1 -2
  243. package/dist/animations/AnimationStep.d.ts +6 -6
  244. package/dist/animations/AnimationStep.js +7 -10
  245. package/dist/animations/AnimationStep.js.map +1 -1
  246. package/dist/animations/Animations.d.ts +8 -8
  247. package/dist/animations/Animations.js +15 -22
  248. package/dist/animations/Animations.js.map +1 -1
  249. package/dist/animations/AnimationsListener.d.ts +6 -0
  250. package/dist/animations/AnimationsListener.js +54 -0
  251. package/dist/animations/AnimationsListener.js.map +1 -0
  252. package/dist/animations/AnimationsListenerCreator.d.ts +2 -4
  253. package/dist/animations/AnimationsListenerCreator.js +40 -50
  254. package/dist/animations/AnimationsListenerCreator.js.map +1 -1
  255. package/dist/animations/animationMiddleware.d.ts +4 -0
  256. package/dist/animations/animationMiddleware.js +50 -0
  257. package/dist/animations/animationMiddleware.js.map +1 -0
  258. package/dist/animations/index.d.ts +5 -6
  259. package/dist/animations/index.js +5 -22
  260. package/dist/animations/index.js.map +1 -1
  261. package/dist/api/Client/GameClientAPI.d.ts +24 -24
  262. package/dist/api/Client/GameClientAPI.js +116 -165
  263. package/dist/api/Client/GameClientAPI.js.map +1 -1
  264. package/dist/api/Client/GameNotificationsListener.d.ts +5 -5
  265. package/dist/api/Client/GameNotificationsListener.js +62 -113
  266. package/dist/api/Client/GameNotificationsListener.js.map +1 -1
  267. package/dist/api/Client/RemoteGameLoader.d.ts +4 -5
  268. package/dist/api/Client/RemoteGameLoader.js +66 -62
  269. package/dist/api/Client/RemoteGameLoader.js.map +1 -1
  270. package/dist/api/Client/RemoteGameProvider.d.ts +7 -7
  271. package/dist/api/Client/RemoteGameProvider.js +19 -70
  272. package/dist/api/Client/RemoteGameProvider.js.map +1 -1
  273. package/dist/api/Client/apollo-client.d.ts +2 -2
  274. package/dist/api/Client/apollo-client.js +40 -58
  275. package/dist/api/Client/apollo-client.js.map +1 -1
  276. package/dist/api/Client/index.d.ts +4 -3
  277. package/dist/api/Client/index.js +4 -19
  278. package/dist/api/Client/index.js.map +1 -1
  279. package/dist/api/Client/pusher.d.ts +2 -0
  280. package/dist/api/Client/pusher.js +9 -0
  281. package/dist/api/Client/pusher.js.map +1 -0
  282. package/dist/api/GameAPI.d.ts +10 -10
  283. package/dist/api/GameAPI.js +1 -2
  284. package/dist/api/Local/ConsoleTools.d.ts +25 -25
  285. package/dist/api/Local/ConsoleTools.js +78 -86
  286. package/dist/api/Local/ConsoleTools.js.map +1 -1
  287. package/dist/api/Local/GameLocalAPI.d.ts +44 -44
  288. package/dist/api/Local/GameLocalAPI.js +442 -540
  289. package/dist/api/Local/GameLocalAPI.js.map +1 -1
  290. package/dist/api/Local/LocalGameProvider.d.ts +15 -15
  291. package/dist/api/Local/LocalGameProvider.js +18 -58
  292. package/dist/api/Local/LocalGameProvider.js.map +1 -1
  293. package/dist/api/Local/index.d.ts +1 -1
  294. package/dist/api/Local/index.js +1 -17
  295. package/dist/api/Local/index.js.map +1 -1
  296. package/dist/api/index.d.ts +2 -2
  297. package/dist/api/index.js +2 -18
  298. package/dist/api/index.js.map +1 -1
  299. package/dist/index.d.ts +16 -18
  300. package/dist/index.js +16 -36
  301. package/dist/index.js.map +1 -1
  302. package/dist/util/ArrayUtil.d.ts +2 -2
  303. package/dist/util/ArrayUtil.js +16 -21
  304. package/dist/util/ArrayUtil.js.map +1 -1
  305. package/package.json +66 -65
  306. package/dist/Actions/ActionType.d.ts +0 -3
  307. package/dist/Actions/ActionType.js +0 -8
  308. package/dist/Actions/ActionType.js.map +0 -1
  309. package/dist/Scoring/ScoringDescription.d.ts +0 -8
  310. package/dist/Scoring/ScoringDescription.js +0 -3
  311. package/dist/Scoring/ScoringDescription.js.map +0 -1
  312. package/dist/Scoring/index.d.ts +0 -1
  313. package/dist/Scoring/index.js +0 -18
  314. package/dist/Scoring/index.js.map +0 -1
  315. package/dist/util/TimeUtil.d.ts +0 -2
  316. package/dist/util/TimeUtil.js +0 -27
  317. package/dist/util/TimeUtil.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { Action } from '@gamepark/rules-api';
2
- import { GameNotification } from './GameNotification';
3
- export type MovePlayedNotification<Move, PlayerId> = GameNotification<PlayerId> & {
4
- actionId: string | null;
5
- moveView: Move;
6
- consequences: Move[];
7
- };
8
- export declare function movePlayedNotification<Move, PlayerId>(action: Action): MovePlayedNotification<Move, PlayerId>;
9
- export declare function isMovePlayedNotification<Move, PlayerId>(notification: GameNotification<PlayerId>): notification is MovePlayedNotification<Move, PlayerId>;
1
+ import { Action } from '@gamepark/rules-api';
2
+ import { GameNotification } from './GameNotification';
3
+ export type MovePlayedNotification<Move = any, PlayerId = any> = GameNotification<PlayerId> & {
4
+ actionId: string | null;
5
+ moveView: Move;
6
+ consequences: Move[];
7
+ };
8
+ export declare function movePlayedNotification<Move, PlayerId>(action: Action): MovePlayedNotification<Move, PlayerId>;
9
+ export declare function isMovePlayedNotification<Move, PlayerId>(notification: GameNotification<PlayerId>): notification is MovePlayedNotification<Move, PlayerId>;
@@ -1,13 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isMovePlayedNotification = exports.movePlayedNotification = void 0;
4
- function movePlayedNotification(action) {
5
- var _a;
6
- return { actionId: (_a = action.id) !== null && _a !== void 0 ? _a : null, playerId: action.playerId, moveView: action.move, consequences: action.consequences };
7
- }
8
- exports.movePlayedNotification = movePlayedNotification;
9
- function isMovePlayedNotification(notification) {
10
- return notification.moveView != undefined;
11
- }
12
- exports.isMovePlayedNotification = isMovePlayedNotification;
1
+ export function movePlayedNotification(action) {
2
+ return { actionId: action.id ?? null, playerId: action.playerId, moveView: action.move, consequences: action.consequences };
3
+ }
4
+ export function isMovePlayedNotification(notification) {
5
+ return notification.moveView != undefined;
6
+ }
13
7
  //# sourceMappingURL=MovePlayedNotification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MovePlayedNotification.js","sourceRoot":"","sources":["../../src/Types/MovePlayedNotification.ts"],"names":[],"mappings":";;;AASA,SAAgB,sBAAsB,CAAiB,MAAc;;IACnE,OAAO,EAAE,QAAQ,EAAE,MAAA,MAAM,CAAC,EAAE,mCAAI,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAA;AAC7H,CAAC;AAFD,wDAEC;AAED,SAAgB,wBAAwB,CAAiB,YAAwC;IAC/F,OAAQ,YAAuD,CAAC,QAAQ,IAAI,SAAS,CAAA;AACvF,CAAC;AAFD,4DAEC"}
1
+ {"version":3,"file":"MovePlayedNotification.js","sourceRoot":"","sources":["../../src/Types/MovePlayedNotification.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,sBAAsB,CAAiB,MAAc;IACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,IAAI,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAA;AAC7H,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAiB,YAAwC;IAC/F,OAAQ,YAAuD,CAAC,QAAQ,IAAI,SAAS,CAAA;AACvF,CAAC"}
@@ -1,8 +1,8 @@
1
- import { Action } from '@gamepark/rules-api';
2
- import { GameNotification } from './GameNotification';
3
- export type MoveUndoneNotification<PlayerId> = GameNotification<PlayerId> & {
4
- actionId: string | null;
5
- moveUndone: number;
6
- };
7
- export declare function moveUndoneNotification<PlayerId>(action: Action<any, PlayerId>, moveUndone: number): MoveUndoneNotification<PlayerId>;
8
- export declare function isMoveUndoneNotification<PlayerId>(notification: GameNotification<PlayerId>): notification is MoveUndoneNotification<PlayerId>;
1
+ import { Action } from '@gamepark/rules-api';
2
+ import { GameNotification } from './GameNotification';
3
+ export type MoveUndoneNotification<PlayerId = any> = GameNotification<PlayerId> & {
4
+ actionId: string | null;
5
+ moveUndone: number;
6
+ };
7
+ export declare function moveUndoneNotification<PlayerId>(action: Action<any, PlayerId>, moveUndone: number): MoveUndoneNotification<PlayerId>;
8
+ export declare function isMoveUndoneNotification<PlayerId>(notification: GameNotification<PlayerId>): notification is MoveUndoneNotification<PlayerId>;
@@ -1,13 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isMoveUndoneNotification = exports.moveUndoneNotification = void 0;
4
- function moveUndoneNotification(action, moveUndone) {
5
- var _a;
6
- return { playerId: action.playerId, actionId: (_a = action.id) !== null && _a !== void 0 ? _a : null, moveUndone: moveUndone };
7
- }
8
- exports.moveUndoneNotification = moveUndoneNotification;
9
- function isMoveUndoneNotification(notification) {
10
- return notification.moveUndone != undefined;
11
- }
12
- exports.isMoveUndoneNotification = isMoveUndoneNotification;
1
+ export function moveUndoneNotification(action, moveUndone) {
2
+ return { playerId: action.playerId, actionId: action.id ?? null, moveUndone };
3
+ }
4
+ export function isMoveUndoneNotification(notification) {
5
+ return notification.moveUndone != undefined;
6
+ }
13
7
  //# sourceMappingURL=MoveUndoneNotification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MoveUndoneNotification.js","sourceRoot":"","sources":["../../src/Types/MoveUndoneNotification.ts"],"names":[],"mappings":";;;AAQA,SAAgB,sBAAsB,CAAW,MAA6B,EAAE,UAAkB;;IAChG,OAAO,EAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAA,MAAM,CAAC,EAAE,mCAAI,IAAI,EAAE,UAAU,YAAA,EAAC,CAAA;AAC7E,CAAC;AAFD,wDAEC;AAED,SAAgB,wBAAwB,CAAW,YAAwC;IACzF,OAAQ,YAAiD,CAAC,UAAU,IAAI,SAAS,CAAA;AACnF,CAAC;AAFD,4DAEC"}
1
+ {"version":3,"file":"MoveUndoneNotification.js","sourceRoot":"","sources":["../../src/Types/MoveUndoneNotification.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,sBAAsB,CAAW,MAA6B,EAAE,UAAkB;IAChG,OAAO,EAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,IAAI,IAAI,EAAE,UAAU,EAAC,CAAA;AAC7E,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAW,YAAwC;IACzF,OAAQ,YAAiD,CAAC,UAAU,IAAI,SAAS,CAAA;AACnF,CAAC"}
@@ -1,13 +1,13 @@
1
- import { PlayerTime } from '../PlayerTime';
2
- import { PlayerQuitReason } from './PlayerQuitReason';
3
- export type Player<PlayerId = any> = {
4
- id: PlayerId;
5
- userId?: string;
6
- name?: string;
7
- avatar?: any;
8
- gamePointsDelta?: number | null;
9
- tournamentPoints?: number | null;
10
- time?: PlayerTime;
11
- quit?: boolean;
12
- quitReason?: PlayerQuitReason;
13
- };
1
+ import { PlayerTime } from '../PlayerTime';
2
+ import { PlayerQuitReason } from './PlayerQuitReason';
3
+ export type Player<PlayerId = any> = {
4
+ id: PlayerId;
5
+ userId?: string;
6
+ name?: string;
7
+ avatar?: any;
8
+ gamePointsDelta?: number | null;
9
+ tournamentPoints?: number | null;
10
+ time?: PlayerTime;
11
+ quit?: boolean;
12
+ quitReason?: PlayerQuitReason;
13
+ };
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=Player.js.map
@@ -1,4 +1,4 @@
1
- export declare enum PlayerQuitReason {
2
- GiveUp = 1,
3
- Ejected = 2
4
- }
1
+ export declare enum PlayerQuitReason {
2
+ GiveUp = 1,
3
+ Ejected = 2
4
+ }
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlayerQuitReason = void 0;
4
- var PlayerQuitReason;
5
- (function (PlayerQuitReason) {
6
- PlayerQuitReason[PlayerQuitReason["GiveUp"] = 1] = "GiveUp";
7
- PlayerQuitReason[PlayerQuitReason["Ejected"] = 2] = "Ejected";
8
- })(PlayerQuitReason = exports.PlayerQuitReason || (exports.PlayerQuitReason = {}));
1
+ export var PlayerQuitReason;
2
+ (function (PlayerQuitReason) {
3
+ PlayerQuitReason[PlayerQuitReason["GiveUp"] = 1] = "GiveUp";
4
+ PlayerQuitReason[PlayerQuitReason["Ejected"] = 2] = "Ejected";
5
+ })(PlayerQuitReason || (PlayerQuitReason = {}));
9
6
  //# sourceMappingURL=PlayerQuitReason.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlayerQuitReason.js","sourceRoot":"","sources":["../../src/Types/PlayerQuitReason.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,2DAAU,CAAA;IACV,6DAAW,CAAA;AACb,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B"}
1
+ {"version":3,"file":"PlayerQuitReason.js","sourceRoot":"","sources":["../../src/Types/PlayerQuitReason.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,2DAAU,CAAA;IACV,6DAAW,CAAA;AACb,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B"}
@@ -1,13 +1,13 @@
1
- import { Action } from '@gamepark/rules-api';
2
- import { Player } from './Player';
3
- import { GameOptions } from './GameOptions';
4
- export type ProxyGameData<Game = any, Move = any, PlayerId = any> = {
5
- playerId?: PlayerId;
6
- players: Player<PlayerId>[];
7
- setup: Game;
8
- state: Game;
9
- actions: Action<Move, PlayerId>[];
10
- monkeyOpponents: boolean;
11
- tutorial?: number;
12
- options?: GameOptions;
13
- };
1
+ import { Action } from '@gamepark/rules-api';
2
+ import { Player } from './Player';
3
+ import { GameOptions } from './GameOptions';
4
+ export type ProxyGameData<Game = any, Move = any, PlayerId = any> = {
5
+ playerId?: PlayerId;
6
+ players: Player<PlayerId>[];
7
+ setup: Game;
8
+ state: Game;
9
+ actions: Action<Move, PlayerId>[];
10
+ monkeyOpponents: boolean;
11
+ tutorial?: number;
12
+ options?: GameOptions;
13
+ };
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=ProxyGameData.js.map
@@ -1,4 +1,4 @@
1
- export type Tournament = {
2
- signedUp: boolean;
3
- number: number;
4
- };
1
+ export type Tournament = {
2
+ signedUp: boolean;
3
+ number: number;
4
+ };
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=Tournament.js.map
@@ -1,12 +1,12 @@
1
- export * from './GameAI';
2
- export * from './GameData';
3
- export * from './GameMessage';
4
- export * from './GameMode';
5
- export * from './GameNotification';
6
- export * from './GameOptions';
7
- export * from './MovePlayedNotification';
8
- export * from './MoveUndoneNotification';
9
- export * from './Player';
10
- export * from './PlayerQuitReason';
11
- export * from './ProxyGameData';
12
- export * from './Tournament';
1
+ export * from './GameAI';
2
+ export * from './GameData';
3
+ export * from './GameMessage';
4
+ export * from './GameMode';
5
+ export * from './GameNotification';
6
+ export * from './GameOptions';
7
+ export * from './MovePlayedNotification';
8
+ export * from './MoveUndoneNotification';
9
+ export * from './Player';
10
+ export * from './PlayerQuitReason';
11
+ export * from './ProxyGameData';
12
+ export * from './Tournament';
@@ -1,29 +1,13 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./GameAI"), exports);
18
- __exportStar(require("./GameData"), exports);
19
- __exportStar(require("./GameMessage"), exports);
20
- __exportStar(require("./GameMode"), exports);
21
- __exportStar(require("./GameNotification"), exports);
22
- __exportStar(require("./GameOptions"), exports);
23
- __exportStar(require("./MovePlayedNotification"), exports);
24
- __exportStar(require("./MoveUndoneNotification"), exports);
25
- __exportStar(require("./Player"), exports);
26
- __exportStar(require("./PlayerQuitReason"), exports);
27
- __exportStar(require("./ProxyGameData"), exports);
28
- __exportStar(require("./Tournament"), exports);
1
+ export * from './GameAI';
2
+ export * from './GameData';
3
+ export * from './GameMessage';
4
+ export * from './GameMode';
5
+ export * from './GameNotification';
6
+ export * from './GameOptions';
7
+ export * from './MovePlayedNotification';
8
+ export * from './MoveUndoneNotification';
9
+ export * from './Player';
10
+ export * from './PlayerQuitReason';
11
+ export * from './ProxyGameData';
12
+ export * from './Tournament';
29
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,6CAA0B;AAC1B,gDAA6B;AAC7B,6CAA0B;AAC1B,qDAAkC;AAClC,gDAA6B;AAC7B,2DAAwC;AACxC,2DAAwC;AACxC,2CAAwB;AACxB,qDAAkC;AAClC,kDAA+B;AAC/B,+CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
@@ -1,6 +1,6 @@
1
- export type User = {
2
- id: string;
3
- name?: string;
4
- avatar?: any;
5
- subscriptionSince: string | null;
6
- };
1
+ export type User = {
2
+ id: string;
3
+ name?: string;
4
+ avatar?: any;
5
+ subscriptionSince: string | null;
6
+ };
package/dist/User/User.js CHANGED
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=User.js.map
@@ -1,2 +1,2 @@
1
- export * from './User';
2
- export * from './useMe';
1
+ export * from './User';
2
+ export * from './useMe';
@@ -1,19 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./User"), exports);
18
- __exportStar(require("./useMe"), exports);
1
+ export * from './User';
2
+ export * from './useMe';
19
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/User/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/User/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA"}
@@ -1,4 +1,4 @@
1
- import { User } from './User';
2
- export declare function useMe(): {
3
- user: User;
4
- } | undefined;
1
+ import { User } from './User';
2
+ export declare function useMe(): {
3
+ user: User;
4
+ } | undefined;
@@ -1,22 +1,11 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.useMe = void 0;
8
- var client_1 = require("@apollo/client");
9
- var react_1 = require("react");
10
- var api_1 = require("../api");
11
- var GET_ME = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["query Me { me { user { id name subscriptionSince avatar {...AvatarInfo} } } } ", ""], ["query Me { me { user { id name subscriptionSince avatar {...AvatarInfo} } } } ", ""])), api_1.AVATAR_INFO);
12
- function useMe() {
13
- var _a;
14
- var urlSearchParams = new URLSearchParams(window.location.search);
15
- var fetchPolicy = (0, react_1.useMemo)(function () {
16
- return process.env.NODE_ENV !== 'production' && !urlSearchParams.get('game') && !urlSearchParams.get('mode') ? 'cache-only' : 'cache-first';
17
- }, []);
18
- return (_a = (0, client_1.useQuery)(GET_ME, { ssr: false, fetchPolicy: fetchPolicy }).data) === null || _a === void 0 ? void 0 : _a.me;
19
- }
20
- exports.useMe = useMe;
21
- var templateObject_1;
1
+ import { gql } from '@apollo/client';
2
+ import { useQuery } from '@apollo/client/react';
3
+ import { useMemo } from 'react';
4
+ import { AVATAR_INFO } from '../api';
5
+ const GET_ME = gql `query Me { me { user { id name subscriptionSince avatar {...AvatarInfo} } } } ${AVATAR_INFO}`;
6
+ export function useMe() {
7
+ const urlSearchParams = new URLSearchParams(window.location.search);
8
+ const fetchPolicy = useMemo(() => process.env.NODE_ENV !== 'production' && !urlSearchParams.get('game') && !urlSearchParams.get('mode') ? 'cache-only' : 'cache-first', []);
9
+ return useQuery(GET_ME, { ssr: false, fetchPolicy }).data?.me;
10
+ }
22
11
  //# sourceMappingURL=useMe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMe.js","sourceRoot":"","sources":["../../src/User/useMe.ts"],"names":[],"mappings":";;;;;;;AAAA,yCAA8C;AAC9C,+BAA+B;AAC/B,8BAAoC;AAGpC,IAAM,MAAM,OAAG,YAAG,wJAAA,gFAAiF,EAAW,EAAE,KAAb,iBAAW,CAAE,CAAA;AAEhH,SAAgB,KAAK;;IACnB,IAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACnE,IAAM,WAAW,GAAG,IAAA,eAAO,EAAC;QACxB,OAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa;IAApI,CAAoI,EACpI,EAAE,CAAC,CAAA;IACP,OAAO,MAAA,IAAA,iBAAQ,EAAyB,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,aAAA,EAAE,CAAC,CAAC,IAAI,0CAAE,EAAE,CAAA;AACvF,CAAC;AAND,sBAMC"}
1
+ {"version":3,"file":"useMe.js","sourceRoot":"","sources":["../../src/User/useMe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAGpC,MAAM,MAAM,GAAG,GAAG,CAAA,iFAAiF,WAAW,EAAE,CAAA;AAEhH,MAAM,UAAU,KAAK;IACnB,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACnE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,EACpI,EAAE,CAAC,CAAA;IACP,OAAO,QAAQ,CAAyB,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAA;AACvF,CAAC"}
@@ -1,6 +1,6 @@
1
- import { DisplayedAction } from '../Store';
2
- export type Animation<Move = any, PlayerId = any> = {
3
- move: Move;
4
- duration: number;
5
- action: DisplayedAction<Move, PlayerId>;
6
- };
1
+ import { DisplayedAction } from '../Store';
2
+ export type Animation<Move = any, PlayerId = any> = {
3
+ move: Move;
4
+ duration: number;
5
+ action: DisplayedAction<Move, PlayerId>;
6
+ };
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=Animation.js.map
@@ -1,8 +1,8 @@
1
- import { AnimationStep } from './AnimationStep';
2
- import { DisplayedAction } from '../Store';
3
- export type AnimationContext<Game, Move, PlayerId> = {
4
- action: DisplayedAction<Move, PlayerId>;
5
- game: Game;
6
- step: AnimationStep;
7
- playerId?: PlayerId;
8
- };
1
+ import { AnimationStep } from './AnimationStep';
2
+ import { DisplayedAction } from '../Store';
3
+ export type AnimationContext<Game = any, Move = any, PlayerId = any> = {
4
+ action: DisplayedAction<Move, PlayerId>;
5
+ game: Game;
6
+ step: AnimationStep;
7
+ playerId?: PlayerId;
8
+ };
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=AnimationContext.js.map
@@ -1,6 +1,6 @@
1
- import { AnimationStep } from './AnimationStep';
2
- export type AnimationState = {
3
- id: number;
4
- duration: number;
5
- step: AnimationStep;
6
- };
1
+ import { AnimationStep } from './AnimationStep';
2
+ export type AnimationState = {
3
+ id: number;
4
+ duration: number;
5
+ step: AnimationStep;
6
+ };
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=AnimationState.js.map
@@ -1,6 +1,6 @@
1
- export declare enum AnimationStep {
2
- BEFORE_MOVE = 1,
3
- AFTER_MOVE = 2,
4
- BEFORE_UNDO = 3,
5
- AFTER_UNDO = 4
6
- }
1
+ export declare enum AnimationStep {
2
+ BEFORE_MOVE = 1,
3
+ AFTER_MOVE = 2,
4
+ BEFORE_UNDO = 3,
5
+ AFTER_UNDO = 4
6
+ }
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnimationStep = void 0;
4
- var AnimationStep;
5
- (function (AnimationStep) {
6
- AnimationStep[AnimationStep["BEFORE_MOVE"] = 1] = "BEFORE_MOVE";
7
- AnimationStep[AnimationStep["AFTER_MOVE"] = 2] = "AFTER_MOVE";
8
- AnimationStep[AnimationStep["BEFORE_UNDO"] = 3] = "BEFORE_UNDO";
9
- AnimationStep[AnimationStep["AFTER_UNDO"] = 4] = "AFTER_UNDO";
10
- })(AnimationStep = exports.AnimationStep || (exports.AnimationStep = {}));
1
+ export var AnimationStep;
2
+ (function (AnimationStep) {
3
+ AnimationStep[AnimationStep["BEFORE_MOVE"] = 1] = "BEFORE_MOVE";
4
+ AnimationStep[AnimationStep["AFTER_MOVE"] = 2] = "AFTER_MOVE";
5
+ AnimationStep[AnimationStep["BEFORE_UNDO"] = 3] = "BEFORE_UNDO";
6
+ AnimationStep[AnimationStep["AFTER_UNDO"] = 4] = "AFTER_UNDO";
7
+ })(AnimationStep || (AnimationStep = {}));
11
8
  //# sourceMappingURL=AnimationStep.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnimationStep.js","sourceRoot":"","sources":["../../src/animations/AnimationStep.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,+DAAe,CAAA;IAAE,6DAAU,CAAA;IAAE,+DAAW,CAAA;IAAE,6DAAU,CAAA;AACtD,CAAC,EAFW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAExB"}
1
+ {"version":3,"file":"AnimationStep.js","sourceRoot":"","sources":["../../src/animations/AnimationStep.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,+DAAe,CAAA;IAAE,6DAAU,CAAA;IAAE,+DAAW,CAAA;IAAE,6DAAU,CAAA;AACtD,CAAC,EAFW,aAAa,KAAb,aAAa,QAExB"}
@@ -1,8 +1,8 @@
1
- import { AnimationContext } from './AnimationContext';
2
- export declare class Animations<Game = any, Move = any, PlayerId = any> {
3
- getDuration(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
4
- getPreDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
5
- getPostDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
6
- getUndoPreDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
7
- getUndoPostDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
8
- }
1
+ import { AnimationContext } from './AnimationContext';
2
+ export declare class Animations<Game = any, Move = any, PlayerId = any> {
3
+ getDuration(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
4
+ getPreDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
5
+ getPostDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
6
+ getUndoPreDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
7
+ getUndoPostDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
8
+ }
@@ -1,23 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Animations = void 0;
4
- var AnimationStep_1 = require("./AnimationStep");
5
- var Animations = (function () {
6
- function Animations() {
7
- }
8
- Animations.prototype.getDuration = function (move, context) {
9
- switch (context.step) {
10
- case AnimationStep_1.AnimationStep.BEFORE_MOVE:
11
- return this.getPreDuration ? this.getPreDuration(move, context) : 0;
12
- case AnimationStep_1.AnimationStep.AFTER_MOVE:
13
- return this.getPostDuration ? this.getPostDuration(move, context) : 0;
14
- case AnimationStep_1.AnimationStep.BEFORE_UNDO:
15
- return this.getUndoPreDuration ? this.getUndoPreDuration(move, context) : 0;
16
- case AnimationStep_1.AnimationStep.AFTER_UNDO:
17
- return this.getUndoPostDuration ? this.getUndoPostDuration(move, context) : 0;
18
- }
19
- };
20
- return Animations;
21
- }());
22
- exports.Animations = Animations;
1
+ import { AnimationStep } from './AnimationStep';
2
+ export class Animations {
3
+ getDuration(move, context) {
4
+ switch (context.step) {
5
+ case AnimationStep.BEFORE_MOVE:
6
+ return this.getPreDuration ? this.getPreDuration(move, context) : 0;
7
+ case AnimationStep.AFTER_MOVE:
8
+ return this.getPostDuration ? this.getPostDuration(move, context) : 0;
9
+ case AnimationStep.BEFORE_UNDO:
10
+ return this.getUndoPreDuration ? this.getUndoPreDuration(move, context) : 0;
11
+ case AnimationStep.AFTER_UNDO:
12
+ return this.getUndoPostDuration ? this.getUndoPostDuration(move, context) : 0;
13
+ }
14
+ }
15
+ }
23
16
  //# sourceMappingURL=Animations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Animations.js","sourceRoot":"","sources":["../../src/animations/Animations.ts"],"names":[],"mappings":";;;AACA,iDAA+C;AAE/C;IAAA;IAsBA,CAAC;IApBC,gCAAW,GAAX,UAAY,IAAU,EAAE,OAA+C;QACrE,QAAQ,OAAO,CAAC,IAAI,EAAE;YACpB,KAAK,6BAAa,CAAC,WAAW;gBAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACrE,KAAK,6BAAa,CAAC,UAAU;gBAC3B,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACvE,KAAK,6BAAa,CAAC,WAAW;gBAC5B,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YAC7E,KAAK,6BAAa,CAAC,UAAU;gBAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;SAChF;IACH,CAAC;IASH,iBAAC;AAAD,CAAC,AAtBD,IAsBC;AAtBY,gCAAU"}
1
+ {"version":3,"file":"Animations.js","sourceRoot":"","sources":["../../src/animations/Animations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,MAAM,OAAO,UAAU;IAErB,WAAW,CAAC,IAAU,EAAE,OAA+C;QACrE,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,aAAa,CAAC,WAAW;gBAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACrE,KAAK,aAAa,CAAC,UAAU;gBAC3B,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACvE,KAAK,aAAa,CAAC,WAAW;gBAC5B,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YAC7E,KAAK,aAAa,CAAC,UAAU;gBAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACjF,CAAC;IACH,CAAC;CASF"}
@@ -0,0 +1,6 @@
1
+ import { RulesCreator } from '../../../rules-api';
2
+ type Props<Game = any, Move = any, PlayerId = any> = {
3
+ Rules: RulesCreator<Game, Move, PlayerId>;
4
+ };
5
+ export declare function AnimationsListener<Game = any, Move = any, PlayerId = any>({ Rules }: Props<Game, Move, PlayerId>): null;
6
+ export {};