jimmywarting / native-file-system-adapter

File system, based on the spec reference implementation

Home Page:https://jimmywarting.github.io/native-file-system-adapter/example/test.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

typescript error

iwansantoso opened this issue · comments

Hi.
I'm coding using TypeScript and install this library using npm. But I encounter following error on import { getOriginPrivateDirectory } from "native-file-system-adapter";

Could not find a declaration file for module 'native-file-system-adapter'. '{my project folder}/node_modules/native-file-system-adapter/src/es6.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/native-file-system-adapter` if it exists or add a new declaration (.d.ts) file containing `declare module 'native-file-system-adapter';`

I think ["types": "types"] in package.json should be modified to ["types": "./types/mod.d.ts"].

Hi. I'm coding using TypeScript and install this library using npm. But I encounter following error on import { getOriginPrivateDirectory } from "native-file-system-adapter";

Could not find a declaration file for module 'native-file-system-adapter'. '{my project folder}/node_modules/native-file-system-adapter/src/es6.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/native-file-system-adapter` if it exists or add a new declaration (.d.ts) file containing `declare module 'native-file-system-adapter';`

I think ["types": "types"] in package.json should be modified to ["types": "./types/mod.d.ts"].

This is correct. I ran into this trying to use this pkg with TS.

Had to go into node_modules/native-file-system-adapter/package.json and change types field to "types": "types/mod.d.ts" and then reload typescript in VSCode and I now have proper TS support