@@ -377,7 +377,7 @@ export class WorkflowClient {
377
377
headers : { } ,
378
378
workflowType,
379
379
signalName : typeof signal === 'string' ? signal : signal . name ,
380
- signalArgs,
380
+ signalArgs : signalArgs ?? [ ] ,
381
381
} ) ;
382
382
}
383
383
@@ -409,15 +409,15 @@ export class WorkflowClient {
409
409
}
410
410
411
411
/**
412
- * Sends a signal to a running Workflow or starts a new one if not already running and immediately signals it.
413
- * Useful when you're unsure of the Workflows' run state .
412
+ * Sends a Signal to a running Workflow or starts a new one if not already running and immediately Signals it.
413
+ * Useful when you're unsure whether the Workflow has been started .
414
414
*
415
- * @returns a WorkflowHandle to the started Workflow
415
+ * @returns a { @link WorkflowHandle} to the started Workflow
416
416
*/
417
- public async signalWithStart < T extends Workflow , SA extends any [ ] = [ ] > (
418
- workflowTypeOrFunc : string | T ,
419
- options : WithWorkflowArgs < T , WorkflowSignalWithStartOptions < SA > >
420
- ) : Promise < WorkflowHandleWithSignaledRunId < T > > {
417
+ public async signalWithStart < WorkflowFn extends Workflow , SignalArgs extends any [ ] = [ ] > (
418
+ workflowTypeOrFunc : string | WorkflowFn ,
419
+ options : WithWorkflowArgs < WorkflowFn , WorkflowSignalWithStartOptions < SignalArgs > >
420
+ ) : Promise < WorkflowHandleWithSignaledRunId < WorkflowFn > > {
421
421
const { workflowId } = options ;
422
422
const interceptors = ( this . options . interceptors . calls ?? [ ] ) . map ( ( ctor ) => ctor ( { workflowId } ) ) ;
423
423
const runId = await this . _signalWithStart ( workflowTypeOrFunc , options , interceptors ) ;
@@ -430,7 +430,7 @@ export class WorkflowClient {
430
430
runIdForResult : runId ,
431
431
interceptors,
432
432
followRuns : options . followRuns ?? true ,
433
- } ) as WorkflowHandleWithSignaledRunId < T > ; // Cast is safe because we know we add the signaledRunId below
433
+ } ) as WorkflowHandleWithSignaledRunId < WorkflowFn > ; // Cast is safe because we know we add the signaledRunId below
434
434
( handle as any ) /* readonly */ . signaledRunId = runId ;
435
435
return handle ;
436
436
}
0 commit comments