-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(bindgen): check for corresponding .zig file #15896
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
// This is the public API for `bind.ts` files | ||
// It is aliased as `import {} from 'bindgen'` | ||
/** | ||
* This is the public API for `bind.ts` files | ||
* It is aliased as `import {} from 'bindgen'` | ||
* @see https://bun.sh/docs/project/bindgen | ||
*/ | ||
|
||
import { | ||
isType, | ||
dictionaryImpl, | ||
|
@@ -196,6 +200,23 @@ export namespace t { | |
export const ByteString = builtinType<string>()("ByteString"); | ||
/** | ||
* DOMString but encoded as `[]const u8` | ||
* | ||
* @example | ||
* ```ts | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think simple examples like these aren't worth their line count, especially when my laptop screen can only fit 70 lines of code at once. this is why i try to write extremely concise comments. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah the hover doesn't appear in screenshots :( |
||
* // foo.bind.ts | ||
* import { fn, t } from "bindgen"; | ||
* | ||
* export const foo = fn({ | ||
* args: { bar: t.UTF8String }, | ||
* }) | ||
* ``` | ||
* | ||
* ```zig | ||
* // foo.zig | ||
* pub fn foo(bar: []const u8) void { | ||
* // ... | ||
* } | ||
* ``` | ||
*/ | ||
export const UTF8String = builtinType<string>()("UTF8String"); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does jsdoc make this a comment for the file or the next declared symbol (Type)? i could be totally wrong and this form is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for
//
? no. It should make one for/** */
but I'm not seeing it. Maybe there's a problem with the tsconfig?