connection.ts 803 B

12345678910111213141516
  1. /**
  2. * Main/preload/renderer result for the direct utility-runtime transport.
  3. *
  4. * The union keeps a live port and a terminal supervisor verdict mutually
  5. * exclusive: once Main latches terminal failure there is no connection to
  6. * deliver, while a connected result must never tell the renderer to stop it.
  7. */
  8. export type RuntimeTransportDirectConnectionResult =
  9. | { enabled: true; connected: true; terminal?: never }
  10. | { enabled: true; connected: false; terminal?: false }
  11. | { enabled: true; connected: false; terminal: true };
  12. /** Selected runtime transport mode returned across the Electron IPC bridge. */
  13. export type RuntimeTransportPortResult =
  14. | ({ mode: 'direct' } & RuntimeTransportDirectConnectionResult)
  15. | { mode: 'protocol'; enabled: false; connected: false; terminal?: never };