Interface ThemeModeContext

Theme mode control interface exposed to the renderer process. Provides methods to query and control the application's theme mode.

interface ThemeModeContext {
/**
* Toggles between light and dark theme modes.
* @returns Promise resolving to the new theme mode preference.
* @source
*/
toggle: () => Promise<boolean>;

/**
* Sets the theme to dark mode.
* @source
*/
dark: () => Promise<void>;

/**
* Sets the theme to light mode.
* @source
*/
light: () => Promise<void>;

/**
* Sets the theme to system preference (respects OS theme).
* @returns Promise resolving to whether system preference was applied.
* @source
*/
system: () => Promise<boolean>;

/**
* Retrieves the current theme mode setting.
* @returns Promise resolving to the current mode: "dark", "light", or "system".
* @source
*/
current: () => Promise<"dark" | "light" | "system">;
}
interface ThemeModeContext {
    toggle: () => Promise<boolean>;
    dark: () => Promise<void>;
    light: () => Promise<void>;
    system: () => Promise<boolean>;
    current: () => Promise<"dark" | "light" | "system">;
}

Properties

toggle: () => Promise<boolean>

Toggles between light and dark theme modes.

Type declaration

    • (): Promise<boolean>
    • Returns Promise<boolean>

      Promise resolving to the new theme mode preference.

  toggle: () => Promise<boolean>;
dark: () => Promise<void>

Sets the theme to dark mode.

  dark: () => Promise<void>;
light: () => Promise<void>

Sets the theme to light mode.

  light: () => Promise<void>;
system: () => Promise<boolean>

Sets the theme to system preference (respects OS theme).

Type declaration

    • (): Promise<boolean>
    • Returns Promise<boolean>

      Promise resolving to whether system preference was applied.

  system: () => Promise<boolean>;
current: () => Promise<"dark" | "light" | "system">

Retrieves the current theme mode setting.

Type declaration

    • (): Promise<"dark" | "light" | "system">
    • Returns Promise<"dark" | "light" | "system">

      Promise resolving to the current mode: "dark", "light", or "system".

  current: () => Promise<"dark" | "light" | "system">;