@@ -115,7 +115,7 @@ export function getWaitingItemLabel(item, finished) {
115115 * Get details for a waiting item to display in an expanded view.
116116 *
117117 * @param {import('./types').WaitingItem } item
118- * @returns {{ label: string; value: string } [] }
118+ * @returns {import('./types').WaitingItemDetail [] }
119119 */
120120export function getWaitingItemDetails ( item ) {
121121 if ( ! item . data ) {
@@ -236,7 +236,7 @@ export function isPendingItem(item) {
236236 * Get badge descriptors for a waiting item.
237237 *
238238 * @param {import('./types').WaitingItem } item
239- * @returns {{ text: string, variant?: string } [] }
239+ * @returns {import('./types').WaitingItemBadge [] }
240240 */
241241export function getWaitingItemBadges ( item ) {
242242 const badges = [ ] ;
@@ -330,7 +330,7 @@ export default class ExecutionLogModel {
330330 */
331331 addEntry ( entry ) {
332332 if ( entry . type === 'poll' ) {
333- this . _handlePollEntry ( entry ) ;
333+ this . _handlePollEntry ( /** @type { any } */ ( entry ) ) ;
334334 return this . _entries ;
335335 }
336336
@@ -398,18 +398,7 @@ export default class ExecutionLogModel {
398398 * entries, applying key-based deduplication to avoid re-emitting unchanged
399399 * data on every poll tick.
400400 *
401- * @param {object } pollEntry
402- * @param {{ success: boolean, response?: { items: any[] } } } pollEntry.jobsResult
403- * @param {{ success: boolean, response?: { items: any[] } } } pollEntry.userTasksResult
404- * @param {{ success: boolean, response?: { items: any[] } } } pollEntry.messageSubscriptionsResult
405- * @param {{ success: boolean, response?: { items: any[] } } } pollEntry.elementInstancesResult
406- * @param {{ success: boolean, response?: { items: any[] } } } [pollEntry.variablesResult]
407- * @param {string } pollEntry.elementId
408- * @param {Set<string> } [pollEntry.childElementIds]
409- * @param {function(string): Set<string> } [pollEntry.getChildIds]
410- * Called with a parent element ID; returns the set of direct child IDs.
411- * Used to resolve event sub-process children from the element hierarchy.
412- * @param {number } pollEntry.timestamp
401+ * @param {import('./types').TaskExecutionPollData } pollEntry
413402 */
414403 _handlePollEntry ( {
415404 jobsResult,
@@ -590,7 +579,7 @@ const CHILD_ELEMENT_TYPES = new Set([
590579/**
591580 * Build a list of child element instances (tasks executed inside a sub-process).
592581 *
593- * @param {{ success: boolean, response?: { items: any[] } } } elementInstancesResult
582+ * @param {import('./types').ApiResponse<{ items: any[] }> } elementInstancesResult
594583 * @param {string } elementId - the element being tested (excluded from children)
595584 * @param {Set<string> } [childElementIds] - set of valid direct child element IDs
596585 * @returns {import('./types').ChildElement[] }
@@ -600,7 +589,7 @@ export function buildChildElements(elementInstancesResult, elementId, childEleme
600589 return [ ] ;
601590 }
602591
603- return ( elementInstancesResult . response . items || [ ] )
592+ return ( /** @type { { items: any[] } } */ ( elementInstancesResult . response ) . items || [ ] )
604593 . filter ( el => {
605594 if ( el . elementId === elementId ) return false ;
606595 if ( ! CHILD_ELEMENT_TYPES . has ( el . type ) ) return false ;
@@ -623,19 +612,16 @@ export function buildChildElements(elementInstancesResult, elementId, childEleme
623612 * Enrich event sub-process waiting items with their executed child element instances.
624613 *
625614 * @param {import('./types').WaitingItem[] } waitingItems
626- * @param {{ success: boolean, response?: { items: any[] } } } elementInstancesResult
627- * @param {Object } elementRegistry
628- */
629- /**
630- * @param {function(string): Set<string> } getChildIds
615+ * @param {import('./types').ApiResponse<{ items: any[] }> } elementInstancesResult
616+ * @param {((arg0: string) => Set<string>) } [getChildIds]
631617 * Called with a parent element ID; returns the set of direct child IDs.
632618 */
633619export function enrichEventSubProcessChildren ( waitingItems , elementInstancesResult , getChildIds ) {
634620 if ( ! elementInstancesResult . success || typeof getChildIds !== 'function' ) {
635621 return ;
636622 }
637623
638- const allInstances = elementInstancesResult . response . items || [ ] ;
624+ const allInstances = /** @type { { items: any[] } } */ ( elementInstancesResult . response ) . items || [ ] ;
639625
640626 for ( const item of waitingItems ) {
641627 if ( item . type !== 'event-sub-process' ) {
@@ -669,17 +655,17 @@ export function enrichEventSubProcessChildren(waitingItems, elementInstancesResu
669655 * variable scopeKey to element instance keys.
670656 *
671657 * @param {import('./types').ChildElement[] } children
672- * @param {{ success: boolean, response?: { items: any[] } } } elementInstancesResult
673- * @param {{ success: boolean, response?: { items: any[] } } } [variablesResult]
658+ * @param {import('./types').ApiResponse<{ items: any[] }> } elementInstancesResult
659+ * @param {import('./types').ApiResponse<{ items: any[] }> } [variablesResult]
674660 * @returns {import('./types').ChildElement[] }
675661 */
676662export function enrichChildrenWithVariables ( children , elementInstancesResult , variablesResult ) {
677663 if ( ! variablesResult ?. success || ! elementInstancesResult . success ) {
678664 return children ;
679665 }
680666
681- const elementInstances = elementInstancesResult . response . items || [ ] ;
682- const variables = variablesResult . response . items || [ ] ;
667+ const elementInstances = /** @type { { items: any[] } } */ ( elementInstancesResult . response ) . items || [ ] ;
668+ const variables = /** @type { { items: any[] } } */ ( variablesResult . response ) . items || [ ] ;
683669
684670 // Build a map: elementId -> set of elementInstanceKeys
685671 const elementIdToKeys = new Map ( ) ;
0 commit comments