| 11 | * built-in transports (e.g. for HTTP batch and WebSocket) don't meet your needs. |
| 12 | */ |
| 13 | export interface RpcTransport { |
| 14 | /** |
| 15 | * The encoding level this transport works with. For this interface it is always "string"; |
| 16 | * it may be omitted. (See `RpcTransportWithCustomEncoding` for the other levels.) |
| 17 | */ |
| 18 | readonly encodingLevel?: "string"; |
| 19 | |
| 20 | /** |
| 21 | * Sends a message to the other end. May optionally return a promise; if the promise rejects, |
| 22 | * the session is aborted. |
| 23 | */ |
| 24 | send(message: string): void | Promise<void>; |
| 25 | |
| 26 | /** |
| 27 | * Receives a message sent by the other end. |
| 28 | * |
| 29 | * If and when the transport becomes disconnected, this will reject. The thrown error will be |
| 30 | * propagated to all outstanding calls and future calls on any stubs associated with the session. |
| 31 | * If there are no outstanding calls (and none are made in the future), then the error does not |
| 32 | * propagate anywhere -- this is considered a "clean" shutdown. |
| 33 | */ |
| 34 | receive(): Promise<string>; |
| 35 | |
| 36 | /** |
| 37 | * Indicates that the RPC system has suffered an error that prevents the session from continuing. |
| 38 | * The transport should ideally try to send any queued messages if it can, and then close the |
| 39 | * connection. (It's not strictly necessary to deliver queued messages, but the last message sent |
| 40 | * before abort() is called is often an "abort" message, which communicates the error to the |
| 41 | * peer, so if that is dropped, the peer may have less information about what happened.) |
| 42 | */ |
| 43 | abort?(reason: any): void; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Interface for a transport that receives partially encoded JS values instead of JSON strings. |
no outgoing calls
no test coverage detected
searching dependent graphs…