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

Interface definition for deno serve default export #23725

Open
dojyorin opened this issue May 7, 2024 · 0 comments
Open

Interface definition for deno serve default export #23725

dojyorin opened this issue May 7, 2024 · 0 comments
Labels
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion suggestions for new features (yet to be agreed) types Issues related to TypeScript types
Projects
None yet
Development

No branches or pull requests

2 participants