rikukissa / typehole

TypeScript development tool for Visual Studio Code that helps you automate creating the initial static typing for runtime values

Home Page:https://marketplace.visualstudio.com/items?itemName=rikurouvila.typehole

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use type assertion when no variable binding is around

rikukissa opened this issue · comments

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;