Quark #

Modules #

Quark v1.4.0 Documentation

Contents

quark/app #

AEvent #

type AEvent = Event<Application>

Interface: Clipboard #

Clipboard #

System clipboard interface. Provides access to the OS clipboard for plain text operations. This object is owned by {@link NativeApplication} and cannot be constructed directly. Notes:

  • Text is shared with other applications through the system clipboard.
  • Operations are safe to call at any time after the application is initialized.
  • Only plain text is supported for now.

clipboard.getText() #

Read text from the system clipboard. Returns an empty string if no text is available.

getText(): string

clipboard.setText(text) #

Write plain text to the system clipboard. Replaces existing clipboard contents.

setText(text: string): void

clipboard.hasText() #

Returns true if the clipboard currently contains text data.

hasText(): boolean

clipboard.clear() #

Clears current clipboard contents.

clear(): void

Class: NativeApplication #

NativeApplication #

Global application object. Represents the running Qk runtime instance and provides access to system-level services, global resources and window management. This object is created by the native runtime and cannot be constructed manually. It becomes fully available after the onLoad event.

Extends: Notification<AEvent>

nativeapplication.isLoaded #

Indicates whether the application has finished initialization. Becomes true after the onLoad lifecycle event.

readonly isLoaded: boolean

nativeapplication.screen #

Screen information and metrics provider. Exposes display size, scale, and other screen-related properties.

readonly screen: Screen

nativeapplication.fontPool #

Global font pool. Used for font loading, caching, and reuse across all windows.

readonly fontPool: FontPool

nativeapplication.activeWindow #

Currently active (focused) window. Returns null if no window is focused.

readonly activeWindow: Window | null

nativeapplication.clipboard #

System clipboard instance. Provides access to the shared OS clipboard for plain text operations. The instance is owned and managed by the application lifecycle and is available once the application has initialized.

readonly clipboard: Clipboard

nativeapplication.defaultTextOptions #

Global default text rendering options. Shared by all windows and used as the base configuration when creating text views without explicit text settings.

readonly defaultTextOptions: TextOptions

nativeapplication.windows #

List of all currently existing windows. Includes visible and hidden windows managed by the application.

readonly windows: Window[]

nativeapplication.maxResourceMemoryLimit #

Maximum memory limit for resource caching (in bytes). Affects textures, images, fonts and other GPU/CPU resources.

maxResourceMemoryLimit: number

nativeapplication.usedResourceMemory() #

Returns the current amount of memory used by cached resources.

usedResourceMemory(): number

nativeapplication.clear(all?) #

Clear cached resources.

clear(all: any, all?: boolean): void

Parameters:

  • all — If true, aggressively clears all releasable resources.

nativeapplication.openURL(url) #

Open a URI using the system handler. Examples:

  • openURL('https://example.com')
  • openURL('mailto:test@example.com')
    openURL(url: string): void

nativeapplication.sendEmail(recipient,subject,body?,cc?,bcc?) #

Open the system email client with pre-filled fields.

sendEmail(recipient: string, subject: string, body: any, cc: any, bcc: any, body?: string, cc?: string, bcc?: string): void

Parameters:

  • recipient — Target email address.
  • subject — Email subject.
  • body — Optional message body.
  • cc — Optional CC address.
  • bcc — Optional BCC address.

Class: Application #

Application #

Extends: NativeApplication

application.onLoad #

Fired once after the application has completed initialization. Safe point to create windows, load resources and start logic.

application.onUnload #

Fired before the application is about to terminate. Use for saving state, releasing external handles, etc.

application.onPause #

Fired when the application enters background state. Typically triggered by OS task switching or minimization.

application.onResume #

Fired when the application returns to foreground state. Suitable for restoring rendering, timers and IO tasks.

application.onMemoryWarning #

Fired when the system reports memory pressure. After this event, the runtime will automatically:

  • call clear() to release cached resources
  • trigger JS garbage collection Applications can additionally release non-critical data here.

default #

default.current #

Current active application singleton

readonly current: Application