Skip to main content

@gtkx/ffi

Functions

FunctionDescription
getCurrentAppGets the current GTK application instance.
startStarts the GTK application with the given application ID. Sets up a keep-alive timer to prevent Node.js from exiting. This function is idempotent - calling it multiple times returns the existing app.
stopStops the GTK application and cleans up the keep-alive timer. Emits the "stop" event before shutting down to allow cleanup. This function is idempotent - calling it when not started does nothing.
wrapPtrWraps a native pointer in a class instance without calling the constructor. Used when receiving pointers from FFI calls that need to be wrapped as TypeScript objects.

Variables

VariableDescription
createRef-
eventsEvent emitter for GTK lifecycle events. Emits "start" when GTK is initialized and "stop" before shutdown.

Classes

ClassDescription
NativeErrorError class that wraps a GLib GError. Extends the native JavaScript Error with GError-specific properties.