/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { InkStory } from "../inkTypes" // FUNCTIONS TO LOAD AND SAVE STORY STATE // in a way that ink can understand. export const getStoryStateObject = (story: InkStory) => { return JSON.parse(story.state.ToJson()) } export const loadStoryStateObject = (story: InkStory, state: Record) => { story.state.LoadJsonObj(state) }