| 31 | // ======================================================================================= |
| 32 | |
| 33 | export interface Exporter { |
| 34 | exportStub(hook: StubHook): ExportId; |
| 35 | exportPromise(hook: StubHook): ExportId; |
| 36 | getImport(hook: StubHook): ImportId | undefined; |
| 37 | |
| 38 | // If a serialization error occurs after having exported some capabilities, this will be called |
| 39 | // to roll back the exports. |
| 40 | unexport(ids: Array<ExportId>): void; |
| 41 | |
| 42 | // Creates a pipe by sending a ["pipe"] message, then starts pumping the given ReadableStream |
| 43 | // into the pipe's writable end. Returns the import ID assigned to the pipe. `hook` should be |
| 44 | // disposed when the pipe finishes. |
| 45 | createPipe(readable: ReadableStream, hook: StubHook): ImportId; |
| 46 | |
| 47 | onSendError(error: Error): Error | void; |
| 48 | } |
| 49 | |
| 50 | class NullExporter implements Exporter { |
| 51 | exportStub(stub: StubHook): never { |
no outgoing calls
no test coverage detected
searching dependent graphs…