2022-01-24 22:25:34 -06:00
|
|
|
import { shallowReactive } from "vue";
|
2021-09-05 18:53:04 -05:00
|
|
|
|
2022-07-15 00:55:36 -05:00
|
|
|
/** An object of global data that is not persistent. */
|
2022-01-13 22:25:47 -06:00
|
|
|
export interface Transient {
|
2022-07-15 00:55:36 -05:00
|
|
|
/** A list of the duration, in ms, of the last 10 game ticks. Used for calculating TPS. */
|
2022-01-13 22:25:47 -06:00
|
|
|
lastTenTicks: number[];
|
2022-07-15 00:55:36 -05:00
|
|
|
/** Whether or not a NaN value has been detected and undealt with. */
|
2022-01-13 22:25:47 -06:00
|
|
|
hasNaN: boolean;
|
2022-07-15 00:55:36 -05:00
|
|
|
/** The location within the player save data object of the NaN value. */
|
2022-01-13 22:25:47 -06:00
|
|
|
NaNPath?: string[];
|
2022-07-15 00:55:36 -05:00
|
|
|
/** The parent object of the NaN value. */
|
2022-01-13 22:25:47 -06:00
|
|
|
NaNReceiver?: Record<string, unknown>;
|
|
|
|
}
|
|
|
|
|
2022-07-09 22:09:25 -05:00
|
|
|
declare global {
|
2022-07-10 00:43:52 -05:00
|
|
|
/** Augment the window object so the transient state can be accessed from the console. */
|
2022-07-09 22:09:25 -05:00
|
|
|
interface Window {
|
|
|
|
state: Transient;
|
|
|
|
}
|
|
|
|
}
|
2022-07-15 00:55:36 -05:00
|
|
|
/** The global transient state object. */
|
2022-01-24 22:25:34 -06:00
|
|
|
export default window.state = shallowReactive<Transient>({
|
2021-09-05 18:53:04 -05:00
|
|
|
lastTenTicks: [],
|
|
|
|
hasNaN: false,
|
2022-01-13 22:25:47 -06:00
|
|
|
NaNPath: []
|
2021-09-05 18:53:04 -05:00
|
|
|
});
|