Skip to content
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

Specify TypeScript type for .d.ts #1

Merged
merged 1 commit into from
Aug 8, 2020

Conversation

nwtgck
Copy link
Contributor

@nwtgck nwtgck commented Aug 8, 2020

Hi, thank you so much for your great work!

Before PR

Before this pull request, types in auto-generated .d.ts are all any as follows.

/**
* @param {number} num
* @returns {any}
*/
export function myfunc1(num: number): any;
/**
* @param {number} num
* @returns {any}
*/
export function myfunc2(num: number): any;
/**
* @param {number} num
* @returns {any}
*/
export function myfunc3(num: number): any;

After PR

After this pull request, types in .d.ts has more proper types than any.

/**
* @param {number} num
* @returns {ReadableStream}
*/
export function myfunc1(num: number): ReadableStream;
/**
* @param {number} num
* @returns {WritableStream}
*/
export function myfunc2(num: number): WritableStream;
/**
* @param {number} num
* @returns {TransformStream}
*/
export function myfunc3(num: number): TransformStream;

Rust

Here is the source.

#[wasm_bindgen]
pub fn myfunc1(num: i32) -> wasm_streams::readable::sys::ReadableStream {
    unimplemented!()
}

#[wasm_bindgen]
pub fn myfunc2(num: i32) -> wasm_streams::writable::sys::WritableStream {
    unimplemented!()
}

#[wasm_bindgen]
pub fn myfunc3(num: i32) -> wasm_streams::transform::sys::TransformStream {
    unimplemented!()
}

CI status

Here is CI status in my forked repo.
https://github.com/nwtgck/wasm-streams/actions/runs/200276672

@MattiasBuelens MattiasBuelens added the enhancement New feature or request label Aug 8, 2020
@MattiasBuelens
Copy link
Owner

Oh woops, the CI wasn't set up to run on pull requests yet. Thanks for running the CI on your repo! 😅

Changes look good, thanks for your contribution! 👍

@MattiasBuelens MattiasBuelens merged commit dd92153 into MattiasBuelens:master Aug 8, 2020
@nwtgck nwtgck deleted the typescript-type branch August 8, 2020 10:36
@MattiasBuelens
Copy link
Owner

I'll make a 0.1.1 release later today. 🙂

@MattiasBuelens MattiasBuelens added this to the v0.1.1 milestone Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants