MCPcopy Index your code
hub / github.com/callstack/agent-device / captureVerifiedScrollEdgeState

Function captureVerifiedScrollEdgeState

src/core/dispatch-interactions.ts:832–856  ·  view source on GitHub ↗
(
  interactor: Interactor,
  context: DispatchContext | undefined,
  edge: ScrollEdge,
  scope?: string,
)

Source from the content-addressed store, hash-verified

830}
831
832async function captureVerifiedScrollEdgeState(
833 interactor: Interactor,
834 context: DispatchContext | undefined,
835 edge: ScrollEdge,
836 scope?: string,
837): Promise<ScrollEdgeState> {
838 if (typeof interactor.snapshot !== 'function') {
839 throw new AppError(
840 'UNSUPPORTED_OPERATION',
841 `scroll ${edge} requires snapshot support to verify hidden content before scrolling`,
842 );
843 }
844 const snapshot = interactor.snapshot;
845 return await captureScrollEdgeState({
846 edge,
847 scope,
848 captureNodes: async (snapshotScope) =>
849 (
850 await snapshot({
851 appBundleId: context?.appBundleId,
852 scope: snapshotScope,
853 })
854 ).nodes ?? [],
855 });
856}
857
858function parseScrollTarget(input: string): {
859 direction: ReturnType<typeof parseScrollDirection>;

Callers 1

runDispatchedScrollFunction · 0.85

Calls 2

captureScrollEdgeStateFunction · 0.90
snapshotFunction · 0.50

Tested by

no test coverage detected