npmパッケージにd.tsファイルがなかったため、自分で書こうと思いましたが、JavascriptからDefinition Typeへの書き換えがわかりませんでした
パッケージ: linguee
https://github.com/felipe-augusto/linguee
mainファイル (index.js)
Javascriptindex.js
1const loadedContainer = require('./config/loadedContainer'); 2 3const linguee = loadedContainer.get('linguee'); 4 5module.exports = { 6 translate: linguee.translate 7};
できたこと
- ディレクトリとファイルの置き場所がわかった:
/src/@types/linguee/index.d.ts
declare module 'linguee'{}
だけはわかった
わからないこと
- const lingueeの型
- module.exportsでは変数をexportしているのか関数をexportしているのか
- その他中身の書き方
あなたの回答
tips
プレビュー