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

Use type assertion when no variable binding is around #4

Open
rikukissa opened this issue May 12, 2021 · 0 comments
Open

Use type assertion when no variable binding is around #4

rikukissa opened this issue May 12, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@rikukissa
Copy link
Owner

So instead of using a generic type variable in the typehole, the plugin could add

import App from "./App.svelte";
import typehole from "typehole";

type AutoDiscovered = any;

const app = new App({
  target: typehole.t<AutoDiscovered>(document.getElementById("app")),
});

export default app;
import App from "./App.svelte";
import typehole from "typehole";

type AutoDiscovered = any;

const app = new App({
  target: typehole.t(document.getElementById("app") as AutoDiscovered),
});

export default app;
@rikukissa rikukissa added the enhancement New feature or request label May 12, 2021
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

No branches or pull requests

1 participant