UNPKG

@ima/core

Version:

IMA.js framework for isomorphic javascript application

73 lines (72 loc) 1.96 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "PageStateManager", { enumerable: true, get: function() { return PageStateManager; } }); class PageStateManager { onChange; /** * Clears the state history. */ clear() { return; } /** * Sets a new page state by applying the provided patch to the current * state. * * @param statePatch The patch of the current state. */ setState(patchState) { return; } /** * Returns the current page state. * * @return The current page state. */ getState() { return {}; } /** * Returns the recorded history of page states. The states will be * chronologically sorted from the oldest to the newest. * * Note that the implementation may limit the size of the recorded history, * therefore the complete history may not be available. * * @return The recorded history of page states. */ getAllStates() { return []; } /** * Returns queueing state patches off the main state from the begin of transaction. * * @return State patches from the begin of transaction. */ getTransactionStatePatches() { return []; } /** * Starts queueing state patches off the main state. While the transaction * is active every `setState` call has no effect on the current state. * * Note that call to `getState` after the transaction has begun will * return state as it was before the transaction. */ beginTransaction() { return; } /** * Applies queued state patches to the main state. All patches are squashed * and applied with one `setState` call. */ commitTransaction() { return; } /** * Cancels ongoing transaction. Uncommitted state changes are lost. */ cancelTransaction() { return; } } //# sourceMappingURL=PageStateManager.js.map