@@ -27,18 +27,6 @@ const lib = dlopen("libm", {
2727lib .ceil (1.5 ); // 2
2828```
2929
30- Calling directly from a library
31-
32- ``` js
33- import { load , types } from " @xan105/ffi/[ napi | koffi ]" ;
34-
35- const call = load (" user32.dll" , { abi: " stdcall" });
36- const MessageBoxA = call (" MessageBoxA" , " int" , [" void *" , types .win32 .LPCSTR , types .win32 .LPCSTR , " uint" ]);
37-
38- const MB_ICONINFORMATION = 0x40 ;
39- MessageBoxA (null , " Hello World!" , " Message" , MB_ICONINFORMATION );
40- ```
41-
4230Async
4331
4432``` js
@@ -54,6 +42,18 @@ const lib = dlopen("libm", {
5442await lib .ceil (1.5 ); // 2
5543```
5644
45+ Calling directly from a library
46+
47+ ``` js
48+ import { load , types } from " @xan105/ffi/[ napi | koffi ]" ;
49+
50+ const call = load (" user32.dll" , { abi: " stdcall" });
51+ const MessageBoxA = call (" MessageBoxA" , " int" , [" void *" , types .win32 .LPCSTR , types .win32 .LPCSTR , " uint" ]);
52+
53+ const MB_ICONINFORMATION = 0x40 ;
54+ MessageBoxA (null , " Hello World!" , " Message" , MB_ICONINFORMATION );
55+ ```
56+
5757Callback with Deno like syntax
5858
5959``` js
@@ -171,8 +171,8 @@ If you ever use ffi-napi `ffi.Library()` this will be familiar.
171171``` ts
172172 {
173173 name : {
174- result ?: any ,
175- parameters ?: any [],
174+ result ?: unknown ,
175+ parameters ?: unknown [],
176176 nonblocking ?: boolean ,
177177 symbol ?: string | number
178178 },
@@ -247,10 +247,6 @@ const { i32 } = types;
247247
248248🚫 Forbidden
249249
250- ```
251- import { function } from "@xan105/ffi/napi/types"
252- ```
253-
254250```
255251import { types } from "@xan105/ffi/napi"
256252const { function } = types;
0 commit comments