temporal-time-utils
temporal-time-utils copied to clipboard
[Bug] Package fails typescript compilation
Describe the bug
tsc fails to compile when trying to import UpdatableTimer
To Reproduce Steps to reproduce the behavior:
- Run
npm i temporal-time-utils - Add this line to one of workflow files:
import { UpdatableTimer } from 'temporal-time-utils';
- Run
npx -c 'tsc'
Expected behavior Typescript should compile
Screenshots/Terminal ouput
node_modules/temporal-time-utils/ScheduleWorkflow.ts:42:6 - error TS2769: No overload matches this call.
Overload 1 of 3, '(def: QueryDefinition<unknown, any[], string>, handler: ((...args: any[]) => unknown) | undefined, options?: QueryHandlerOptions | undefined): void', gave the following error.
Argument of type 'SignalDefinition<[], "manualTriggerSignal">' is not assignable to parameter of type 'QueryDefinition<unknown, any[], string>'.
Property '[retBrand]' is missing in type 'SignalDefinition<[], "manualTriggerSignal">' but required in type 'QueryDefinition<unknown, any[], string>'.
Overload 2 of 3, '(def: SignalDefinition<[], "manualTriggerSignal">, handler: (() => void | Promise<void>) | undefined, options?: SignalHandlerOptions | undefined): void', gave the following error.
Argument of type '() => Promise<wf.WorkflowResultType<T>>' is not assignable to parameter of type '() => void | Promise<void>'.
Type 'Promise<WorkflowResultType<T>>' is not assignable to type 'void | Promise<void>'.
Type 'Promise<WorkflowResultType<T>>' is not assignable to type 'Promise<void>'.
Type 'WorkflowResultType<T>' is not assignable to type 'void'.
Type 'unknown' is not assignable to type 'void'.
Overload 3 of 3, '(def: UpdateDefinition<unknown, any[], string>, handler: ((...args: any[]) => unknown) | undefined, options?: UpdateHandlerOptions<any[]> | undefined): void', gave the following error.
Argument of type 'SignalDefinition<[], "manualTriggerSignal">' is not assignable to parameter of type 'UpdateDefinition<unknown, any[], string>'.
Property '[retBrand]' is missing in type 'SignalDefinition<[], "manualTriggerSignal">' but required in type 'UpdateDefinition<unknown, any[], string>'.
42 wf.setHandler(manualTriggerSignal, () =>
~~~~~~~~~~
node_modules/@temporalio/common/lib/interfaces.d.ts:86:5
86 [retBrand]: Ret;
~~~~~~~~~~
'[retBrand]' is declared here.
node_modules/@temporalio/common/lib/interfaces.d.ts:51:5
51 [retBrand]: Ret;
~~~~~~~~~~
'[retBrand]' is declared here.
Versions (please complete the following information where relevant):
- OS: Linux, Pop!_OS kernel 6.9.3
- Temporal Version
1.11.1 - are you using Docker or Kubernetes or building Temporal from source? no
Additional context
tsconfig.json file:
{
"extends": "@tsconfig/node20/tsconfig.json",
"version": "4.4.2",
"compilerOptions": {
"noStrictGenericChecks": false,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"rootDir": "./src",
"outDir": "./lib",
"experimentalDecorators": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}