1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2025-12-24 07:12:57 +00:00

Converting profiles store to TS

This commit is contained in:
2025-02-16 16:03:24 +04:00
parent 461fce5c05
commit 729d0281ed

View File

@@ -1,28 +1,23 @@
import { writable } from "svelte/store";
import { type Writable, writable } from "svelte/store";
import MaintenanceProfile from "$entities/MaintenanceProfile";
import MaintenanceSettings from "$lib/extension/settings/MaintenanceSettings";
/**
* Store for working with maintenance profiles in the Svelte popup.
*
* @type {import('svelte/store').Writable<MaintenanceProfile[]>}
*/
export const maintenanceProfilesStore = writable([]);
export const maintenanceProfilesStore: Writable<MaintenanceProfile[]> = writable([]);
/**
* Store for the active maintenance profile ID.
*
* @type {import('svelte/store').Writable<string|null>}
*/
export const activeProfileStore = writable(null);
export const activeProfileStore: Writable<string|null> = writable(null);
const maintenanceSettings = new MaintenanceSettings();
/**
* Active profile ID stored locally. Used to reset active profile once the existing profile was removed.
* @type {string|null}
*/
let lastActiveProfileId = null;
let lastActiveProfileId: string|null = null;
Promise.allSettled([
// Read the initial values from the storages first