scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
44 lines (41 loc) • 1.02 kB
TypeScript
import { AbsSafari } from 'scriptable-abstract';
type OpenMethod = 'browser' | 'app';
interface SafariState {
currentURL: string | null;
inBackground: boolean;
openMethod: OpenMethod | null;
fullscreen: boolean;
}
/**
* Mock implementation of Scriptable's Safari global variable.
* Provides functionality for opening URLs.
*
* @example
* ```typescript
* // Open a URL in Safari
* Safari.open('https://example.com');
*
* // Open a URL in Safari app
* await Safari.openInApp('https://example.com');
* ```
*
* @implements Safari
*/
declare class MockSafari extends AbsSafari<SafariState> {
private static readonly VALID_SCHEMES;
static get instance(): MockSafari;
constructor();
/**
* Validates if the given URL is valid and has an acceptable scheme
*/
private validateURL;
/**
* @inheritdoc
*/
open(url: string): void;
/**
* @inheritdoc
*/
openInApp(url: string, fullscreen?: boolean): Promise<void>;
}
export { MockSafari };