FjordWarden
FjordWarden16mo ago

Can't import typescript module

Why can I only import the js file and not the ts file?
import * as zip from "https://deno.land/x/zipjs@v2.7.29/index.js"
import * as zipjs from "https://deno.land/x/zipjs@v2.7.29/index.d.ts";

zipjs.Writer //undefined
zip.ZipWriter //[class ZipWriter]
import * as zip from "https://deno.land/x/zipjs@v2.7.29/index.js"
import * as zipjs from "https://deno.land/x/zipjs@v2.7.29/index.d.ts";

zipjs.Writer //undefined
zip.ZipWriter //[class ZipWriter]
1 Reply
javi
javi16mo ago
you can’t import a d.ts file, that’s only type definitions you can however use the js version and add @deno-types="…" above the import to have typescript support

Did you find this page helpful?