diff --git a/package-lock.json b/package-lock.json index 7c79cca..c24b47c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ ], "license": "MIT", "devDependencies": { + "@types/node": "^22.9.0", "@vue/test-utils": "^2.4.6", "canvas": "^2.11.2", "jsdom": "^25.0.1", @@ -1014,6 +1015,16 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, + "node_modules/@types/node": { + "version": "22.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.0.tgz", + "integrity": "sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.8" + } + }, "node_modules/@vitest/expect": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.5.tgz", @@ -3548,6 +3559,13 @@ "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==", "dev": true }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" + }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", diff --git a/package.json b/package.json index ada7a1e..5da984e 100644 --- a/package.json +++ b/package.json @@ -50,13 +50,14 @@ "scripts": { "build": "vite build && npm run tsc", "test": "vitest", - "tsc": "tsc src/index.ts --declaration --emitDeclarationOnly --outDir ./dist --declarationDir ./dist" + "tsc": "tsc --project tsconfig.json" }, "peerDependencies": { "konva": ">7", "vue": "^3" }, "devDependencies": { + "@types/node": "^22.9.0", "@vue/test-utils": "^2.4.6", "canvas": "^2.11.2", "jsdom": "^25.0.1", diff --git a/src/utils/applyNodeProps.ts b/src/utils/applyNodeProps.ts index be100a6..4784143 100644 --- a/src/utils/applyNodeProps.ts +++ b/src/utils/applyNodeProps.ts @@ -1,4 +1,5 @@ // adapted FROM: https://github.com/lavrton/react-konva/blob/master/src/react-konva-fiber.js +import '../../index.d.ts'; import type { ComponentInternalInstance } from 'vue'; import updatePicture from './updatePicture'; diff --git a/tsconfig.json b/tsconfig.json index fdf4880..c48ff58 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,24 @@ { "compilerOptions": { - "target": "ESNext", - "module": "commonjs", + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "./dist", + "declarationDir": "./dist", + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, "strict": true, - "skipLibCheck": true - } + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.vue"], + "exclude": ["node_modules"] }