aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ashcon Partovi <ashcon@partovi.net> 2023-09-06 10:03:12 -0700
committerGravatar Ashcon Partovi <ashcon@partovi.net> 2023-09-06 10:03:12 -0700
commit849a2cdfae65af7d0388fd41d90dc6309ca8b22a (patch)
treed7ba531efe673b65ec64f0950586b4dc7e2bd363
parent77f1f2480db4f1bd4bccff58fc7a663e8c0fe2b8 (diff)
downloadbun-849a2cdfae65af7d0388fd41d90dc6309ca8b22a.tar.gz
bun-849a2cdfae65af7d0388fd41d90dc6309ca8b22a.tar.zst
bun-849a2cdfae65af7d0388fd41d90dc6309ca8b22a.zip
Add bun-types to 'bun fmt' script
-rw-r--r--package.json2
-rw-r--r--packages/bun-types/bun-test.d.ts2
-rw-r--r--packages/bun-types/ffi.d.ts36
3 files changed, 21 insertions, 19 deletions
diff --git a/package.json b/package.json
index ca8feec10..45c27a719 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
"build-fallback": "esbuild --target=esnext --bundle src/fallback.ts --format=iife --platform=browser --minify > src/fallback.out.js",
"postinstall": "bash .scripts/postinstall.sh",
"typecheck": "tsc --noEmit && cd test && bun run typecheck",
- "fmt": "prettier --write --cache './{src,test,bench,packages/{bun-inspector-*,bun-vscode,bun-debug-adapter-protocol}}/**/*.{mjs,ts,tsx,js,jsx}'",
+ "fmt": "prettier --write --cache './{src,test,bench,packages/{bun-types,bun-inspector-*,bun-vscode,bun-debug-adapter-protocol}}/**/*.{mjs,ts,tsx,js,jsx}'",
"lint": "eslint './**/*.d.ts' --cache",
"lint:fix": "eslint './**/*.d.ts' --cache --fix"
},
diff --git a/packages/bun-types/bun-test.d.ts b/packages/bun-types/bun-test.d.ts
index 790d8bfea..03a067dc2 100644
--- a/packages/bun-types/bun-test.d.ts
+++ b/packages/bun-types/bun-test.d.ts
@@ -1034,7 +1034,7 @@ declare module "bun:test" {
* expect("bar").not.toSatisfy((val) => val === "bun");
* @link https://vitest.dev/api/expect.html#tosatisfy
* @link https://jest-extended.jestcommunity.dev/docs/matchers/toSatisfy
- */
+ */
toSatisfy(predicate: (value: T) => boolean): void;
/**
* Asserts that a value starts with a `string`.
diff --git a/packages/bun-types/ffi.d.ts b/packages/bun-types/ffi.d.ts
index 4d5f8d983..1207f74c4 100644
--- a/packages/bun-types/ffi.d.ts
+++ b/packages/bun-types/ffi.d.ts
@@ -447,9 +447,7 @@ declare module "bun:ffi" {
["callback"]: FFIType.pointer; // for now
}
- export type FFITypeOrString =
- | FFIType
- | keyof FFITypeStringToType;
+ export type FFITypeOrString = FFIType | keyof FFITypeStringToType;
interface FFIFunction {
/**
@@ -549,7 +547,9 @@ declare module "bun:ffi" {
// */
// export function callback(ffi: FFIFunction, cb: Function): number;
- export interface Library<Fns extends Readonly<Record<string, Narrow<FFIFunction>>>> {
+ export interface Library<
+ Fns extends Readonly<Record<string, Narrow<FFIFunction>>>,
+ > {
symbols: ConvertFns<Fns>;
/**
@@ -584,7 +584,9 @@ declare module "bun:ffi" {
[K in keyof Fns]: (
...args: Fns[K]["args"] extends infer A extends readonly FFITypeOrString[]
? { [L in keyof A]: FFITypeToArgsType[ToFFIType<A[L]>] }
- : [unknown] extends [Fns[K]["args"]] ? [] : never
+ : [unknown] extends [Fns[K]["args"]]
+ ? []
+ : never
) => [unknown] extends [Fns[K]["returns"]]
? void
: FFITypeToReturnsType[ToFFIType<NonNullable<Fns[K]["returns"]>>];
@@ -759,7 +761,7 @@ declare module "bun:ffi" {
/**
* The read function behaves similarly to DataView,
* but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.
- *
+ *
* @param ptr The memory address to read
* @param byteOffset bytes to skip before reading
*
@@ -772,7 +774,7 @@ declare module "bun:ffi" {
/**
* The read function behaves similarly to DataView,
* but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.
- *
+ *
* @param ptr The memory address to read
* @param byteOffset bytes to skip before reading
*
@@ -785,7 +787,7 @@ declare module "bun:ffi" {
/**
* The read function behaves similarly to DataView,
* but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.
- *
+ *
* @param ptr The memory address to read
* @param byteOffset bytes to skip before reading
*
@@ -798,7 +800,7 @@ declare module "bun:ffi" {
/**
* The read function behaves similarly to DataView,
* but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.
- *
+ *
* @param ptr The memory address to read
* @param byteOffset bytes to skip before reading
*
@@ -811,7 +813,7 @@ declare module "bun:ffi" {
/**
* The read function behaves similarly to DataView,
* but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.
- *
+ *
* @param ptr The memory address to read
* @param byteOffset bytes to skip before reading
*
@@ -824,7 +826,7 @@ declare module "bun:ffi" {
/**
* The read function behaves similarly to DataView,
* but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.
- *
+ *
* @param ptr The memory address to read
* @param byteOffset bytes to skip before reading
*
@@ -837,7 +839,7 @@ declare module "bun:ffi" {
/**
* The read function behaves similarly to DataView,
* but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.
- *
+ *
* @param ptr The memory address to read
* @param byteOffset bytes to skip before reading
*
@@ -850,7 +852,7 @@ declare module "bun:ffi" {
/**
* The read function behaves similarly to DataView,
* but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.
- *
+ *
* @param ptr The memory address to read
* @param byteOffset bytes to skip before reading
*
@@ -863,7 +865,7 @@ declare module "bun:ffi" {
/**
* The read function behaves similarly to DataView,
* but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.
- *
+ *
* @param ptr The memory address to read
* @param byteOffset bytes to skip before reading
*
@@ -876,7 +878,7 @@ declare module "bun:ffi" {
/**
* The read function behaves similarly to DataView,
* but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.
- *
+ *
* @param ptr The memory address to read
* @param byteOffset bytes to skip before reading
*
@@ -889,7 +891,7 @@ declare module "bun:ffi" {
/**
* The read function behaves similarly to DataView,
* but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.
- *
+ *
* @param ptr The memory address to read
* @param byteOffset bytes to skip before reading
*
@@ -902,7 +904,7 @@ declare module "bun:ffi" {
/**
* The read function behaves similarly to DataView,
* but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.
- *
+ *
* @param ptr The memory address to read
* @param byteOffset bytes to skip before reading
*