Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Expose disconnect/send on sub type of ChildProcess #181

Merged
merged 1 commit into from
Feb 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ trait ChildProcess extends IEventEmitter {
def kill(signal: js.UndefOr[KillSignal] = js.native): Unit = js.native
def ref(): Unit = js.native
def unref(): Unit = js.native
// TODO: Are those available in limited scenario?
//def disconnect(): Unit = js.native
//def send(message: js.Any, sendHandle: Handle = js.native, options: SendOptions = js.native, callback: js.Function1[nodejs.Error, Any] = js.native): Boolean = js.native

val channel: js.UndefOr[js.Object] = js.native
val connected: Boolean = js.native
Expand All @@ -32,6 +29,15 @@ trait ChildProcess extends IEventEmitter {
val stdout: stream.IReadable = js.native
}

@js.native
trait ForkedChildProcess extends ChildProcess {
def disconnect(): Unit = js.native
def send(message: js.Any,
sendHandle: Handle = js.native,
options: SendOptions = js.native,
callback: js.Function1[nodejs.Error, Any] = js.native): Boolean = js.native
}

/**
* @see https://nodejs.org/api/child_process.html
*/
Expand Down Expand Up @@ -76,7 +82,7 @@ object ChildProcess extends scala.scalajs.js.Object {
modulePath: String,
args: js.Array[String] = js.native,
options: ForkOptions = js.native
): ChildProcess = js.native
): ForkedChildProcess = js.native

def spawn(
command: String,
Expand Down