Adrià Vilanova MartÃnez | edbb73e | 2024-11-09 19:26:19 +0100 | [diff] [blame^] | 1 | import StartupDataModel from "../../models/StartupData"; |
| 2 | |
| 3 | export 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 | |
| 22 | export type StartupDataModification = (startupData: StartupDataModel) => void; |