UNPKG

scriptable-testlab

Version:

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

37 lines (34 loc) 1.33 kB
import { AbsWebView } from 'scriptable-abstract'; interface WebViewState { url?: string; html?: string; baseURL?: string; shouldAllowRequest: (request: Request) => boolean; } declare class MockWebView extends AbsWebView<WebViewState> { constructor(); /** * Loads HTML and renders it. */ static loadHTML(html: string, baseURL?: string, _preferredSize?: Size, fullscreen?: boolean): Promise<void>; /** * Loads a file and renders it. */ static loadFile(fileURL: string, _preferredSize?: Size, fullscreen?: boolean): Promise<void>; /** * Loads URL in web view and presents the web view. */ static loadURL(url: string, _preferredSize?: Size, fullscreen?: boolean): Promise<void>; get shouldAllowRequest(): (request: Request) => boolean; set shouldAllowRequest(value: (request: Request) => boolean); loadURL(url: string): Promise<void>; loadHTML(html: string, baseURL?: string): Promise<void>; loadRequest(request: Request): Promise<void>; loadFile(path: string): Promise<void>; evaluateJavaScript(_javaScript: string, _useCallback?: boolean): Promise<any>; getHTML(): Promise<string>; getURL(): Promise<string>; present(_fullscreen?: boolean): Promise<void>; waitForLoad(): Promise<void>; } export { MockWebView };