Open
Description
TypeScript Version: 3.5.0-dev.20190508
Search Terms: module add overload
Code
// nanohtml.d.ts
export default function<T extends HTMLElement = HTMLElement>(strings: TemplateStringsArray, ...keys: any[]): T;
// @ts-check
// index.js
// install [email protected]
const nanohtml = require("nanohtml");
/** @type {HTMLAnchorElement} */
const a = nanohtml`<a href="example.com">Example</a>`;
Expected behavior:
a
should be HTMLAnchorElement
.
Actual behavior:
Error: Type 'HTMLElement' is missing the following properties from type 'HTMLAnchorElement': ...