aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-05-04 07:03:38 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-05-04 07:03:38 -0700
commitd29dcf36803bd645e7a225de2a73d93aba00a951 (patch)
tree2481f319f46d27c3449bc1331b1eb401fe2fef5b
parent164483c1373df5f1b253c9ce877aaf6e5c7f493b (diff)
downloadbun-d29dcf36803bd645e7a225de2a73d93aba00a951.tar.gz
bun-d29dcf36803bd645e7a225de2a73d93aba00a951.tar.zst
bun-d29dcf36803bd645e7a225de2a73d93aba00a951.zip
Document `FFIType.i64_fast`
Diffstat (limited to '')
-rw-r--r--packages/bun-types/types.d.ts28
1 files changed, 26 insertions, 2 deletions
diff --git a/packages/bun-types/types.d.ts b/packages/bun-types/types.d.ts
index 87db8a016..bcc0fd0d0 100644
--- a/packages/bun-types/types.d.ts
+++ b/packages/bun-types/types.d.ts
@@ -1365,6 +1365,30 @@ declare module "bun:ffi" {
*
*/
cstring = 14,
+
+ /**
+ * Attempt to coerce `BigInt` into a `Number` if it fits. This improves performance
+ * but means you might get a `BigInt` or you might get a `number`.
+ *
+ * In C, this always becomes `int64_t`
+ *
+ * In JavaScript, this could be number or it could be BigInt, depending on what
+ * value is passed in.
+ *
+ */
+ i64_fast = 15,
+
+ /**
+ * Attempt to coerce `BigInt` into a `Number` if it fits. This improves performance
+ * but means you might get a `BigInt` or you might get a `number`.
+ *
+ * In C, this always becomes `uint64_t`
+ *
+ * In JavaScript, this could be number or it could be BigInt, depending on what
+ * value is passed in.
+ *
+ */
+ u64_fast = 16,
}
export type FFITypeOrString =
| FFIType
@@ -1481,7 +1505,7 @@ declare module "bun:ffi" {
close(): void;
}
- export function dlopen(libraryName: string, symbols: Symbols): Library<T>;
+ export function dlopen(libraryName: string, symbols: Symbols): Library;
/**
* Read a pointer as a {@link Buffer}
@@ -1607,7 +1631,7 @@ declare module "bun:ffi" {
* reading beyond the bounds of the pointer will crash the program or cause
* undefined behavior. Use with care!
*/
- constructor(ptr: number, byteOffset?: number, byteLength?: number): string;
+ constructor(ptr: number, byteOffset?: number, byteLength?: number);
/**
* The ptr to the C string