UNPKG

scriptable-testlab

Version:

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

61 lines (58 loc) 1.83 kB
import { Preferences } from './preferences.mjs'; import { RuntimeConfig, RuntimePresets } from './types/runtime.mjs'; import './mocks/system/args.mjs'; import 'scriptable-abstract'; import './mocks/system/config.mjs'; import './types/scriptable.mjs'; import './mocks/system/location.mjs'; import './mocks/system/script.mjs'; import './types/device.mjs'; import './types/location.mjs'; /** * Main entry point for Scriptable testing * Provides: * 1. Global mock management * 2. Preferences management * 3. Test utilities * 4. Assertions */ declare class ScriptableRuntime { private static instance; private static isInitialized; private static isTestRunning; readonly preferences: Preferences; private constructor(); /** * Get the singleton instance of ScriptableRuntime */ static getInstance(): ScriptableRuntime; /** * Configure runtime with preset or custom configuration * @param config Runtime configuration or preset name */ configure(config: RuntimeConfig | keyof typeof RuntimePresets): void; /** * Apply configuration to runtime * @param config Runtime configuration */ private applyConfig; /** * Initialize the runtime and setup mocks * @throws Error if called while a test is running */ setupMocks(): void; /** * Clear all mocks and reset the runtime state * @throws Error if called while no test is running */ clearMocks(): void; private assertTestNotRunning; get isDarkMode(): boolean; set isDarkMode(value: boolean); get widgetFamily(): string; set widgetFamily(value: string); get alertResponse(): number | undefined; set alertResponse(value: number | undefined); } declare const runtime: ScriptableRuntime; export { ScriptableRuntime, runtime };