Skip to content

lightgun-poc / lib/native / Ffi

Interface: Ffi

Defined in: lib/native.ts:152

The slice of koffi this project calls (see lib/hotkey, lib/monitors).

Methods

load()

load(path): FfiLib

Defined in: lib/native.ts:153

Parameters

path

string

Returns

FfiLib


struct()?

optional struct(name, def): unknown

Defined in: lib/native.ts:163

Registers a named struct type (koffi.struct) so func specs can RETURN it by value — CoreGraphics' CGDisplayBounds hands back a CGRect that way, which the string-only func surface cannot express alone. Optional so every existing fake stays valid; a runtime without it degrades with a reason (see lib/monitors.detectDarwin). The interface deliberately still has NO callbacks — that constraint is untouched (see the EnumDisplayMonitors decision in CLAUDE.md).

Parameters

name

string

def

Record<string, unknown>

Returns

unknown

Released under the MIT License.