bun-types 1.1.43-canary.20250108T140520 → 1.1.43-canary.20250109T140709

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bun.d.ts CHANGED
@@ -1057,6 +1057,10 @@ declare module "bun" {
1057
1057
  errors: number;
1058
1058
  totalCount: number;
1059
1059
  };
1060
+
1061
+ ADDRCONFIG: number;
1062
+ ALL: number;
1063
+ V4MAPPED: number;
1060
1064
  };
1061
1065
 
1062
1066
  interface DNSLookup {
package/docs/api/ffi.md CHANGED
@@ -297,6 +297,20 @@ setTimeout(() => {
297
297
 
298
298
  When you're done with a JSCallback, you should call `close()` to free the memory.
299
299
 
300
+ ### Experimental thread-safe callbacks
301
+ `JSCallback` has experimental support for thread-safe callbacks. This will be needed if you pass a callback function into a different thread from it's instantiation context. You can enable it with the optional `threadsafe` option flag.
302
+ ```ts
303
+ const searchIterator = new JSCallback(
304
+ (ptr, length) => /hello/.test(new CString(ptr, length)),
305
+ {
306
+ returns: "bool",
307
+ args: ["ptr", "usize"],
308
+ threadsafe: true, // Optional. Defaults to `false`
309
+ },
310
+ );
311
+ ```
312
+ Be aware that there are still cases where this does not 100% work.
313
+
300
314
  {% callout %}
301
315
 
302
316
  **⚡️ Performance tip** — For a slight performance boost, directly pass `JSCallback.prototype.ptr` instead of the `JSCallback` object:
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.43-canary.20250108T140520",
2
+ "version": "1.1.43-canary.20250109T140709",
3
3
  "name": "bun-types",
4
4
  "license": "MIT",
5
5
  "main": "",