Skip to content

Commit c0f9cfa

Browse files
committed
Allow importing with exports-aware Typescript
Trying to import the library could run into the following issue: error TS7016: Could not find a declaration file for module '@signalapp/sqlcipher'. '.../node_modules/@signalapp/sqlcipher/dist/index.mjs' implicitly has an 'any' type. There are types at '.../node_modules/@signalapp/sqlcipher/dist/lib/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@signalapp/sqlcipher' library may need to update its package.json or typings. The issue comes from mismatch where index.mjs does not automatically map to index.d.ts (it would have to be index.d.mts). The solution is to add types to export. The other "type" key could be removed but is left in for now for compatibility with old tsc versions.
1 parent fefc9ef commit c0f9cfa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"main": "dist/index.cjs",
1717
"module": "dist/index.mjs",
1818
"exports": {
19+
"types": "./dist/lib/index.d.ts",
1920
"import": "./dist/index.mjs",
2021
"require": "./dist/index.cjs"
2122
},

0 commit comments

Comments
 (0)