import { SynologyClient } from "../common/apis/synology" ; import type { NotificationSettings } from "../common/state" ; import { RequestManager } from "./requestManager" ; export interface BackgroundState { api : SynologyClient ; finishedTaskIds : Set < string > | undefined ; pollRequestManager : RequestManager ; lastNotificationSettings : NotificationSettings | undefined ; notificationInterval : number | undefined ; showNonErrorNotifications : boolean ; isInitializingExtension : boolean ; } const state = { api : new SynologyClient ( { } ) , finishedTaskIds : undefined , pollRequestManager : new RequestManager ( ) , lastNotificationSettings : undefined , notificationInterval : undefined , showNonErrorNotifications : true , isInitializingExtension : true , } ; export function getMutableStateSingleton ( ) { return state ; } ( window as any ) . getMutableStateSingleton = getMutableStateSingleton ;