scarfS
Denoβ€’2y ago
scarf

type checking `.js` files using `d.ts` files

would it be possible to type check javascript files using d.ts files?
// add.js
/// <reference types="./add.d.ts" />
const add = (a) => a + 1

// add.d.ts
export declare const add: (a: number) => number

importing add from add.js from consumer will type check but
Was this page helpful?