UNPKG

@casual-simulation/aux-common

Version:
54 lines 1.46 kB
import type { BotsState } from './Bot'; export type StoredAux = StoredAuxVersion1 | StoredAuxVersion2; export interface StoredAuxVersion1 { version: 1; state: BotsState; } export interface StoredAuxVersion2 { version: 2; updates: InstUpdate[]; } /** * Defines an interface that represents an update that has been applied to an inst. * @dochash types/os/spaces * @docname InstUpdate */ export interface InstUpdate { /** * The ID of the update. */ id: number; /** * The update content. */ update: string; /** * The time that the update occurred at. */ timestamp: number; } /** * Gets whether the given stored aux matches the given version. * @param stored * @param version * @returns */ export declare function isStoredVersion2(stored: unknown): stored is StoredAuxVersion2; /** * Gets whether the given stored aux matches the given version. * @param stored * @param version * @returns */ export declare function isStoredVersion1(stored: unknown): stored is StoredAuxVersion1; /** * Gets the bot state from the given stored causal tree. * @param stored The stored tree to load. */ export declare function getBotsStateFromStoredAux(stored: StoredAux): BotsState; /** * Gets the state that should be uploaded from the given data. * @param data The data. */ export declare function getUploadState(data: StoredAux | BotsState): BotsState; //# sourceMappingURL=StoredAux.d.ts.map