39 lines
960 B
TypeScript
39 lines
960 B
TypeScript
/**
|
||
* Copyright (c) 2026 Dominic Masters
|
||
*
|
||
* This software is released under the MIT License.
|
||
* https://opensource.org/licenses/MIT
|
||
*/
|
||
|
||
/** Slot-based save file management. */
|
||
interface SaveNamespace {
|
||
/**
|
||
* Returns `true` if a save file is present for the given slot.
|
||
* @param slot - Save slot index (0–2).
|
||
*/
|
||
exists(slot: number): boolean;
|
||
|
||
/**
|
||
* Loads the save file for the given slot from persistent storage.
|
||
* Throws if the load fails.
|
||
* @param slot - Save slot index (0–2).
|
||
*/
|
||
load(slot: number): void;
|
||
|
||
/**
|
||
* Writes the save file for the given slot to persistent storage.
|
||
* Throws if the write fails.
|
||
* @param slot - Save slot index (0–2).
|
||
*/
|
||
write(slot: number): void;
|
||
|
||
/**
|
||
* Deletes the save file for the given slot from persistent storage.
|
||
* Throws if the delete fails.
|
||
* @param slot - Save slot index (0–2).
|
||
*/
|
||
delete(slot: number): void;
|
||
}
|
||
|
||
declare var Save: SaveNamespace;
|