diff --git a/CHANGELOG.md b/CHANGELOG.md index a07deec4..647305dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added +* Added `World` generic type to `Action` and `PromiseAction` + ### Changed ### Deprecated diff --git a/src/Actor.ts b/src/Actor.ts index 7cec5ad4..8e002026 100644 --- a/src/Actor.ts +++ b/src/Actor.ts @@ -1,5 +1,5 @@ -export type Action = (actor: Actor) => Answer -export type PromiseAction = (actor: Actor) => Promise +export type Action = (actor: Actor) => Answer +export type PromiseAction = (actor: Actor) => Promise export type DefaultFunction = () => T @@ -21,14 +21,14 @@ export default class Actor { return this.memory.get(key) as T } - public attemptsTo(action: Action): Answer { + public attemptsTo(action: Action): Answer { return action(this) } /** * Just a synonym for attemptsTo */ - public ask(action: Action): Answer { + public ask(action: Action): Answer { return action(this) } }