UNPKG

scriptable-testlab

Version:

A lightweight, efficient tool designed to manage and update scripts for Scriptable.

68 lines (65 loc) 1.74 kB
import { GlobalPreferences } from './types/runtime.js'; import './mocks/system/args.js'; import 'scriptable-abstract'; import './mocks/system/config.js'; import './types/scriptable.js'; import './mocks/system/location.js'; import './mocks/system/script.js'; import './types/device.js'; import './types/location.js'; /** * Default preferences for all mocks */ declare const DEFAULT_PREFERENCES: GlobalPreferences; /** * Preferences manager for Scriptable testing * Handles: * 1. Loading/saving preferences * 2. Merging updates * 3. Resetting to defaults * 4. Synchronizing with mocks */ declare class Preferences { private static instance; private current; private constructor(); static getInstance(): Preferences; /** * Get current preferences */ get(): GlobalPreferences; /** * Update preferences * @param preferences Partial preferences to merge */ update(preferences: Partial<GlobalPreferences>): void; /** * Reset preferences to defaults */ reset(): void; /** * Load preferences from JSON string */ loadFromJSON(json: string): void; /** * Save preferences to JSON string */ saveToJSON(): string; /** * Get preferences for specific mock */ getMock<K extends keyof GlobalPreferences>(mockName: K): GlobalPreferences[K]; /** * Update preferences for specific mock */ updateMock<K extends keyof GlobalPreferences>(mockName: K, preferences: Partial<GlobalPreferences[K]>): void; /** * Synchronize current preferences with all mocks */ private syncMocks; /** * Deep merge preferences */ private merge; } export { DEFAULT_PREFERENCES, Preferences };