Convenience build.
CommandHandler
does not keep a reference to an engine -- this is to avoid circular references, which the browser doesn't care about but other embedded environments do.InkEngine
, which contains all of the getters that the engine has (The actual object passed in has not changed)text
field, so you don't have to check whether it exists now.tokens
field on inkLine - this was always an experimental and undocumented feature.ink-processor
into its own package @a-morphous/frontispiece-line-parser
.at-shorthand
.The eventHandler
on configuration no longer exists, and ink-processor
now ships with a custom event handler that doesn't rely upon browser Event
s.
In order to call events, now you should run the following:
let engine = new InkProcessorEngine(story); engine.events.on('madeChoice', (evt) => { console.log("we have made a choice!") console.log(evt.data.choice) });
Specifically, the event handler has been renamed to events
, and listening to events are now named on
(once
for one-time events), and off
. The callback also now only takes a single Event parameter, where the data
holds all of the information in the event.
This also removes the specific on
and off
functions on the InkProcessorEngine
itself; to return to previous functionality and listen to new ink story or visual state updates, you can call them the same way as any other event: via engine.events.on('setInkStory')
or similar.
This change was made both to remove a dependency on the browser (and allow ink-processor
to work in Node or more obscure environments), but also to improve type safety.
inkjs
, instead using interfaces that define the subset of commands that ink-processor
needs to run.ink-processor
to work in Node.JS.moo
to remove remaining CJS artifacts from module.primaryPath
which is the first unique path.inkjs
.esbuild
, and add typescript typings.>>
to $
.InkParserConfigParams
eventHandler
is now optional, as the documentation claims.inkjs
.linear
, and the shape of them have changed; the currentState
is no longer passed in separately from the engine, and mutatedVisualState
no longer needs to be set from the command itselfhideOlderLines
function that lets you ensure at max x
latest lines are visible.getLatestVisibleLineInSection
got lost somehow, this re-adds it.reset
functionality to the engine to allow you to set a story back to the beginning.startingPath
variable to visible state sections to use for determining frontmatter meta right after a choice.path
variable to the visible lines to determine the ink path for that linelocked
variableInitial version.