From 7117e0c3c0caa56d1e6d662e87703fa16e1ceee5 Mon Sep 17 00:00:00 2001 From: Aleksei Androsov Date: Mon, 5 May 2025 14:15:29 +0300 Subject: [PATCH] (fix) ts-add-js-extension breaks generic args in d.ts files Add explicit result for de.run --- lib/index.ts | 3 ++- package.json | 2 +- tsconfig.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/index.ts b/lib/index.ts index 72a34f6..452abc1 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -25,6 +25,7 @@ import type { InferParamsInFromBlock, InferBlock, InferHttpBlock, + InferResultOrResult, } from './types'; import type BaseBlock from './block'; import type { DescriptHttpBlockDescription, DescriptHttpBlockQuery, DescriptHttpBlockQueryValue } from './httpBlock'; @@ -160,7 +161,7 @@ const run = function< // block: FunctionBlock, { params, context, cancel }: { params?: Params; context?: Context; cancel?: Cancel; - } = {}) { + } = {}): Promise> { const runContext = new RunContext(); if (!(params && typeof params === 'object')) { diff --git a/package.json b/package.json index 973a979..225a2d4 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "eslint": "npx eslint .", "test": "cd tests && ./gen-certs.sh && npx vitest", "ts-compile": "npx tsc --noEmit", - "prepack": "rm -rf build && npx tsc -p ./tsconfig-build.json && npx ts-add-js-extension --dir=build" + "prepack": "rm -rf build && npx tsc -p ./tsconfig-build.json && npx ts-add-js-extension --dir=build && npx tsc -p ./tsconfig-build.json -d" }, "devDependencies": { "@eslint/js": "^9.21.0", diff --git a/tsconfig.json b/tsconfig.json index 0d0b3f5..7d7bd47 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,7 @@ "skipLibCheck": true, // https://www.typescriptlang.org/tsconfig#skipLibCheck "strict": false, "strictNullChecks": true, - "declaration":true, + "declaration":false, "baseUrl": ".", "outDir": "./build"