Documentation
    Preparing search index...

    Function createMockMotionService

    • Create the NAP-MOTION mock.

      Parameters

      Returns MockMotionService

      A motion extension with emitSample, setFocus, revoke.

      const motion = createMockMotionService();
      motion.handleMessage('w1', { type: 'motion.subscribe', frequency: 60 }, send); // → motion.state
      motion.handleMessage('w1', { type: 'motion.permission', id: 'm1' }, send); // → result + motion.state
      motion.emitSample(); // → motion.sample