mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 21:32:05 +00:00
21 lines
348 B
TypeScript
21 lines
348 B
TypeScript
import { fn, t } from "bindgen";
|
|
|
|
export const add = fn({
|
|
args: {
|
|
global: t.globalObject,
|
|
a: t.i32,
|
|
b: t.i32.default(-1),
|
|
},
|
|
ret: t.i32,
|
|
});
|
|
|
|
export const requiredAndOptionalArg = fn({
|
|
args: {
|
|
a: t.boolean,
|
|
b: t.usize.optional,
|
|
c: t.i32.enforceRange(0, 100).default(42),
|
|
d: t.u8.optional,
|
|
},
|
|
ret: t.i32,
|
|
});
|