Skip to main content

Crate laufey

Crate laufey 

Source

Macros§

main

Structs§

CloseRequestedEvent
CursorEnterLeaveEvent
FocusedEvent
JsCall
KeyModifiers
KeyboardEvent
MouseClickEvent
MouseMoveEvent
MoveEvent
Notification
Builder for a system notification. Mirrors a subset of the Web Notifications API constructor options. Construct with Notification::new / Notification::builder, chain options, then Notification::show.
NotificationAction
An action button on a notification.
NotificationHandle
Handle to a shown notification. Use NotificationHandle::close to dismiss it programmatically. Dropping the handle does NOT close the notification — they’re fire-and-forget on the OS side.
ResizeEvent
TrayIcon
A persistent icon in the OS status area (macOS menu bar extras, Windows system tray, Linux AppIndicator). Multiple icons may be created.
WheelEvent
Window
WindowOptions
Creation-time window style options. Properties that must be decided when the OS window is constructed (frameless chrome, non-activating panel behavior). Post-creation properties (size, position, resizable, always-on-top) are set through their respective Window setters.

Enums§

DockBounceType
How urgently to request the user’s attention when calling bounce_dock.
KeyState
MenuItem
A menu item in an application menu template.
MouseButton
MouseButtonState
NotificationEvent
What happened to a notification.
PermissionKind
Capability for which authorization can be requested.
PermissionStatus
Result of request_permission / query_permission. Mirrors the Web Permissions API state set with an extra Unsupported variant for environments where the capability cannot be authorized at all (e.g. an unbundled macOS process, or a backend that has no concept of the kind on this platform).
Value
WheelDeltaMode

Constants§

LAUFEY_API_VERSION
LAUFEY_DIALOG_ALERT
LAUFEY_DIALOG_CONFIRM
LAUFEY_DIALOG_PROMPT
LAUFEY_KEY_PRESSED
LAUFEY_KEY_RELEASED
LAUFEY_MOD_ALT
LAUFEY_MOD_CONTROL
LAUFEY_MOD_META
LAUFEY_MOD_SHIFT
LAUFEY_MOUSE_BUTTON_BACK
LAUFEY_MOUSE_BUTTON_FORWARD
LAUFEY_MOUSE_BUTTON_LEFT
LAUFEY_MOUSE_BUTTON_MIDDLE
LAUFEY_MOUSE_BUTTON_RIGHT
LAUFEY_MOUSE_PRESSED
LAUFEY_MOUSE_RELEASED
LAUFEY_NOTIFICATION_ACTION
LAUFEY_NOTIFICATION_CLICKED
LAUFEY_NOTIFICATION_CLOSED
LAUFEY_NOTIFICATION_SHOWN
LAUFEY_PERMISSION_INVALID
LAUFEY_PERMISSION_NOTIFICATIONS
LAUFEY_PERMISSION_STATUS_DENIED
LAUFEY_PERMISSION_STATUS_GRANTED
LAUFEY_PERMISSION_STATUS_PROMPT
LAUFEY_PERMISSION_STATUS_UNSUPPORTED
LAUFEY_WHEEL_DELTA_LINE
LAUFEY_WHEEL_DELTA_PAGE
LAUFEY_WHEEL_DELTA_PIXEL
LAUFEY_WINDOW_FLAG_FRAMELESS
Creation-time window style flags for Window::new_with_options. Mirror the LAUFEY_WINDOW_FLAG_* constants in laufey.h.
LAUFEY_WINDOW_FLAG_NO_ACTIVATE
LAUFEY_WINDOW_FLAG_TRANSPARENT_TITLEBAR
LAUFEY_WINDOW_HANDLE_APPKIT
LAUFEY_WINDOW_HANDLE_UNKNOWN
LAUFEY_WINDOW_HANDLE_WAYLAND
LAUFEY_WINDOW_HANDLE_WIN32
LAUFEY_WINDOW_HANDLE_X11
VERSION
Version of this laufey crate. Used by downstream consumers (e.g. the Deno CLI) to locate matching prebuilt backend binaries in GitHub releases (github.com/denoland/laufey/releases/tag/v{VERSION}).

Functions§

alert
Show an alert dialog (app-wide, no parent window). Blocks until dismissed; the platform’s modal run loop pumps OS events while the dialog is up so other LAUFEY windows continue to render and respond.
bounce_dock
Bounce the dock icon (macOS), flash the focused window’s taskbar button (Windows), or set the urgency hint on the focused window (Linux).
clear_dock_menu
Remove the custom dock menu set by set_dock_menu (macOS only).
confirm
Show a confirm dialog (app-wide). Returns true if OK was pressed. Blocking semantics as alert.
init_api
Safety
on_close_requested
on_cursor_enter_leave
on_dock_reopen
Register a callback invoked when the user clicks the dock icon while the app has no visible windows (macOS only). The callback receives whether any windows are currently visible.
on_focused
on_keyboard_event
Register a handler for keyboard input events on a specific window.
on_mouse_click
on_mouse_move
on_move
on_resize
on_wheel
prompt
Show a prompt dialog (app-wide). Returns Some(text) if OK, None if cancelled. Blocking semantics as alert.
query_permission
Query the current authorization status of kind without prompting the user. The callback runs on the UI thread.
quit
request_permission
Request authorization for kind. If the current status is PermissionStatus::Prompt the OS displays a system prompt; otherwise the cached decision is returned without re-prompting (the OS does not show a second prompt once the user has decided). The callback runs on the UI thread.
run
Async event loop that dispatches JS calls as they arrive. Blocks until should_shutdown() returns true.
set_dock_badge
Set a short text badge on the app’s dock icon (macOS) or taskbar icon (Windows), or prefix the focused window’s title with "(text) " (Linux). Pass None or an empty string to clear the badge.
set_dock_menu
Set a custom right-click menu on the app’s dock icon (macOS only). on_click is called with the id of the clicked item. Windows and Linux: no-op.
set_dock_visible
Show or hide the app’s dock icon (macOS activation policy). Windows and Linux: no-op (no app-level equivalent).
set_js_namespace
Set the global JS namespace name for bindings (default: "Laufey"). Must be called before creating any windows.
should_shutdown
shutdown

Type Aliases§

LaufeyBackendApi
LaufeyValue