Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Interface definition for deno serve default export #23725

Closed
dojyorin opened this issue May 7, 2024 · 1 comment · Fixed by #24879
Closed

Interface definition for deno serve default export #23725

dojyorin opened this issue May 7, 2024 · 1 comment · Fixed by #24879
Labels
serve suggestion suggestions for new features (yet to be agreed) types Issues related to TypeScript types

Comments

@dojyorin
Copy link

dojyorin commented May 7, 2024

Is there a interface definition for default export object?
I'm currently using workaround like this, but is there a better way?

export default <{fetch: Deno.ServeHandler}>{
    fetch(request){
        return new Response("Hello!");
    }
};

For example like this...

// lib.deno.ns.d.ts
export interface ServeDefaultExport {
    fetch: Deno.ServeHandler;
}

// my project
export default <Deno.ServeDefaultExport>{
    fetch(request){
        return new Response("Hello!");
    }
};
@marvinhagemeister marvinhagemeister added suggestion suggestions for new features (yet to be agreed) types Issues related to TypeScript types labels May 8, 2024
@dojyorin
Copy link
Author

Thank you for implementation! 😊

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
serve suggestion suggestions for new features (yet to be agreed) types Issues related to TypeScript types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants