wvbe / docxml

TypeScript (component) library for building and parsing a DOCX file

Home Page:https://wvbe.github.io/docxml/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix the typings in your package

bmarotta-ease opened this issue · comments

When importing docxml on typescript, one gets the error:

src/index.ts:1:41 - error TS7016: Could not find a declaration file for module 'docxml'. 'C:/dev/office/test-docx-library/node_modules/docxml/script/mod.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/docxml` if it exists or add a new declaration (.d.ts) file containing `declare module 'docxml';`

It seems that in the published package.json, the typings property is pointing to an inexistent or not published file:

(...)
  "type": "module",
  "typings": "esm/mod.d.ts",
  "exports": {
    ".": {
      "import": "./esm/mod.js",
      "require": "./script/mod.js",
      "types": "./types/mod.d.ts"
    }
  },
(...)

I assume that typings should point to "types/mod.d.ts"

commented

Hey @bmarotta-ease, thanks for pointing this out! I believe you're 100% correct, I tried it out in a create-react-app repo (the quickest way I could think of making a working TS config in Node) and your change suggestion seems to work.

I've released the fixed version to npm as @5.3.9 :) Please post back if you are still experiencing problems with this!

All the best,
Wybe