Skip to content

Commit 3e48f1f

Browse files
committed
adds types to package.json
1 parent 87123c7 commit 3e48f1f

File tree

3 files changed

+6
-27
lines changed

3 files changed

+6
-27
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@
8686
"lib/p5.min.js",
8787
"lib/p5.js",
8888
"lib/p5.esm.js",
89-
"translations/**"
89+
"translations/**",
90+
"types/**"
9091
],
9192
"description": "[![npm version](https://badge.fury.io/js/p5.svg)](https://www.npmjs.com/package/p5)",
9293
"bugs": {
@@ -105,5 +106,6 @@
105106
"workerDirectory": [
106107
"test"
107108
]
108-
}
109+
},
110+
"types": "./types/p5.d.ts"
109111
}

tsconfig.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

utils/generate-types.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,8 @@ function generateCoreTypeDefinitions(organizedData) {
563563
// Generate p5.d.ts
564564
let p5Output = '// This file is auto-generated from JSDoc documentation\n\n';
565565

566-
// Add reference paths to other .d.ts files
566+
// Add reference to .d.ts files
567+
p5Output += '/// <reference types="./global.d.ts" />\n';
567568
const typeFiles = findTypeDefinitionFiles(process.cwd(), p5DtsPath);
568569
typeFiles.forEach(file => {
569570
p5Output += `/// <reference types="${file}" />\n`;

0 commit comments

Comments
 (0)