TTSStreamFakeFFI typedef

TTSStreamFakeFFI = Future<int> Function(TTSSynthesisRequest request, void dispatch(TTSStreamEvent), bool terminalObserved())

Test seam type for DartBridgeTTS.synthesizeStreamLifecycleProto. The override receives:

  • request: the TTSSynthesisRequest the production code received.
  • dispatch: the same closure the production NativeCallable invokes — pass a TTSStreamEvent to deliver it through the real wrapper's listener body (drain loop + closed-controller guard intact).
  • terminalObserved: closure the fake can check to short-circuit. Returning a non-zero result code drives the wrapper's error branch.

Implementation

typedef TTSStreamFakeFFI =
    Future<int> Function(
      TTSSynthesisRequest request,
      void Function(TTSStreamEvent) dispatch,
      bool Function() terminalObserved,
    );