From c0f9cfa1de17e4d8ac28acc3801125e78ddb869b Mon Sep 17 00:00:00 2001 From: ivk Date: Thu, 24 Apr 2025 13:41:31 +0200 Subject: [PATCH] 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. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 460e6fd..57fb00e 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "main": "dist/index.cjs", "module": "dist/index.mjs", "exports": { + "types": "./dist/lib/index.d.ts", "import": "./dist/index.mjs", "require": "./dist/index.cjs" },