diff --git a/package-lock.json b/package-lock.json index 2c7fd087..2efc5c19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,8 @@ "version": "8.1.1-dev", "license": "Apache-2.0", "devDependencies": { - "@cordova/eslint-config": "^5.0.0" + "@cordova/eslint-config": "^5.0.0", + "typescript": "^5.1.6" }, "engines": { "cordovaDependencies": { @@ -2588,6 +2589,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typescript": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", diff --git a/package.json b/package.json index 63183bb9..2640663f 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,9 @@ "cordova-windows" ], "scripts": { - "test": "npm run lint", - "lint": "eslint ." + "test": "npm run lint && npm run test:types", + "lint": "eslint .", + "test:types": "tsc --project ./types/tests/tsconfig.json" }, "author": "Apache Software Foundation", "license": "Apache-2.0", @@ -48,6 +49,7 @@ } }, "devDependencies": { - "@cordova/eslint-config": "^5.0.0" + "@cordova/eslint-config": "^5.0.0", + "typescript": "^5.1.6" } } diff --git a/types/tests/index.ts b/types/tests/index.ts new file mode 100644 index 00000000..2a76d7af --- /dev/null +++ b/types/tests/index.ts @@ -0,0 +1,4 @@ + +// Intentionally empty file, but +// further tests can be added to ensure type usages +// can work as expected diff --git a/types/tests/tsconfig.json b/types/tests/tsconfig.json new file mode 100644 index 00000000..69c25bf6 --- /dev/null +++ b/types/tests/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "noEmit": true + }, + "files": [ + "../index.d.ts" + ], + "include": [ + "./*.ts" + ] +} \ No newline at end of file