blob: 827cd36d837c9f04f042fe00faa28251612442df [file] [log] [blame]
Adrià Vilanova Martínezedbb73e2024-11-09 19:26:19 +01001import StartupDataModel from "../../models/StartupData";
2
3export interface StartupDataStoragePort {
4 /**
5 * Get the startup data as stored in this class (without having applied any
6 * queued modification).
7 *
8 * NOTE: This might not be synced with the live startup data which exists in the
9 * DOM.
10 */
11 get(): StartupDataModel;
12
13 /* Enqueue a function which includes a modification to the startup data. */
14 enqueueModification(
15 modification: StartupDataModification,
16 ): StartupDataStoragePort;
17
18 /* Apply all the queued modifications and persist the result to the DOM. */
19 applyModifications(): StartupDataStoragePort;
20}
21
22export type StartupDataModification = (startupData: StartupDataModel) => void;