Skip to main content
Module

x/carol/types.ts>Application

A Deno port of carlo
Latest
interface Application
import { type Application } from "https://deno.land/x/carol@v1.1.4/types.ts";

Methods

exit(): Promise<void>

Close the app windows.

onExit(): Promise<void>

Returns the promise that will be resolved when the app is closed.

mainWindow(): Window
createWindow(): Promise<Window>

Creates a new window.

windows(): Window[]

Returns all currently opened windows.

exposeFunction(name: string, func: Function): Promise<unknown[]>

Adds a function called name to the page's window object.

evaluate(pageFunction: Function | string, ...args: unknown[]): Promise<any>

This is equivalent to app.mainWindow().evaluate().

serveFolder(folder?: string, prefix?: string): void

Serves pages from the given folder.

serveOrigin(base: string, prefix?: string): void

Serves pages from given origin, eg http://localhost:8080. This can be used for the fast development mode available in web frameworks.

serveHandler(handler: HttpHandler): void

Calls given handler for each request and allows called to handle it.

load(uri?: string, ...params: unknown[]): Promise<unknown>

This is equivalent to app.mainWindow().load().

setIcon(icon: string | Uint8Array): Promise<void>

Set the application icon shown in the OS dock / task swicher.