22 lines
729 B
TypeScript
22 lines
729 B
TypeScript
import type { LoadURLOptions, WebContents } from 'electron';
|
|
import type { AppWindowInterface } from './app-window-interface';
|
|
|
|
interface UrlAppWindowInterface extends AppWindowInterface {
|
|
downloadUrlSafe(url: string, savePath: string, options?: LoadURLOptions): Promise<void>;
|
|
|
|
/**
|
|
* safely loads a url, reloading on fail
|
|
*
|
|
* this functions also waits if the server returns 429
|
|
*
|
|
* @param url - the url to load
|
|
* @param readyCheck - a function to check if the site is ready to be consumed
|
|
* @param options - load url options to forward to electron
|
|
*/
|
|
loadUrlSafe(
|
|
url: string,
|
|
readyCheck?: (webContents: WebContents) => Promise<boolean>,
|
|
options?: LoadURLOptions,
|
|
): Promise<void>;
|
|
}
|