narraleaf-react 0.0.1 → 0.0.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.
@@ -1,3 +1,4 @@
1
- import { LiveGame, Game } from "../game";
1
+ import { Game, LiveGame } from "../game";
2
2
  import { GameState } from "../../player/gameState";
3
- export { LiveGame, GameState, Game };
3
+ import { Storable, Namespace } from "../store/storable";
4
+ export { LiveGame, GameState, Game, Storable, Namespace, };
@@ -2,9 +2,9 @@ import { LogicAction } from "../action/logicAction";
2
2
  import { Actionable } from "../action/actionable";
3
3
  import { GameState } from "../../player/gameState";
4
4
  import { Chained, ChainedActions, Proxied } from "../action/chain";
5
+ import { ScriptCtx } from "../elements/script";
5
6
  export type ConditionConfig = {};
6
- interface LambdaCtx {
7
- gameState: GameState;
7
+ interface LambdaCtx extends ScriptCtx {
8
8
  }
9
9
  type LambdaHandler<T = any> = (ctx: LambdaCtx) => T;
10
10
  export declare class Lambda {
@@ -7,32 +7,32 @@ export declare class Control extends Actionable {
7
7
  * Execute actions in order, waiting for each action to complete
8
8
  * @chainable
9
9
  */
10
- static do(actions: ChainedActions): never;
10
+ static do(actions: ChainedActions): ChainedControl;
11
11
  /**
12
12
  * Execute actions in order, do not wait for this action to complete
13
13
  * @chainable
14
14
  */
15
- static doAsync(actions: ChainedActions): never;
15
+ static doAsync(actions: ChainedActions): ChainedControl;
16
16
  /**
17
17
  * Execute all actions at the same time, waiting for any one action to complete
18
18
  * @chainable
19
19
  */
20
- static any(actions: ChainedActions): never;
20
+ static any(actions: ChainedActions): ChainedControl;
21
21
  /**
22
22
  * Execute all actions at the same time, waiting for all actions to complete
23
23
  * @chainable
24
24
  */
25
- static all(actions: ChainedActions): never;
25
+ static all(actions: ChainedActions): ChainedControl;
26
26
  /**
27
27
  * Execute all actions at the same time, do not wait for all actions to complete
28
28
  * @chainable
29
29
  */
30
- static allAsync(actions: ChainedActions): never;
30
+ static allAsync(actions: ChainedActions): ChainedControl;
31
31
  /**
32
32
  * Execute actions multiple times
33
33
  * @chainable
34
34
  */
35
- static repeat(times: number, actions: ChainedActions): never;
35
+ static repeat(times: number, actions: ChainedActions): ChainedControl;
36
36
  constructor();
37
37
  /**
38
38
  * Execute actions in order, waiting for each action to complete
@@ -1,8 +1,12 @@
1
+ import { Game, LiveGame } from "../game";
1
2
  import { Actionable } from "../action/actionable";
2
3
  import { GameState } from "../../player/gameState";
4
+ import type { Storable } from "../store/storable";
3
5
  export interface ScriptCtx {
4
- script: Script;
5
6
  gameState: GameState;
7
+ game: Game;
8
+ liveGame: LiveGame;
9
+ storable: Storable;
6
10
  }
7
11
  type ScriptRun = (ctx: ScriptCtx) => ScriptCleaner | void;
8
12
  export type ScriptCleaner = () => void;
@@ -17,5 +17,5 @@ export type BaseStorableDeserializeHandlers = {
17
17
  [K in BaseStorableTypeName]: K extends "any" ? (data: WrappedStorableData<Exclude<BaseStorableType, UnserializableStorableType>>) => Exclude<BaseStorableType, UnserializableStorableType> : K extends "date" ? (data: WrappedStorableData<Date>) => Date : never;
18
18
  };
19
19
  export type NameSpaceContent<T extends string | number | symbol> = {
20
- [K in T]: StorableType;
20
+ [K in T]?: StorableType;
21
21
  };