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

[os][stream] Refine return types after dropping Node.js v8 #194

Merged
merged 2 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions app/current/src/main/scala/io/scalajs/nodejs/os/OS.scala
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ trait OS extends js.Object {
* Returns the system uptime in seconds.
* @example os.uptime()
*/
// TODO: Return type should be Int after dropping Node.js 8 (Windows returns decimal until Node.js 10))
def uptime(): Double = js.native
def uptime(): Int = js.native

/**
* The os.userInfo() method returns information about the currently effective user -- on POSIX platforms,
Expand Down
11 changes: 5 additions & 6 deletions app/current/src/main/scala/io/scalajs/nodejs/stream/Stream.scala
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,12 @@ sealed trait IWritable extends LegacyStream {

def destroyed: Boolean = js.native

// TODO: Return type should be this.type if node.js v8 dropped
def end(chunk: String | Uint8Array, callback: js.Function1[Error, Any]): js.UndefOr[this.type] = js.native
def end(chunk: String | Uint8Array): js.UndefOr[this.type] = js.native
def end(chunk: String | Uint8Array, callback: js.Function1[Error, Any]): this.type = js.native
def end(chunk: String | Uint8Array): js.UndefOr[this.type] = js.native

def end(chunk: String, encoding: String, callback: js.Function1[Error, Any]): js.UndefOr[this.type] = js.native
def end(chunk: String, encoding: String): js.UndefOr[this.type] = js.native
def end(callback: js.Function1[Error, Any] = js.native): js.UndefOr[this.type] = js.native
def end(chunk: String, encoding: String, callback: js.Function1[Error, Any]): this.type = js.native
def end(chunk: String, encoding: String): this.type = js.native
def end(callback: js.Function1[Error, Any] = js.native): this.type = js.native

/**
* Sets the default encoding for a writable stream.
Expand Down