Pārlūkot izejas kodu

fix(api): add type definitions to package.json exports (#9486)

André Kohn 1 gadu atpakaļ
vecāks
revīzija
be7eab209c
2 mainītis faili ar 10 papildinājumiem un 2 dzēšanām
  1. 5 0
      .changes/api-type-definitions.md
  2. 5 2
      tooling/api/package.json

+ 5 - 0
.changes/api-type-definitions.md

@@ -0,0 +1,5 @@
+---
+"@tauri-apps/api": patch:bug
+---
+
+Set the `exports > types` package.json field.

+ 5 - 2
tooling/api/package.json

@@ -21,14 +21,17 @@
   "type": "module",
   "main": "./index.cjs",
   "module": "./index.js",
+  "types": "./index.d.ts",
   "exports": {
     ".": {
       "import": "./index.js",
-      "require": "./index.cjs"
+      "require": "./index.cjs",
+      "types": "./index.d.ts"
     },
     "./*": {
       "import": "./*.js",
-      "require": "./*.cjs"
+      "require": "./*.cjs",
+      "types": "./*.d.ts"
     },
     "./package.json": "./package.json"
   },