( interactor: Interactor, context: DispatchContext | undefined, target: ScrollTarget, options: ScrollCommandOptions, )
| 787 | } |
| 788 | |
| 789 | async function runDispatchedScroll( |
| 790 | interactor: Interactor, |
| 791 | context: DispatchContext | undefined, |
| 792 | target: ScrollTarget, |
| 793 | options: ScrollCommandOptions, |
| 794 | ): Promise<{ interactionResult: Record<string, unknown>; completedPasses: number }> { |
| 795 | if (target.edge) { |
| 796 | const edge = target.edge; |
| 797 | const edgeResult = await runScrollEdgePasses({ |
| 798 | edge, |
| 799 | captureState: async (scope) => |
| 800 | await captureVerifiedScrollEdgeState(interactor, context, edge, scope), |
| 801 | scroll: async () => await interactor.scroll(target.direction, options), |
| 802 | }); |
| 803 | return { |
| 804 | interactionResult: edgeResult.result ?? {}, |
| 805 | completedPasses: edgeResult.passes, |
| 806 | }; |
| 807 | } |
| 808 | |
| 809 | return { |
| 810 | interactionResult: (await interactor.scroll(target.direction, options)) ?? {}, |
| 811 | completedPasses: 1, |
| 812 | }; |
| 813 | } |
| 814 | |
| 815 | function buildDispatchedScrollResult( |
| 816 | target: ScrollTarget, |
no test coverage detected