scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
53 lines (50 loc) • 1.17 kB
TypeScript
import { AbsURLScheme } from 'scriptable-abstract';
interface URLSchemeState {
schemes: Set<string>;
lastOpenedURL: string | null;
}
/**
* Mock implementation of Scriptable's URLScheme global variable
* @implements URLScheme
*/
declare class MockURLScheme extends AbsURLScheme<URLSchemeState> {
static get instance(): MockURLScheme;
constructor();
/**
* @inheritdoc
*/
open(urlScheme: string): Promise<void>;
/**
* @inheritdoc
*/
fromURLString(urlString: string): Promise<string>;
/**
* @inheritdoc
*/
forActionExtension(): Promise<string>;
/**
* @inheritdoc
*/
forNotification(): Promise<string>;
/**
* @additional
* Register a URL scheme for testing
*/
registerScheme(scheme: string): void;
/**
* @additional
* Check if a URL scheme is registered
*/
isRegistered(scheme: string): boolean;
/**
* @additional
* Get the last opened URL
*/
getLastOpenedURL(): string | null;
/**
* @additional
* Clear all registered schemes and last opened URL
*/
clear(): void;
}
export { MockURLScheme };