diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/assertion/AssertTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/assertion/AssertTest.scala index ecb305d18..33afce981 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/assertion/AssertTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/assertion/AssertTest.scala @@ -11,7 +11,7 @@ class AssertTest extends AnyFunSpec { } it("have rejects/doesNotReject from v10.0.0") { - assert(NodeAssert.strict.rejects _ !== js.undefined) - assert(NodeAssert.strict.doesNotReject _ !== js.undefined) + NodeAssert.strict.rejects(js.Promise.reject("omg")) + NodeAssert.strict.doesNotReject(js.Promise.resolve[String]("wow")) } } diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Assert.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Assert.scala index 60bb07d07..7f67e39d0 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Assert.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Assert.scala @@ -20,19 +20,22 @@ trait Assert extends js.Object { * @param expression the expression to evaluate * @example assert(value[, message]) */ - def apply(expression: js.Any, message: String = js.native): Unit = js.native + def apply(expression: js.Any, message: String): Unit = js.native + def apply(expression: js.Any): Unit = js.native /** * Generally identical to assert.deepEqual() with two exceptions. First, primitive values are compared using the * strict equality operator ( === ). Second, object comparisons include a strict equality check of their prototypes. * @example assert.deepStrictEqual(actual, expected[, message]) */ - def deepStrictEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native + def deepStrictEqual(actual: js.Any, expected: js.Any, message: String): Unit = js.native + def deepStrictEqual(actual: js.Any, expected: js.Any): Unit = js.native - def doesNotReject(asyncFn: js.Function | js.Promise[_], - error: js.RegExp | js.Function = js.native, - message: String = js.native - ): Unit = js.native + def doesNotReject(asyncFn: js.Function | js.Promise[_], error: js.RegExp | js.Function, message: String): Unit = + js.native + def doesNotReject(asyncFn: js.Function | js.Promise[_], error: js.RegExp | js.Function): Unit = js.native + def doesNotReject(asyncFn: js.Function | js.Promise[_], message: String): Unit = js.native + def doesNotReject(asyncFn: js.Function | js.Promise[_]): Unit = js.native /** * Asserts that the function block does not throw an error. See assert.throws() for more details. @@ -41,8 +44,10 @@ trait Assert extends js.Object { * error is of a different type, or if the error parameter is undefined, the error is propagated back to the caller. * @example assert.doesNotThrow(block[, error][, message]) */ - def doesNotThrow(block: js.Function, error: js.RegExp | js.Function = js.native, message: String = js.native): Unit = - js.native + def doesNotThrow(block: js.Function, error: js.RegExp | js.Function, message: String): Unit = js.native + def doesNotThrow(block: js.Function, error: js.RegExp | js.Function): Unit = js.native + def doesNotThrow(block: js.Function, message: String): Unit = js.native + def doesNotThrow(block: js.Function): Unit = js.native /** * @see https://nodejs.org/api/assert.html#assert_assert_fail_message @@ -67,26 +72,30 @@ trait Assert extends js.Object { * Tests for deep strict inequality. Opposite of assert.deepStrictEqual(). * @example assert.notDeepStrictEqual(actual, expected[, message]) */ - def notDeepStrictEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native + def notDeepStrictEqual(actual: js.Any, expected: js.Any, message: String): Unit = js.native + def notDeepStrictEqual(actual: js.Any, expected: js.Any): Unit = js.native /** * Tests strict inequality as determined by the strict not equal operator ( !== ). * @example assert.notStrictEqual(actual, expected[, message]) */ - def notStrictEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native + def notStrictEqual(actual: js.Any, expected: js.Any, message: String): Unit = js.native + def notStrictEqual(actual: js.Any, expected: js.Any): Unit = js.native /** * Tests if value is truthy. It is equivalent to assert.equal(!!value, true, message). If value is not truthy, * an AssertionError is thrown with a message property set equal to the value of the message parameter. If the * message parameter is undefined, a default error message is assigned. */ - def ok(value: js.Any, message: String = js.native): Unit = js.native + def ok(value: js.Any, message: String): Unit = js.native + def ok(value: js.Any): Unit = js.native /** * Tests strict equality as determined by the strict equality operator ( === ). * @example assert.strictEqual(actual, expected[, message]) */ - def strictEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native + def strictEqual(actual: js.Any, expected: js.Any, message: String): Unit = js.native + def strictEqual(actual: js.Any, expected: js.Any): Unit = js.native /** * If the values are not strictly equal, an AssertionError is thrown with a message property set equal to the value @@ -99,9 +108,13 @@ trait Assert extends js.Object { ): Unit = js.native def rejects(asyncFn: js.Function | js.Promise[_], - error: js.RegExp | js.Function | js.Object | Error = js.native, - message: String = js.native + error: js.RegExp | js.Function | js.Object | Error, + message: String ): Unit = js.native + def rejects(asyncFn: js.Function | js.Promise[_], error: js.RegExp | js.Function | js.Object | Error): Unit = + js.native + def rejects(asyncFn: js.Function | js.Promise[_], message: String): Unit = js.native + def rejects(asyncFn: js.Function | js.Promise[_]): Unit = js.native } /** diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Error.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Error.scala index e98fbe2e9..91ee45d52 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Error.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Error.scala @@ -15,7 +15,8 @@ import scala.scalajs.js.annotation.JSGlobal */ @js.native @JSGlobal -class Error(message0: String = js.native) extends js.Object { +class Error(message0: String) extends js.Object { + def this() = this(???) /** * The `error.code` property is a string label that identifies the kind of error. @@ -70,7 +71,8 @@ object Error extends js.Object { * from an end user. * @example Error.captureStackTrace(targetObject[, constructorOpt]) */ - def captureStackTrace(targetObject: js.Any, constructorOpt: js.Any = js.native): Unit = js.native + def captureStackTrace(targetObject: js.Any, constructorOpt: js.Any): Unit = js.native + def captureStackTrace(targetObject: js.Any): Unit = js.native } object ErrorCodes { diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Require.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Require.scala index 16dd9ef83..18f821c56 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Require.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Require.scala @@ -20,7 +20,8 @@ object Require extends Require @js.native trait RequireResolver extends js.Object { - def apply(request: String, options: ResolveOptions = js.native): js.Any = js.native + def apply(request: String, options: ResolveOptions): js.Any = js.native + def apply(request: String): js.Any = js.native def paths(requiest: String): js.Array[String] = js.native } diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/StringDecoder.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/StringDecoder.scala index 7075efbea..2597b0aa1 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/StringDecoder.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/StringDecoder.scala @@ -13,13 +13,15 @@ import scala.scalajs.js.| */ @js.native @JSImport("string_decoder", "StringDecoder") -class StringDecoder(encoding: String = js.native) extends IEventEmitter { +class StringDecoder(encoding: String) extends IEventEmitter { + def this() = this(???) /** * Returns any trailing bytes that were left in the buffer. * @example decoder.end() */ - def end(buffer: TypedArray[_, _] | DataView = js.native): String = js.native + def end(buffer: TypedArray[_, _] | DataView): String = js.native + def end(): String = js.native /** * Returns a decoded string. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala index ba40eeea9..123474086 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala @@ -58,12 +58,11 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * -1 is returned if target should come after buf when sorted. * @see [[https://nodejs.org/api/buffer.html#buffer_buf_compare_target_targetstart_targetend_sourcestart_sourceend]] */ - def compare(target: Uint8Array, - targetStart: Int = js.native, - targetEnd: Int = js.native, - sourceStart: Int = js.native, - sourceEnd: Int = js.native - ): Int = js.native + def compare(target: Uint8Array, targetStart: Int, targetEnd: Int, sourceStart: Int, sourceEnd: Int): Int = js.native + def compare(target: Uint8Array, targetStart: Int, targetEnd: Int, sourceStart: Int): Int = js.native + def compare(target: Uint8Array, targetStart: Int, targetEnd: Int): Int = js.native + def compare(target: Uint8Array, targetStart: Int): Int = js.native + def compare(target: Uint8Array): Int = js.native /** * Copies data from a region of `buf` to a region in `target` even if the `target` memory region overlaps with `buf`. @@ -77,11 +76,10 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return The number of bytes copied. * @see [[https://nodejs.org/api/buffer.html#buffer_buf_copy_target_targetstart_sourcestart_sourceend]] */ - def copy(target: Buffer, - targetStart: Int = js.native, - sourceStart: Int = js.native, - sourceEnd: Int = js.native - ): Int = js.native + def copy(target: Buffer, targetStart: Int, sourceStart: Int, sourceEnd: Int): Int = js.native + def copy(target: Buffer, targetStart: Int, sourceStart: Int): Int = js.native + def copy(target: Buffer, targetStart: Int): Int = js.native + def copy(target: Buffer): Int = js.native /** * Creates and returns an [[Iterator]] of `[index, byte]` pairs from the contents of `buf`. @@ -110,11 +108,12 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return A reference to buf * @see https://nodejs.org/api/buffer.html#buffer_buf_fill_value_offset_end_encoding */ - def fill(value: Uint8Array | Int | String, - offset: Int = js.native, - end: Int = js.native, - encoding: String = js.native - ): this.type = js.native + def fill(value: Uint8Array | Int | String, offset: Int, end: Int, encoding: String): this.type = js.native + def fill(value: Uint8Array | Int | String, offset: Int, end: Int): this.type = js.native + def fill(value: Uint8Array | Int | String, offset: Int, encoding: String): this.type = js.native + def fill(value: Uint8Array | Int | String, offset: Int): this.type = js.native + def fill(value: Uint8Array | Int | String, encoding: String): this.type = js.native + def fill(value: Uint8Array | Int | String): this.type = js.native /** * Returns the index of the first occurrence of value in buf or -1 if buf does not contain value @@ -124,7 +123,10 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return The index of the first occurrence of value in buf or -1 if buf does not contain value * @example {{{ buf.indexOf(value[, byteOffset][, encoding]) }}} */ - def indexOf(value: Buffer | Int | String, byteOffset: Int = js.native, encoding: String = js.native): Int = js.native + def indexOf(value: Buffer | Int | String, byteOffset: Int, encoding: String): Int = js.native + def indexOf(value: Buffer | Int | String, byteOffset: Int): Int = js.native + def indexOf(value: Buffer | Int | String, encoding: String): Int = js.native + def indexOf(value: Buffer | Int | String): Int = js.native /** * Equivalent to buf.indexOf() !== -1. @@ -134,8 +136,10 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return true if value was found in buf, false otherwise * @example {{{ buf.includes(value[, byteOffset][, encoding]) }}} */ - def includes(value: Buffer | Int | String, byteOffset: Int = js.native, encoding: String = js.native): Boolean = - js.native + def includes(value: Buffer | Int | String, byteOffset: Int, encoding: String): Boolean = js.native + def includes(value: Buffer | Int | String, byteOffset: Int): Boolean = js.native + def includes(value: Buffer | Int | String, encoding: String): Boolean = js.native + def includes(value: Buffer | Int | String): Boolean = js.native /** * Creates and returns an iterator of buf keys (indices). @@ -152,8 +156,10 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return The index of the last occurrence of value in buf or -1 if buf does not contain value * @example {{{ buf.lastIndexOf(value[, byteOffset][, encoding]) }}} */ - def lastIndexOf(value: Buffer | Int | String, byteOffset: Int = js.native, encoding: String = js.native): Int = - js.native + def lastIndexOf(value: Buffer | Int | String, byteOffset: Int, encoding: String): Int = js.native + def lastIndexOf(value: Buffer | Int | String, byteOffset: Int): Int = js.native + def lastIndexOf(value: Buffer | Int | String, encoding: String): Int = js.native + def lastIndexOf(value: Buffer | Int | String): Int = js.native /** * Returns the amount of memory allocated for buf in bytes. @@ -174,7 +180,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return a [[Double]] value * @example {{{ buf.readDoubleBE(offset[, noAssert]) }}} */ - def readDoubleBE(offset: Int, noAssert: Boolean = js.native): Double = js.native + def readDoubleBE(offset: Int, noAssert: Boolean): Double = js.native + def readDoubleBE(offset: Int): Double = js.native /** * Reads a 64-bit double from buf at the specified offset with specified endian format (readDoubleBE() @@ -187,7 +194,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return a [[Double]] value * @example {{{ buf.readDoubleBE(offset[, noAssert]) }}} */ - def readDoubleLE(offset: Int, noAssert: Boolean = js.native): Double = js.native + def readDoubleLE(offset: Int, noAssert: Boolean): Double = js.native + def readDoubleLE(offset: Int): Double = js.native /** * Reads a 32-bit float from buf at the specified offset with specified endian format (readFloatBE() @@ -200,7 +208,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return a [[Double]] value * @example {{{ buf.readFloatBE(offset[, noAssert]) }}} */ - def readFloatBE(offset: Int, noAssert: Boolean = js.native): Double = js.native + def readFloatBE(offset: Int, noAssert: Boolean): Double = js.native + def readFloatBE(offset: Int): Double = js.native /** * Reads a 32-bit float from buf at the specified offset with specified endian format (readFloatBE() @@ -213,7 +222,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return a [[Double]] value * @example {{{ buf.readFloatLE(offset[, noAssert]) }}} */ - def readFloatLE(offset: Int, noAssert: Boolean = js.native): Double = js.native + def readFloatLE(offset: Int, noAssert: Boolean): Double = js.native + def readFloatLE(offset: Int): Double = js.native /** * Reads a signed 8-bit integer from buf at the specified offset. @@ -226,7 +236,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readInt8(offset[, noAssert]) }}} */ - def readInt8(offset: Int, noAssert: Boolean = js.native): Int = js.native + def readInt8(offset: Int, noAssert: Boolean): Int = js.native + def readInt8(offset: Int): Int = js.native /** * Reads a signed 16-bit integer from buf at the specified offset with the specified endian format @@ -241,7 +252,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readInt16BE(offset[, noAssert]) }}} */ - def readInt16BE(offset: Int, noAssert: Boolean = js.native): Int = js.native + def readInt16BE(offset: Int, noAssert: Boolean): Int = js.native + def readInt16BE(offset: Int): Int = js.native /** * Reads a signed 16-bit integer from buf at the specified offset with the specified endian format @@ -256,7 +268,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readInt16LE(offset[, noAssert]) }}} */ - def readInt16LE(offset: Int, noAssert: Boolean = js.native): Int = js.native + def readInt16LE(offset: Int, noAssert: Boolean): Int = js.native + def readInt16LE(offset: Int): Int = js.native /** * Reads a signed 32-bit integer from buf at the specified offset with the specified endian format @@ -271,7 +284,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readInt32BE(offset[, noAssert]) }}} */ - def readInt32BE(offset: Int, noAssert: Boolean = js.native): Int = js.native + def readInt32BE(offset: Int, noAssert: Boolean): Int = js.native + def readInt32BE(offset: Int): Int = js.native /** * Reads a signed 32-bit integer from buf at the specified offset with the specified endian format @@ -286,7 +300,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readInt32LE(offset[, noAssert]) }}} */ - def readInt32LE(offset: Int, noAssert: Boolean = js.native): Int = js.native + def readInt32LE(offset: Int, noAssert: Boolean): Int = js.native + def readInt32LE(offset: Int): Int = js.native /** * Reads byteLength number of bytes from buf at the specified offset and interprets the result as a @@ -300,7 +315,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readIntBE(offset, byteLength[, noAssert]) }}} */ - def readIntBE(offset: Int, byteLength: Int, noAssert: Boolean = js.native): Int = js.native + def readIntBE(offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native + def readIntBE(offset: Int, byteLength: Int): Int = js.native /** * Reads byteLength number of bytes from buf at the specified offset and interprets the result as a @@ -314,7 +330,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readIntLE(offset, byteLength[, noAssert]) }}} */ - def readIntLE(offset: Int, byteLength: Int, noAssert: Boolean = js.native): Int = js.native + def readIntLE(offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native + def readIntLE(offset: Int, byteLength: Int): Int = js.native /** * Reads an unsigned 8-bit integer from buf at the specified offset. @@ -325,7 +342,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readUInt8(offset[, noAssert]) }}} */ - def readUInt8(offset: Int, noAssert: Boolean = js.native): Int = js.native + def readUInt8(offset: Int, noAssert: Boolean): Int = js.native + def readUInt8(offset: Int): Int = js.native /** * Reads an unsigned 16-bit integer from buf at the specified offset with specified endian format @@ -338,7 +356,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readUInt16BE(offset[, noAssert]) }}} */ - def readUInt16BE(offset: Int, noAssert: Boolean = js.native): Int = js.native + def readUInt16BE(offset: Int, noAssert: Boolean): Int = js.native + def readUInt16BE(offset: Int): Int = js.native /** * Reads an unsigned 16-bit integer from buf at the specified offset with specified endian format @@ -351,7 +370,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readUInt16LE(offset[, noAssert]) }}} */ - def readUInt16LE(offset: Int, noAssert: Boolean = js.native): Int = js.native + def readUInt16LE(offset: Int, noAssert: Boolean): Int = js.native + def readUInt16LE(offset: Int): Int = js.native /** * Reads an unsigned 32-bit integer from buf at the specified offset with specified endian format @@ -364,7 +384,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readUInt32BE(offset[, noAssert]) }}} */ - def readUInt32BE(offset: Int, noAssert: Boolean = js.native): Int = js.native + def readUInt32BE(offset: Int, noAssert: Boolean): Int = js.native + def readUInt32BE(offset: Int): Int = js.native /** * Reads an unsigned 32-bit integer from buf at the specified offset with specified endian format @@ -377,7 +398,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readUInt32LE(offset[, noAssert]) }}} */ - def readUInt32LE(offset: Int, noAssert: Boolean = js.native): Int = js.native + def readUInt32LE(offset: Int, noAssert: Boolean): Int = js.native + def readUInt32LE(offset: Int): Int = js.native /** * Reads byteLength number of bytes from buf at the specified offset and interprets the result @@ -391,7 +413,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readUIntBE(offset, byteLength[, noAssert]) }}} */ - def readUIntBE(offset: Int, byteLength: Int, noAssert: Boolean = js.native): Int = js.native + def readUIntBE(offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native + def readUIntBE(offset: Int, byteLength: Int): Int = js.native /** * Reads byteLength number of bytes from buf at the specified offset and interprets the result @@ -405,7 +428,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the [[Int integer]] value * @example {{{ buf.readUIntLE(offset, byteLength[, noAssert]) }}} */ - def readUIntLE(offset: Int, byteLength: Int, noAssert: Boolean = js.native): Int = js.native + def readUIntLE(offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native + def readUIntLE(offset: Int, byteLength: Int): Int = js.native /** * Returns a new Buffer that references the same memory as the original, but offset and cropped by @@ -418,7 +442,9 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return a [[Buffer]] * @example {{{ buf.slice([start[, end]]) }}} */ - def slice(start: Int = js.native, end: Int = js.native): this.type = js.native + def slice(start: Int, end: Int): this.type = js.native + def slice(start: Int): this.type = js.native + def slice(): this.type = js.native /** * Interprets buf as an array of unsigned 16-bit integers and swaps the byte-order in-place. @@ -461,7 +487,9 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return a string according to the specified character encoding in encoding. * @example {{{ buf.toString([encoding[, start[, end]]]) }}} */ - def toString(encoding: String, start: Int = js.native, end: Int = js.native): String = js.native + def toString(encoding: String, start: Int, end: Int): String = js.native + def toString(encoding: String, start: Int): String = js.native + def toString(encoding: String): String = js.native /** * Re-encodes the given Buffer instance from one character encoding to another. Returns a new Buffer instance. @@ -493,8 +521,11 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the Number of bytes written * @example {{{ buf.write(string[, offset[, length]][, encoding]) }}} */ - def write(string: String, offset: Int = js.native, length: Int = js.native, encoding: String = js.native): Int = - js.native + def write(string: String, offset: Int, length: Int, encoding: String): Int = js.native + def write(string: String, offset: Int, length: Int): Int = js.native + def write(string: String, offset: Int, encoding: String): Int = js.native + def write(string: String, offset: Int): Int = js.native + def write(string: String): Int = js.native /** * Writes value to buf at the specified offset with specified endian format (writeDoubleBE() writes big endian, @@ -509,7 +540,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeDoubleBE(value, offset[, noAssert]) }}} */ - def writeDoubleBE(value: Double, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeDoubleBE(value: Double, offset: Int, noAssert: Boolean): Int = js.native + def writeDoubleBE(value: Double, offset: Int): Int = js.native /** * Writes value to buf at the specified offset with specified endian format (writeDoubleBE() writes big endian, @@ -524,7 +556,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeDoubleLE(value, offset[, noAssert]) }}} */ - def writeDoubleLE(value: Double, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeDoubleLE(value: Double, offset: Int, noAssert: Boolean): Int = js.native + def writeDoubleLE(value: Double, offset: Int): Int = js.native /** * Writes value to buf at the specified offset with specified endian format (writeFloatBE() writes big endian, @@ -539,7 +572,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeFloatBE(value, offset[, noAssert]) }}} */ - def writeFloatBE(value: Float, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeFloatBE(value: Float, offset: Int, noAssert: Boolean): Int = js.native + def writeFloatBE(value: Float, offset: Int): Int = js.native /** * Writes value to buf at the specified offset with specified endian format (writeFloatBE() writes big endian, @@ -554,7 +588,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeFloatLE(value, offset[, noAssert]) }}} */ - def writeFloatLE(value: Float, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeFloatLE(value: Float, offset: Int, noAssert: Boolean): Int = js.native + def writeFloatLE(value: Float, offset: Int): Int = js.native /** * Writes value to buf at the specified offset. value should be a valid signed 8-bit integer. Behavior is @@ -570,7 +605,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeInt8(value, offset[, noAssert]) }}} */ - def writeInt8(value: Int, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeInt8(value: Int, offset: Int, noAssert: Boolean): Int = js.native + def writeInt8(value: Int, offset: Int): Int = js.native /** * Writes value to buf at the specified offset with specified endian format (writeInt16BE() writes big endian, @@ -587,7 +623,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeInt16BE(value, offset[, noAssert]) }}} */ - def writeInt16BE(value: Int, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeInt16BE(value: Int, offset: Int, noAssert: Boolean): Int = js.native + def writeInt16BE(value: Int, offset: Int): Int = js.native /** * Writes value to buf at the specified offset with specified endian format (writeInt16BE() writes big endian, @@ -604,7 +641,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeInt16BE(value, offset[, noAssert]) }}} */ - def writeInt16LE(value: Int, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeInt16LE(value: Int, offset: Int, noAssert: Boolean): Int = js.native + def writeInt16LE(value: Int, offset: Int): Int = js.native /** * Writes value to buf at the specified offset with specified endian format (writeInt32BE() writes big endian, @@ -621,7 +659,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeInt32BE(value, offset[, noAssert]) }}} */ - def writeInt32BE(value: Int, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeInt32BE(value: Int, offset: Int, noAssert: Boolean): Int = js.native + def writeInt32BE(value: Int, offset: Int): Int = js.native /** * Writes value to buf at the specified offset with specified endian format (writeInt32BE() writes big endian, @@ -638,7 +677,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeInt32BE(value, offset[, noAssert]) }}} */ - def writeInt32LE(value: Int, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeInt32LE(value: Int, offset: Int, noAssert: Boolean): Int = js.native + def writeInt32LE(value: Int, offset: Int): Int = js.native /** * Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. @@ -653,7 +693,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeIntBE(value, offset, byteLength[, noAssert]) }}} */ - def writeIntBE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean = js.native): Int = js.native + def writeIntBE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native + def writeIntBE(value: Int, offset: Int, byteLength: Int): Int = js.native /** * Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. @@ -668,7 +709,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeIntLE(value, offset, byteLength[, noAssert]) }}} */ - def writeIntLE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean = js.native): Int = js.native + def writeIntLE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native + def writeIntLE(value: Int, offset: Int, byteLength: Int): Int = js.native /** * Writes value to buf at the specified offset. value should be a valid unsigned 8-bit integer. Behavior @@ -682,7 +724,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeUInt8(value, offset[, noAssert]) }}} */ - def writeUInt8(value: Int, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeUInt8(value: Int, offset: Int, noAssert: Boolean): Int = js.native + def writeUInt8(value: Int, offset: Int): Int = js.native /** * Writes value to buf at the specified offset with specified endian format (writeUInt16BE() writes big endian, @@ -697,7 +740,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeUInt16BE(value, offset[, noAssert]) }}} */ - def writeUInt16BE(value: Int, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeUInt16BE(value: Int, offset: Int, noAssert: Boolean): Int = js.native + def writeUInt16BE(value: Int, offset: Int): Int = js.native /** * Writes value to buf at the specified offset with specified endian format (writeUInt16BE() writes big endian, @@ -712,7 +756,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeUInt16BE(value, offset[, noAssert]) }}} */ - def writeUInt16LE(value: Int, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeUInt16LE(value: Int, offset: Int, noAssert: Boolean): Int = js.native + def writeUInt16LE(value: Int, offset: Int): Int = js.native /** * Writes value to buf at the specified offset with specified endian format (writeUInt32BE() writes big endian, @@ -727,7 +772,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeUInt32BE(value, offset[, noAssert]) }}} */ - def writeUInt32BE(value: Int, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeUInt32BE(value: Int, offset: Int, noAssert: Boolean): Int = js.native + def writeUInt32BE(value: Int, offset: Int): Int = js.native /** * Writes value to buf at the specified offset with specified endian format (writeUInt32BE() writes big endian, @@ -742,7 +788,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeUInt32LE(value, offset[, noAssert]) }}} */ - def writeUInt32LE(value: Int, offset: Int, noAssert: Boolean = js.native): Int = js.native + def writeUInt32LE(value: Int, offset: Int, noAssert: Boolean): Int = js.native + def writeUInt32LE(value: Int, offset: Int): Int = js.native /** * Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. @@ -757,7 +804,8 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeUIntBE(value, offset, byteLength[, noAssert]) }}} */ - def writeUIntBE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean = js.native): Int = js.native + def writeUIntBE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native + def writeUIntBE(value: Int, offset: Int, byteLength: Int): Int = js.native /** * Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. @@ -772,31 +820,45 @@ class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor * @return the offset plus the number of bytes written * @example {{{ buf.writeUIntLE(value, offset, byteLength[, noAssert]) }}} */ - def writeUIntLE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean = js.native): Int = js.native + def writeUIntLE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native + def writeUIntLE(value: Int, offset: Int, byteLength: Int): Int = js.native /** * @see https://nodejs.org/api/buffer.html#buffer_buf_readbiguint64be_offset */ - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def readBigInt64BE(offset: Int = js.native): scalajs.js.BigInt = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def readBigInt64BE( + offset: Int + ): scalajs.js.BigInt = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def readBigInt64BE(): scalajs.js.BigInt = js.native /** * @see https://nodejs.org/api/buffer.html#buffer_buf_readbiguint64le_offset */ - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def readBigUInt64LE(offset: Int = js.native): scalajs.js.BigInt = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def readBigUInt64LE( + offset: Int + ): scalajs.js.BigInt = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def readBigUInt64LE(): scalajs.js.BigInt = + js.native /** * @see https://nodejs.org/api/buffer.html#buffer_buf_writebigint64be_value_offset */ - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def writeBigInt64BE(value: scalajs.js.BigInt, offset: Int = js.native): Int = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def writeBigInt64BE(value: scalajs.js.BigInt, + offset: Int + ): Int = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def writeBigInt64BE( + value: scalajs.js.BigInt + ): Int = js.native /** * @see https://nodejs.org/api/buffer.html#buffer_buf_writebigint64le_value_offset */ - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def writeBigInt64LE(value: scalajs.js.BigInt, offset: Int = js.native): Int = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def writeBigInt64LE(value: scalajs.js.BigInt, + offset: Int + ): Int = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def writeBigInt64LE( + value: scalajs.js.BigInt + ): Int = js.native } @js.native @@ -826,7 +888,11 @@ object Buffer extends js.Object { * * @see [[https://nodejs.org/api/buffer.html#buffer_class_method_buffer_alloc_size_fill_encoding]] */ - def alloc(size: Int, fill: Uint8Array | Int | String = js.native, encoding: String = js.native): Buffer = js.native + def alloc(size: Int, fill: String, encoding: String): Buffer = js.native + def alloc(size: Int, fill: String): Buffer = js.native + def alloc(size: Int, fill: Uint8Array): Buffer = js.native + def alloc(size: Int, fill: Int): Buffer = js.native + def alloc(size: Int): Buffer = js.native /** * Allocates a new `Buffer` of `size` bytes. @@ -879,7 +945,8 @@ object Buffer extends js.Object { * @see [[https://nodejs.org/api/buffer.html#buffer_class_method_buffer_concat_list_totallength]] * */ - def concat(list: js.Array[Buffer] | js.Array[Uint8Array], totalLength: Int = js.native): Buffer = js.native + def concat(list: js.Array[Buffer] | js.Array[Uint8Array], totalLength: Int): Buffer = js.native + def concat(list: js.Array[Buffer] | js.Array[Uint8Array]): Buffer = js.native /** * When passed a reference to the .buffer property of a TypedArray instance, the newly created Buffer @@ -887,7 +954,9 @@ object Buffer extends js.Object { * * @see [[https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length]] */ - def from(arrayBuffer: ArrayBuffer, byteOffset: Int = js.native, length: Int = js.native): Buffer = js.native + def from(arrayBuffer: ArrayBuffer, byteOffset: Int, length: Int): Buffer = js.native + def from(arrayBuffer: ArrayBuffer, byteOffset: Int): Buffer = js.native + def from(arrayBuffer: ArrayBuffer): Buffer = js.native /** * Copies the passed `buffer` data onto a new `Buffer` instance. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ChildProcess.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ChildProcess.scala index 227ee9c0f..5f7fa4d1d 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ChildProcess.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ChildProcess.scala @@ -15,9 +15,10 @@ import scala.scalajs.js.annotation.JSImport */ @js.native 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 + def kill(signal: js.UndefOr[KillSignal]): Unit = js.native + def kill(): Unit = js.native + def ref(): Unit = js.native + def unref(): Unit = js.native val channel: js.UndefOr[js.Object] = js.native val connected: Boolean = js.native @@ -32,11 +33,17 @@ trait ChildProcess extends IEventEmitter { @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 + sendHandle: Handle, + options: SendOptions, + callback: js.Function1[nodejs.Error, Any] + ): Boolean = js.native + def send(message: js.Any, sendHandle: Handle, options: SendOptions): Boolean = js.native + def send(message: js.Any, sendHandle: Handle, callback: js.Function1[nodejs.Error, Any]): Boolean = js.native + def send(message: js.Any, sendHandle: Handle): Boolean = js.native + def send(message: js.Any, callback: js.Function1[nodejs.Error, Any]): Boolean = js.native + def send(message: js.Any): Boolean = js.native } /** @@ -45,55 +52,41 @@ trait ForkedChildProcess extends ChildProcess { @JSImport("child_process", JSImport.Namespace) @js.native object ChildProcess extends scala.scalajs.js.Object { - def exec( - args: String, - options: ExecOptions = js.native, - callback: js.Function3[ - nodejs.Error, - Output, - Output, - Any - ] - ): ChildProcess = js.native + def exec(args: String, options: ExecOptions, callback: ExecCallback): ChildProcess = js.native + def exec(args: String, callback: ExecCallback): ChildProcess = js.native + def exec(args: String, options: ExecOptions): ChildProcess = js.native + def exec(args: String): ChildProcess = js.native - def execFile( - file: String, - args: js.Array[String] = js.native, - options: ExecOptions = js.native, - callback: js.Function3[ - nodejs.Error, - Output, - Output, - Any - ] - ): ChildProcess = js.native + def execFile(file: String, args: js.Array[String], options: ExecOptions, callback: ExecCallback): ChildProcess = + js.native + def execFile(file: String, args: js.Array[String], options: ExecOptions): ChildProcess = js.native + def execFile(file: String, args: js.Array[String], callback: ExecCallback): ChildProcess = js.native + def execFile(file: String, args: js.Array[String]): ChildProcess = js.native + def execFile(file: String, options: ExecOptions, callback: ExecCallback): ChildProcess = js.native + def execFile(file: String, options: ExecOptions): ChildProcess = js.native + def execFile(file: String, callback: ExecCallback): ChildProcess = js.native + def execFile(file: String): ChildProcess = js.native - def execSync( - command: String, - options: ExecOptions = js.native - ): Output = js.native + def execSync(command: String, options: ExecOptions): Output = js.native + def execSync(command: String): Output = js.native - def execFileSync( - file: String, - args: js.Array[String] = js.native, - options: ExecFileSyncOptions = js.native - ): Output = js.native + def execFileSync(file: String, args: js.Array[String], options: ExecFileSyncOptions): Output = js.native + def execFileSync(file: String, args: js.Array[String]): Output = js.native + def execFileSync(file: String, options: ExecFileSyncOptions): Output = js.native + def execFileSync(file: String): Output = js.native - def fork( - modulePath: String, - args: js.Array[String] = js.native, - options: ForkOptions = js.native - ): ForkedChildProcess = js.native + def fork(modulePath: String, args: js.Array[String], options: ForkOptions): ForkedChildProcess = js.native + def fork(modulePath: String, args: js.Array[String]): ForkedChildProcess = js.native + def fork(modulePath: String, options: ForkOptions): ForkedChildProcess = js.native + def fork(modulePath: String): ForkedChildProcess = js.native - def spawn( - command: String, - args: js.Array[String] = js.native, - options: SpawnOptions = js.native - ): ChildProcess = js.native + def spawn(command: String, args: js.Array[String], options: SpawnOptions): ChildProcess = js.native + def spawn(command: String, args: js.Array[String]): ChildProcess = js.native + def spawn(command: String, options: SpawnOptions): ChildProcess = js.native + def spawn(command: String): ChildProcess = js.native - def spawnSync( - command: String, - args: js.Array[String] = js.native, - options: SpawnSyncOptions = js.native - ): SpawnSyncResult = js.native + def spawnSync(command: String, args: js.Array[String], options: SpawnSyncOptions): SpawnSyncResult = js.native + def spawnSync(command: String, args: js.Array[String]): SpawnSyncResult = js.native + def spawnSync(command: String, options: SpawnSyncOptions): SpawnSyncResult = js.native + def spawnSync(command: String): SpawnSyncResult = js.native } diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/package.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/package.scala index 698286dcc..651e0c57d 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/package.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/package.scala @@ -14,7 +14,8 @@ package object child_process { type StdIo = String | js.Array[String] | js.Array[io.scalajs.nodejs.FileDescriptor] | js.Array[ String | io.scalajs.nodejs.FileDescriptor ] - type KillSignal = Int | String + type KillSignal = Int | String + type ExecCallback = js.Function3[nodejs.Error, Output, Output, Any] implicit final class ChildProcessObjectExtensions(private val cp: ChildProcess.type) extends AnyVal { @inline diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Cluster.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Cluster.scala index b65f4df20..21b9dd891 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Cluster.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Cluster.scala @@ -84,7 +84,8 @@ trait Cluster extends IEventEmitter { * This can only be called from the master process. * @example cluster.disconnect([callback]) */ - def disconnect(callback: js.Function = js.native): Unit = js.native + def disconnect(callback: js.Function): Unit = js.native + def disconnect(): Unit = js.native /** * Spawn a new worker process. @@ -92,7 +93,8 @@ trait Cluster extends IEventEmitter { * @return a new worker * @example cluster.fork([env]) */ - def fork(env: js.Any = js.native): Worker = js.native + def fork(env: js.Any): Worker = js.native + def fork(): Worker = js.native /** * setupMaster is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Worker.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Worker.scala index 54ba7aff6..f308f4295 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Worker.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Worker.scala @@ -88,7 +88,8 @@ trait Worker extends IEventEmitter { * @param signal the name of the kill signal to send to the worker process. * @example kill([signal='SIGTERM']) */ - def kill(signal: String = js.native): Unit = js.native + def kill(signal: String): Unit = js.native + def kill(): Unit = js.native /** * Send a message to a worker or master, optionally with a handle. @@ -96,5 +97,8 @@ trait Worker extends IEventEmitter { * In a worker this sends a message to the master. It is identical to process.send(). * @example worker.send(message[, sendHandle][, callback]) */ - def send(message: Message, sendHandle: Handle = js.native, callback: js.Function = js.native): Unit = js.native + def send(message: Message, sendHandle: Handle, callback: js.Function): Unit = js.native + def send(message: Message, callback: js.Function): Unit = js.native + def send(message: Message, sendHandle: Handle): Unit = js.native + def send(message: Message): Unit = js.native } diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/console_module/Console.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/console_module/Console.scala index e68c7f0cd..21558452e 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/console_module/Console.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/console_module/Console.scala @@ -26,8 +26,10 @@ import scala.scalajs.js.annotation.{JSGlobal, JSImport} @js.native @JSImport("console", "Console") class Console protected () extends js.Object { - def this(stdout: IWritable, stderr: IWritable = js.native, ignoreErrors: Boolean = true) = this() - + def this(stdout: IWritable, stderr: IWritable, ignoreErrors: Boolean) = this() + def this(stdout: IWritable, stderr: IWritable) = this() + def this(stdout: IWritable, ignoreErrors: Boolean) = this() + def this(stdout: IWritable) = this() def this(options: ConsoleOptions) = this() /** @@ -63,13 +65,15 @@ class Console protected () extends js.Object { * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`. * @param label The display label for the counter. Default: 'default'. */ - def count(label: String = js.native): Unit = js.native + def count(label: String): Unit = js.native + def count(): Unit = js.native /** * Resets the internal counter specific to `label`. * @param label The display label for the counter. Default: 'default'. */ - def countReset(label: String = js.native): Unit = js.native + def countReset(label: String): Unit = js.native + def countReset(): Unit = js.native /** * The `console.debug()` function is an alias for `console.log()`. @@ -82,7 +86,8 @@ class Console protected () extends js.Object { * Uses [[io.scalajs.nodejs.util.Util.inspect()]] on `obj` and prints the resulting string to `stdout`. * This function bypasses any custom `inspect()` function defined on `obj`. */ - def dir(obj: js.Any, options: ConsoleDirOptions = js.native): Unit = js.native + def dir(obj: js.Any, options: ConsoleDirOptions): Unit = js.native + def dir(obj: js.Any): Unit = js.native /** * This method calls[[log()]] passing it the arguments received. @@ -143,7 +148,8 @@ class Console protected () extends js.Object { * @param tabularData * @param properties Alternate properties for constructing the table. */ - def table(tabularData: js.Any, properties: js.Array[String] = js.native): Unit = js.native + def table(tabularData: js.Any, properties: js.Array[String]): Unit = js.native + def table(tabularData: js.Any): Unit = js.native /** * Starts a timer that can be used to compute the duration of an operation. @@ -152,12 +158,14 @@ class Console protected () extends js.Object { * `stdout`. * Timer durations are accurate to the sub-millisecond. */ - def time(label: String = js.native): Unit = js.native + def time(label: String): Unit = js.native + def time(): Unit = js.native /** * Stops a timer that was previously started by calling [[time()]] and prints the result to `stdout`. */ - def timeEnd(label: String = js.native): Unit = js.native + def timeEnd(label: String): Unit = js.native + def timeEnd(): Unit = js.native /** * Stops a timer that was previously started by calling [[time()]] and prints the result to `.stdout`.` @@ -180,7 +188,8 @@ class Console protected () extends js.Object { * The `console.profile()` method starts a JavaScript CPU profile with an optional label until [[profileEnd()]] is called. * The profile is then added to the **Profile** panel of the inspector. */ - def profile(label: String = js.native): Unit = js.native + def profile(label: String): Unit = js.native + def profile(): Unit = js.native /** * This method does not display anything unless used in the inspector. @@ -189,13 +198,15 @@ class Console protected () extends js.Object { * * If this method is called without a label, the most recently started profile is stopped. */ - def profileEnd(label: String = js.native): Unit = js.native + def profileEnd(label: String): Unit = js.native + def profileEnd(): Unit = js.native /** * This method does not display anything unless used in the inspector. * The `console.timeStamp()` method adds an event with the label `'label'` to the **Timeline** panel of the inspector. */ - def timeStamp(label: String = js.native): Unit = js.native + def timeStamp(label: String): Unit = js.native + def timeStamp(): Unit = js.native } /** diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Certificate.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Certificate.scala index b71c8d426..4393eaacb 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Certificate.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Certificate.scala @@ -11,7 +11,8 @@ import scala.scalajs.js.| object Certificate extends js.Object { def exportChallenge(spkac: String | BufferLike): Buffer = js.native - def exportPublicKey(spkac: String | BufferLike, encoding: String = js.native): Buffer = js.native + def exportPublicKey(spkac: String | BufferLike, encoding: String): Buffer = js.native + def exportPublicKey(spkac: String | BufferLike): Buffer = js.native def verifySpkac(spkac: BufferLike): Boolean = js.native } diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Cipher.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Cipher.scala index f716ea8b2..47e00e0a3 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Cipher.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Cipher.scala @@ -44,7 +44,8 @@ sealed trait Cipher extends Transform { * the value used for the additional authenticated data (AAD) input parameter. * @example cipher.setAAD(buffer) */ - def setAAD(buffer: Buffer, options: SetAADOptions = js.native): Cipher = js.native + def setAAD(buffer: Buffer, options: SetAADOptions): Cipher = js.native + def setAAD(buffer: Buffer): Cipher = js.native /** * When using an authenticated encryption mode (only GCM is currently supported), the cipher.getAuthTag() method @@ -66,7 +67,8 @@ sealed trait Cipher extends Transform { * The cipher.setAutoPadding() method must be called before cipher.final(). * @example cipher.setAutoPadding(auto_padding=true) */ - def setAutoPadding(auto_padding: Boolean = js.native): Cipher = js.native + def setAutoPadding(auto_padding: Boolean): Cipher = js.native + def setAutoPadding(): Cipher = js.native /** * Updates the cipher with data. If the input_encoding argument is given, it's value must be one of 'utf8', 'ascii', diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Crypto.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Crypto.scala index 479462767..b16e0b863 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Crypto.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Crypto.scala @@ -112,8 +112,9 @@ trait Crypto extends js.Object { * @param algorithm the given algorithm (e.g. 'sha256', 'sha512') */ @deprecated("Use CreateHashOptions instead.", "v0.12.0") - def createHash(algorithm: String, options: TransformOptions): Hash = js.native - def createHash(algorithm: String, options: CreateHashOptions = js.native): Hash = js.native + def createHash(algorithm: String, options: TransformOptions): Hash = js.native + def createHash(algorithm: String, options: CreateHashOptions): Hash = js.native + def createHash(algorithm: String): Hash = js.native /** * Creates and returns an Hmac object that uses the given algorithm and key. @@ -124,7 +125,8 @@ trait Crypto extends js.Object { * @param algorithm the given algorithm (e.g. 'sha256', 'sha512') * @param key The key is the HMAC key used to generate the cryptographic HMAC hash. */ - def createHmac(algorithm: String, key: String | BufferLike, options: TransformOptions = js.native): Hmac = js.native + def createHmac(algorithm: String, key: String | BufferLike, options: TransformOptions): Hmac = js.native + def createHmac(algorithm: String, key: String | BufferLike): Hmac = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def createHmac(algorithm: String, key: KeyObject, options: TransformOptions): Hmac = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) @@ -144,14 +146,16 @@ trait Crypto extends js.Object { * list-public-key-algorithms will display the available signing algorithms. One example is 'RSA-SHA256'. * @param algorithm the given algorithm (e.g. 'RSA-SHA256') */ - def createSign(algorithm: String, options: WritableOptions = js.native): Sign = js.native + def createSign(algorithm: String, options: WritableOptions): Sign = js.native + def createSign(algorithm: String): Sign = js.native /** * Creates and returns a Verify object that uses the given algorithm. On recent OpenSSL releases, openssl * list-public-key-algorithms will display the available signing algorithms. One example is 'RSA-SHA256'. * @param algorithm the given algorithm (e.g. 'RSA-SHA256') */ - def createVerify(algorithm: String, options: WritableOptions = js.native): Verify = js.native + def createVerify(algorithm: String, options: WritableOptions): Verify = js.native + def createVerify(algorithm: String): Verify = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs14) def diffieHellman(options: DiffieHellmanOptions): Buffer = js.native @@ -238,10 +242,10 @@ trait Crypto extends js.Object { def randomFillSync(buffer: scala.scalajs.js.typedarray.DataView, offset: Int): scala.scalajs.js.typedarray.DataView = js.native def randomFillSync(buffer: scala.scalajs.js.typedarray.DataView): scala.scalajs.js.typedarray.DataView = js.native - def randomFillSync[T <: scala.scalajs.js.typedarray.TypedArray[_, T]](buffer: T, - offset: Int = js.native, - size: Int = js.native - ): T = js.native + def randomFillSync[T <: scala.scalajs.js.typedarray.TypedArray[_, T]](buffer: T, offset: Int, size: Int): T = + js.native + def randomFillSync[T <: scala.scalajs.js.typedarray.TypedArray[_, T]](buffer: T, offset: Int): T = js.native + def randomFillSync[T <: scala.scalajs.js.typedarray.TypedArray[_, T]](buffer: T): T = js.native def randomFill(buffer: Buffer, offset: Int, size: Int, callback: Callback1[Buffer]): Buffer = js.native def randomFill(buffer: Buffer, offset: Int, callback: Callback1[Buffer]): Buffer = js.native @@ -263,35 +267,52 @@ trait Crypto extends js.Object { ): scala.scalajs.js.typedarray.DataView = js.native def randomFill[T <: scala.scalajs.js.typedarray.TypedArray[_, T]](buffer: T, - offset: Int = js.native, - size: Int = js.native, + offset: Int, + size: Int, callback: Callback1[T] ): T = js.native + def randomFill[T <: scala.scalajs.js.typedarray.TypedArray[_, T]](buffer: T, offset: Int, callback: Callback1[T]): T = + js.native + def randomFill[T <: scala.scalajs.js.typedarray.TypedArray[_, T]](buffer: T, callback: Callback1[T]): T = js.native def scrypt(password: String | BufferLike, salt: String | BufferLike, keylen: Int, - options: ScryptOptions = js.native, + options: ScryptOptions, callback: Callback1[Buffer] ): Unit = js.native + def scrypt(password: String | BufferLike, salt: String | BufferLike, keylen: Int, callback: Callback1[Buffer]): Unit = + js.native def scryptSync(password: String | BufferLike, salt: String | BufferLike, keylen: Int, - options: ScryptOptions = js.native - ): Buffer = js.native + options: ScryptOptions + ): Buffer = js.native + def scryptSync(password: String | BufferLike, salt: String | BufferLike, keylen: Int): Buffer = js.native - def setEngine(engine: String, fips: Int = js.native): Unit = js.native + def setEngine(engine: String, fips: Int): Unit = js.native + def setEngine(engine: String): Unit = js.native def setFips(enable: Boolean): Unit = js.native - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def sign(algorithm: String = js.native, data: BufferLike, key: String | Buffer | KeyObject): Buffer = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def sign(algorithm: String, + data: BufferLike, + key: String | Buffer | KeyObject + ): Buffer = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def sign(data: BufferLike, + key: String | Buffer | KeyObject + ): Buffer = js.native def timingSafeEqual(a: BufferLike, b: BufferLike): Boolean = js.native - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def verify(algorithm: String = js.native, data: BufferLike, key: String | Buffer | KeyObject): Boolean = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def verify(algorithm: String, + data: BufferLike, + key: String | Buffer | KeyObject + ): Boolean = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def verify(data: BufferLike, + key: String | Buffer | KeyObject + ): Boolean = js.native } /** diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Sign.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Sign.scala index 1aa83c551..7312fc2b7 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Sign.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Sign.scala @@ -26,6 +26,7 @@ sealed trait Sign extends Writable { @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def sign(privateKey: KeyObject, outputEncoding: String): String = js.native - def update(data: String, inputEncoding: String = js.native): Unit = js.native - def update(data: BufferLike): Unit = js.native + def update(data: String, inputEncoding: String): Unit = js.native + def update(data: String): Unit = js.native + def update(data: BufferLike): Unit = js.native } diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Verify.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Verify.scala index 5775fc657..66c3fbb8f 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Verify.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/crypto/Verify.scala @@ -27,8 +27,9 @@ trait Verify extends Writable { * 'utf8', 'ascii' or 'binary'. If encoding is not provided, and the data is a string, an * encoding of 'utf8' is enforced. If data is a Buffer then input_encoding is ignored. */ - def update(data: String, inputEncoding: String = js.native): Unit = js.native - def update(data: BufferLike): Unit = js.native + def update(data: String, inputEncoding: String): Unit = js.native + def update(data: String): Unit = js.native + def update(data: BufferLike): Unit = js.native /** * Verifies the provided data using the given object and signature. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/dgram/Dgram.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/dgram/Dgram.scala index 58f767152..604ad1f44 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/dgram/Dgram.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/dgram/Dgram.scala @@ -7,9 +7,10 @@ import scala.scalajs.js.annotation.JSImport @js.native trait Dgram extends js.Object { - def createSocket(options: SocketOptions, callback: js.Function = js.native): Socket = js.native - def createSocket(`type`: String, callback: js.Function): Socket = js.native - def createSocket(`type`: String): Socket = js.native + def createSocket(options: SocketOptions, callback: js.Function): Socket = js.native + def createSocket(options: SocketOptions): Socket = js.native + def createSocket(`type`: String, callback: js.Function): Socket = js.native + def createSocket(`type`: String): Socket = js.native } @Factory diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/dgram/Socket.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/dgram/Socket.scala index 1112f9ec6..ed4b65412 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/dgram/Socket.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/dgram/Socket.scala @@ -28,7 +28,8 @@ class Socket private[this] () extends IEventEmitter { * @param multicastInterface the multicast interface * @example addMembership(multicastAddress[, multicastInterface]) */ - def addMembership(multicastAddress: String, multicastInterface: String = js.native): Unit = js.native + def addMembership(multicastAddress: String, multicastInterface: String): Unit = js.native + def addMembership(multicastAddress: String): Unit = js.native /** * Returns an object containing the address information for a socket. For UDP sockets, @@ -64,17 +65,28 @@ class Socket private[this] () extends IEventEmitter { * @param callback the callback * @example bind(options[, callback]) */ - def bind(options: BindOptions, callback: js.Function = js.native): Unit = js.native + def bind(options: BindOptions, callback: js.Function): Unit = js.native + def bind(options: BindOptions): Unit = js.native - def close(callback: js.Function = js.native): Unit = js.native + def close(callback: js.Function): Unit = js.native + def close(): Unit = js.native - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def connect(port: Int, address: String = js.native, callback: js.Function0[Any] = js.native): Unit = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def connect(port: Int, + address: String, + callback: js.Function0[Any] + ): Unit = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def connect(port: Int, address: String): Unit = + js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def connect(port: Int, + callback: js.Function0[Any] + ): Unit = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def connect(port: Int): Unit = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def disconnect(): Unit = js.native - def dropMembership(multicastAddress: String, multicastInterface: String = js.native): Unit = js.native + def dropMembership(multicastAddress: String, multicastInterface: String): Unit = js.native + def dropMembership(multicastAddress: String): Unit = js.native def getRecvBufferSize(): Int = js.native def getSendBufferSize(): Int = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/dns/PromisesResolver.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/dns/PromisesResolver.scala index 743dc63ec..1bd00eb14 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/dns/PromisesResolver.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/dns/PromisesResolver.scala @@ -9,18 +9,20 @@ class PromisesResolver extends js.Object { def getServers(): js.Array[String] = js.native def setServers(servers: js.Array[String]): Unit = js.native - def resolve(hostname: String, rrtype: RRType): js.Promise[ResolveResult] = js.native - def resolve(hostname: String): js.Promise[js.Array[String]] = js.native - def resolve4(hostname: String, options: TtlOptions = js.native): js.Promise[js.Array[String]] = js.native - def resolve6(hostname: String, options: TtlOptions = js.native): js.Promise[js.Array[String]] = js.native - def resolveAny(hostname: String): js.Promise[js.Array[ResolveObject]] = js.native - def resolveCname(hostname: String): js.Promise[js.Array[String]] = js.native - def resolveMx(hostname: String): js.Promise[js.Array[MX]] = js.native - def resolveNaptr(hostname: String): js.Promise[js.Array[NAPTR]] = js.native - def resolveNs(hostname: String): js.Promise[js.Array[String]] = js.native - def resolveSoa(hostname: String): js.Promise[js.Array[SOA]] = js.native - def resolveSrv(hostname: String): js.Promise[js.Array[SRV]] = js.native - def resolvePtr(hostname: String): js.Promise[js.Array[String]] = js.native - def resolveTxt(hostname: String): js.Promise[js.Array[String]] = js.native - def reverse(ipAddress: String): js.Promise[js.Array[String]] = js.native + def resolve(hostname: String, rrtype: RRType): js.Promise[ResolveResult] = js.native + def resolve(hostname: String): js.Promise[js.Array[String]] = js.native + def resolve4(hostname: String, options: TtlOptions): js.Promise[js.Array[String]] = js.native + def resolve4(hostname: String): js.Promise[js.Array[String]] = js.native + def resolve6(hostname: String, options: TtlOptions): js.Promise[js.Array[String]] = js.native + def resolve6(hostname: String): js.Promise[js.Array[String]] = js.native + def resolveAny(hostname: String): js.Promise[js.Array[ResolveObject]] = js.native + def resolveCname(hostname: String): js.Promise[js.Array[String]] = js.native + def resolveMx(hostname: String): js.Promise[js.Array[MX]] = js.native + def resolveNaptr(hostname: String): js.Promise[js.Array[NAPTR]] = js.native + def resolveNs(hostname: String): js.Promise[js.Array[String]] = js.native + def resolveSoa(hostname: String): js.Promise[js.Array[SOA]] = js.native + def resolveSrv(hostname: String): js.Promise[js.Array[SRV]] = js.native + def resolvePtr(hostname: String): js.Promise[js.Array[String]] = js.native + def resolveTxt(hostname: String): js.Promise[js.Array[String]] = js.native + def reverse(ipAddress: String): js.Promise[js.Array[String]] = js.native } diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/events/EventEmitter.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/events/EventEmitter.scala index 511e6f661..0bb29ded2 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/events/EventEmitter.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/events/EventEmitter.scala @@ -118,7 +118,8 @@ trait IEventEmitter extends js.Object { *

Returns a reference to the EventEmitter so calls can be chained. * @example emitter.removeAllListeners([eventName]) */ - def removeAllListeners(eventName: String = js.native): this.type = js.native + def removeAllListeners(eventName: String): this.type = js.native + def removeAllListeners(): this.type = js.native /** * Removes the specified listener from the listener array for the event named eventName. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/fs/Fs.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/fs/Fs.scala index 223625e39..f47df1e3a 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/fs/Fs.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/fs/Fs.scala @@ -76,7 +76,8 @@ trait Fs extends js.Object with FSConstants { * @param mode the optional mode * @example fs.accessSync(path[, mode]) */ - def accessSync(path: Path, mode: FileMode = js.native): Unit = js.native + def accessSync(path: Path, mode: FileMode): Unit = js.native + def accessSync(path: Path): Unit = js.native /** * Asynchronously append data to a file, creating the file if it does not yet exist. data can be a string or a buffer. @@ -108,8 +109,8 @@ trait Fs extends js.Object with FSConstants { * @param options the [[FileAppendOptions optional append settings]] * @return undefined. */ - def appendFileSync(path: Path | FileDescriptor, data: Buffer | String, options: FileAppendOptions = js.native): Unit = - js.native + def appendFileSync(path: Path | FileDescriptor, data: Buffer | String, options: FileAppendOptions): Unit = js.native + def appendFileSync(path: Path | FileDescriptor, data: Buffer | String): Unit = js.native /** * Asynchronous chmod(2). No arguments other than a possible exception are given to the completion callback. @@ -213,8 +214,8 @@ trait Fs extends js.Object with FSConstants { * @param options the optional stream options * @example fs.createReadStream(path[, options]) */ - def createReadStream(path: Path, options: FileInputOptions = js.native): ReadStream = - js.native + def createReadStream(path: Path, options: FileInputOptions): ReadStream = js.native + def createReadStream(path: Path): ReadStream = js.native /** * Returns a new WriteStream object. @@ -222,8 +223,8 @@ trait Fs extends js.Object with FSConstants { * @param options the optional stream options * @example fs.createWriteStream(path[, options]) */ - def createWriteStream(path: Path, options: FileOutputOptions = js.native): WriteStream = - js.native + def createWriteStream(path: Path, options: FileOutputOptions): WriteStream = js.native + def createWriteStream(path: Path): WriteStream = js.native /** * fs.exists() should not be used to check if a file exists before calling fs.open(). Doing so introduces a race @@ -292,7 +293,8 @@ trait Fs extends js.Object with FSConstants { * @param fd the file descriptor * @return an instance of [[fs.Stats]]. */ - def fstatSync(fd: FileDescriptor, options: StatOptions = js.native): StatsVariant = js.native + def fstatSync(fd: FileDescriptor, options: StatOptions): StatsVariant = js.native + def fstatSync(fd: FileDescriptor): StatsVariant = js.native /** * Asynchronous fsync(2). No arguments other than a possible exception are given to the completion callback. @@ -447,7 +449,8 @@ trait Fs extends js.Object with FSConstants { * @param path the path * @param mode the mode */ - def mkdirSync(path: Path, mode: FileMode = js.native): Unit = js.native + def mkdirSync(path: Path, mode: FileMode): Unit = js.native + def mkdirSync(path: Path): Unit = js.native /** * @return After Node.js v13.11.0, in recursive mode, the first created path is returned now. Otherwise undefined @@ -487,7 +490,8 @@ trait Fs extends js.Object with FSConstants { * @param prefix the prefix * @param options the optional encoding setting */ - def mkdtempSync(prefix: String, options: String | FileEncodingOptions = js.native): String = js.native + def mkdtempSync(prefix: String, options: String | FileEncodingOptions): String = js.native + def mkdtempSync(prefix: String): String = js.native /** * Asynchronous file open. See open(2). @@ -559,7 +563,8 @@ trait Fs extends js.Object with FSConstants { * @return an integer representing the file descriptor. * @example fs.openSync(path, flags[, mode]) */ - def openSync(path: Path, flags: Flags, mode: FileMode = js.native): FileDescriptor = js.native + def openSync(path: Path, flags: Flags, mode: FileMode): FileDescriptor = js.native + def openSync(path: Path, flags: Flags): FileDescriptor = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def openSync(path: Path): FileDescriptor = js.native @@ -570,8 +575,10 @@ trait Fs extends js.Object with FSConstants { @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def opendir(path: Path, callback: FsCallback1[Fs.Dir]): Unit = js.native - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def opendirSync(path: Path, options: OpendirOptions = js.native): Fs.Dir = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def opendirSync(path: Path, + options: OpendirOptions + ): Fs.Dir = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def opendirSync(path: Path): Fs.Dir = js.native /** * Read data from the file specified by fd. @@ -659,7 +666,9 @@ trait Fs extends js.Object with FSConstants { * to 'buffer', the filenames returned will be passed as Buffer objects. * @return an array of filenames excluding '.' and '..'. */ - def readdirSync(path: Path, options: String | ReaddirOptions = js.native): js.Array[String] = js.native + def readdirSync(path: Path, options: String): js.Array[String] = js.native + def readdirSync(path: Path, options: ReaddirOptions): js.Array[String] = js.native + def readdirSync(path: Path): js.Array[String] = js.native /** * Asynchronously reads the entire contents of a file. @@ -709,7 +718,7 @@ trait Fs extends js.Object with FSConstants { * Otherwise it returns a buffer. * @example fs.readFileSync(file[, options]) */ - def readFileSync(file: Path | FileDescriptor, options: ReadFileOptions = js.native): Output = js.native + def readFileSync(file: Path | FileDescriptor, options: ReadFileOptions): Output = js.native /** * Synchronous version of fs.readFile. @@ -780,8 +789,8 @@ trait Fs extends js.Object with FSConstants { * @return the resolved path. * @example fs.realpathSync(path[, options]) */ - def realpathSync(path: Path, options: FileEncodingOptions = js.native): Output = js.native - def realpathSync(path: Path): String = js.native + def realpathSync(path: Path, options: FileEncodingOptions): Output = js.native + def realpathSync(path: Path): String = js.native val realpath: RealpathObject = js.native @@ -862,8 +871,8 @@ trait Fs extends js.Object with FSConstants { * @return undefined. * @example fs.symlinkSync(target, path[, type]) */ - def symlinkSync(target: Path, path: Path, `type`: String = js.native): Unit = - js.native + def symlinkSync(target: Path, path: Path, `type`: String): Unit = js.native + def symlinkSync(target: Path, path: Path): Unit = js.native /** * Asynchronous truncate(2). No arguments other than a possible exception are given to the completion callback. @@ -884,7 +893,8 @@ trait Fs extends js.Object with FSConstants { * @return undefined. * @example fs.truncateSync(path, length) */ - def truncateSync(path: Path, length: Int = js.native): Unit = js.native + def truncateSync(path: Path, length: Int): Unit = js.native + def truncateSync(path: Path): Unit = js.native /** * Asynchronous unlink(2). No arguments other than a possible exception are given to the completion callback. @@ -909,7 +919,8 @@ trait Fs extends js.Object with FSConstants { * fs.watchFile() and fs.unwatchFile() when possible. * @example fs.unwatchFile(filename[, listener]) */ - def unwatchFile(path: Path, listener: FsCallback0 = js.native): Unit = js.native + def unwatchFile(path: Path, listener: FsCallback0): Unit = js.native + def unwatchFile(path: Path): Unit = js.native /** * Change file timestamps of the file referenced by the supplied path. @@ -979,7 +990,8 @@ trait Fs extends js.Object with FSConstants { * @return a [[FSWatcher]] * @example fs.watch(filename[, options][, listener]) */ - def watch(filename: Path, options: FSWatcherOptions = js.native): FSWatcher = js.native + def watch(filename: Path, options: FSWatcherOptions): FSWatcher = js.native + def watch(filename: Path): FSWatcher = js.native /** * Watch for changes on filename. The callback listener will be called each time the file is accessed. @@ -1164,35 +1176,46 @@ object Fs extends Fs { options: FileAppendOptions | String = js.native ): js.Promise[Unit] = js.native - def chmod(path: Path, mode: FileMode): js.Promise[Unit] = js.native - def chown(path: Path, uid: UID, gid: GID): js.Promise[Unit] = js.native - def copyFile(src: Path, target: Path, flag: Int): js.Promise[Unit] = js.native - def lchmod(path: Path, mode: FileMode): js.Promise[Unit] = js.native - def lchown(path: Path, uid: UID, gid: GID): js.Promise[Unit] = js.native - def link(existingPath: Path, newPath: Path): js.Promise[Unit] = js.native - def lstat(path: Path, options: StatOptions): js.Promise[StatsVariant] = js.native - def mkdir(path: Path, options: MkdirOptions = js.native): js.Promise[Unit] = js.native - def mkdir(path: Path, mode: FileMode): js.Promise[Unit] = js.native - def mkdtemp(prefix: String, options: FileEncodingOptions): js.Promise[String] = js.native - def mkdtemp(prefix: String, encoding: String = js.native): js.Promise[String] = js.native - def open(path: Path, flags: Flags, mode: FileMode = js.native): js.Promise[FileHandle] = js.native + def chmod(path: Path, mode: FileMode): js.Promise[Unit] = js.native + def chown(path: Path, uid: UID, gid: GID): js.Promise[Unit] = js.native + def copyFile(src: Path, target: Path, flag: Int): js.Promise[Unit] = js.native + def lchmod(path: Path, mode: FileMode): js.Promise[Unit] = js.native + def lchown(path: Path, uid: UID, gid: GID): js.Promise[Unit] = js.native + def link(existingPath: Path, newPath: Path): js.Promise[Unit] = js.native + def lstat(path: Path, options: StatOptions): js.Promise[StatsVariant] = js.native + def mkdir(path: Path, options: MkdirOptions): js.Promise[Unit] = js.native + def mkdir(path: Path): js.Promise[Unit] = js.native + def mkdir(path: Path, mode: FileMode): js.Promise[Unit] = js.native + def mkdtemp(prefix: String, options: FileEncodingOptions): js.Promise[String] = js.native + def mkdtemp(prefix: String, encoding: String): js.Promise[String] = js.native + def mkdtemp(prefix: String): js.Promise[String] = js.native + def open(path: Path, flags: Flags, mode: FileMode): js.Promise[FileHandle] = js.native + def open(path: Path, flags: Flags): js.Promise[FileHandle] = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def open(path: Path): js.Promise[FileHandle] = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def opendir(path: Path, + options: OpendirOptions + ): js.Promise[Dir] = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def opendir(path: Path): js.Promise[Dir] = + js.native + def readdir(path: Path, options: ReaddirOptions): js.Promise[js.Array[String] | js.Array[Dirent]] = js.native + def readdir(path: Path, encoding: String): js.Promise[js.Array[String]] = js.native + def readdir(path: Path, options: FileEncodingOptions): js.Promise[js.Array[String]] = js.native + def readdir(path: Path): js.Promise[js.Array[String]] = js.native + def readlink(path: Path): js.Promise[String] = js.native + def readlink(path: Path, options: String | FileEncodingOptions): js.Promise[Output] = js.native + def rename(oldPath: Path, newPath: Path): js.Promise[Unit] = js.native + def rmdir(path: Path): js.Promise[Unit] = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def opendir(path: Path, options: OpendirOptions = js.native): js.Promise[Dir] = js.native - def readdir(path: Path, options: ReaddirOptions): js.Promise[js.Array[String] | js.Array[Dirent]] = js.native - def readdir(path: Path, options: String | FileEncodingOptions = js.native): js.Promise[js.Array[String]] = js.native - def readlink(path: Path): js.Promise[String] = js.native - def readlink(path: Path, options: String | FileEncodingOptions): js.Promise[Output] = js.native - def rename(oldPath: Path, newPath: Path): js.Promise[Unit] = js.native - def rmdir(path: Path): js.Promise[Unit] = js.native - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def rmdir(path: Path, options: RmdirOptions): js.Promise[Unit] = js.native - def stat(path: Path, options: StatOptions = js.native): js.Promise[StatsVariant] = js.native - def symlink(target: Path, path: Path, `type`: String = js.native): js.Promise[Unit] = js.native - def truncate(path: Path, length: Int = js.native): js.Promise[Unit] = js.native - def unlink(path: Path): js.Promise[Unit] = js.native - def utimes(path: Path, atime: Time, mtime: Time): js.Promise[Unit] = js.native + def rmdir(path: Path, options: RmdirOptions): js.Promise[Unit] = js.native + def stat(path: Path, options: StatOptions): js.Promise[StatsVariant] = js.native + def stat(path: Path): js.Promise[StatsVariant] = js.native + def symlink(target: Path, path: Path, `type`: String): js.Promise[Unit] = js.native + def symlink(target: Path, path: Path): js.Promise[Unit] = js.native + def truncate(path: Path, length: Int): js.Promise[Unit] = js.native + def truncate(path: Path): js.Promise[Unit] = js.native + def unlink(path: Path): js.Promise[Unit] = js.native + def utimes(path: Path, atime: Time, mtime: Time): js.Promise[Unit] = js.native def writeFile(file: Path | FileHandle, data: String | BufferLike, options: FileWriteOptions): js.Promise[Unit] = js.native } @@ -1201,18 +1224,19 @@ object Fs extends Fs { trait FileHandle extends js.Object { val fd: FileDescriptor = js.native - def appendFile(data: String | Buffer, options: FileAppendOptions = js.native): js.Promise[Unit] = js.native - def chmod(mode: FileMode): js.Promise[Unit] = js.native - def chown(uid: UID, gid: GID): js.Promise[Unit] = js.native - def close(): js.Promise[Unit] = js.native - def datasync(): js.Promise[Unit] = js.native + def appendFile(data: String | Buffer, options: FileAppendOptions): js.Promise[Unit] = js.native + def appendFile(data: String | Buffer): js.Promise[Unit] = js.native + def chmod(mode: FileMode): js.Promise[Unit] = js.native + def chown(uid: UID, gid: GID): js.Promise[Unit] = js.native + def close(): js.Promise[Unit] = js.native + def datasync(): js.Promise[Unit] = js.native def read[T <: js.typedarray.TypedArray[_, _]](buffer: T, offset: Int | Null, length: Int | Null, position: Int | Null ): js.Promise[BufferIOResult[T]] = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs14) - def readd[T <: js.typedarray.TypedArray[_, _]](options: ReadOptions): js.Promise[BufferIOResult[T]] = js.native + def read[T <: js.typedarray.TypedArray[_, _]](options: ReadOptions): js.Promise[BufferIOResult[T]] = js.native def readFile(): js.Promise[Buffer] = js.native def readFile(encoding: String): js.Promise[String] = js.native @@ -1310,7 +1334,8 @@ trait OpendirOptions extends js.Object { @Factory trait ReadFileOptions extends js.Object { - var flag: js.UndefOr[String] = js.undefined + var encoding: js.UndefOr[String] = js.undefined + var flag: js.UndefOr[String] = js.undefined } @Factory diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/Agent.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/Agent.scala index e1ff55e1b..8732a567e 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/Agent.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/Agent.scala @@ -15,7 +15,9 @@ import scala.scalajs.js.annotation.JSImport */ @js.native @JSImport("http", "Agent") -class Agent(options: AgentOptions = js.native) extends IEventEmitter { +class Agent(options: AgentOptions) extends IEventEmitter { + def this() = this(???) + ///////////////////////////////////////////////////////////////////////////////// // Properties ///////////////////////////////////////////////////////////////////////////////// diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/ClientRequest.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/ClientRequest.scala index ef785409c..1b1a555b5 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/ClientRequest.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/ClientRequest.scala @@ -84,13 +84,17 @@ class ClientRequest extends stream.Writable { /** * Once a socket is assigned to this request and is connected socket.setNoDelay() will be called. */ - def setNoDelay(noDelay: Boolean = js.native): Unit = js.native + def setNoDelay(noDelay: Boolean): Unit = js.native + def setNoDelay(): Unit = js.native /** * Once a socket is assigned to this request and is connected socket.setKeepAlive() will be called. * @see [[https://nodejs.org/api/http.html#http_request_setsocketkeepalive_enable_initialdelay]] */ - def setSocketKeepAlive(enable: Boolean = js.native, initialDelay: Int = js.native): Unit = js.native + def setSocketKeepAlive(enable: Boolean, initialDelay: Int): Unit = js.native + def setSocketKeepAlive(enable: Boolean): Unit = js.native + def setSocketKeepAlive(initialDelay: Int): Unit = js.native + def setSocketKeepAlive(): Unit = js.native /** * Once a socket is assigned to this request and is connected socket.setTimeout() will be called. @@ -100,7 +104,8 @@ class ClientRequest extends stream.Writable { * Same as binding to the timeout event. * */ - def setTimeout(timeout: Int, callback: js.Function = js.native): Unit = js.native + def setTimeout(timeout: Int, callback: js.Function): Unit = js.native + def setTimeout(timeout: Int): Unit = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def reusedSocket: Boolean = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/Http.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/Http.scala index dddd43630..67d6cdc2e 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/Http.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/Http.scala @@ -44,12 +44,12 @@ trait Http extends js.Object { def createServer(options: ServerOptions, requestListener: js.Function2[ClientRequest, ServerResponse, Any]): Server = js.native - def createServer(requestListener: js.Function2[ClientRequest, ServerResponse, Any] = js.native): Server = js.native + def createServer(requestListener: js.Function2[ClientRequest, ServerResponse, Any]): Server = js.native + def createServer(): Server = js.native - def get(url: String | URL, - options: RequestOptions, - callback: js.Function1[ServerResponse, Any] = js.native - ): ClientRequest = js.native + def get(url: String | URL, options: RequestOptions, callback: js.Function1[ServerResponse, Any]): ClientRequest = + js.native + def get(url: String | URL, options: RequestOptions): ClientRequest = js.native def get(url: String | URL, callback: js.Function1[ServerResponse, Any]): ClientRequest = js.native def get(url: String | URL): ClientRequest = js.native def get(options: RequestOptions): ClientRequest = js.native @@ -58,14 +58,12 @@ trait Http extends js.Object { @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def maxHeaderSize: Int = js.native - def request(url: String | URL, - options: RequestOptions, - callback: js.Function1[ServerResponse, Any] = js.native - ): Unit = js.native - def request(url: String | URL, callback: js.Function1[ServerResponse, Any]): Unit = js.native - def request(url: String | URL): Unit = js.native - def request(options: RequestOptions): Unit = js.native - def request(options: RequestOptions, callback: js.Function1[ServerResponse, Any]): Unit = js.native + def request(url: String | URL, options: RequestOptions): Unit = js.native + def request(url: String | URL, options: RequestOptions, callback: js.Function1[ServerResponse, Any]): Unit = js.native + def request(url: String | URL, callback: js.Function1[ServerResponse, Any]): Unit = js.native + def request(url: String | URL): Unit = js.native + def request(options: RequestOptions): Unit = js.native + def request(options: RequestOptions, callback: js.Function1[ServerResponse, Any]): Unit = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs14) def validateHeaderName(name: String): Unit = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/IncomingMessage.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/IncomingMessage.scala index da178be30..97731f98d 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/IncomingMessage.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/IncomingMessage.scala @@ -21,7 +21,8 @@ class IncomingMessage extends stream.Readable { def complete: Boolean = js.native - def destroy(error: io.scalajs.nodejs.Error = js.native): Unit = js.native + def destroy(error: io.scalajs.nodejs.Error): Unit = js.native + def destroy(): Unit = js.native /** * The request/response headers object. Key-value pairs of header names and values. Header names are lower-cased. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/ServerResponse.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/ServerResponse.scala index 3514de7e9..e44758dcd 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/ServerResponse.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http/ServerResponse.scala @@ -113,7 +113,8 @@ trait ServerResponse extends stream.Writable { * * Returns response. */ - def setTimeout(msecs: Int, callback: js.Function = js.native): Unit = js.native + def setTimeout(msecs: Int, callback: js.Function): Unit = js.native + def setTimeout(msecs: Int): Unit = js.native def status(statusCode: Int): this.type = js.native @@ -126,10 +127,10 @@ trait ServerResponse extends stream.Writable { def writeContinue(): Unit = js.native // Todo: Return this.type when Node.js v10 dropped - def writeHead(statusCode: Int, statusMessage: String, headers: js.Object | js.Dictionary[_] = js.native): Unit = - js.native - def writeHead(statusCode: Int, headers: js.Object | js.Dictionary[_]): Unit = js.native - def writeHead(statusCode: Int): Unit = js.native + def writeHead(statusCode: Int, statusMessage: String, headers: js.Object | js.Dictionary[_]): Unit = js.native + def writeHead(statusCode: Int, statusMessage: String): Unit = js.native + def writeHead(statusCode: Int, headers: js.Object | js.Dictionary[_]): Unit = js.native + def writeHead(statusCode: Int): Unit = js.native def writeProcessing(): Unit = js.native } diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/ClientHttp2Session.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/ClientHttp2Session.scala index 52b7c6ec6..da385b3aa 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/ClientHttp2Session.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/ClientHttp2Session.scala @@ -4,5 +4,6 @@ import scala.scalajs.js @js.native trait ClientHttp2Session extends Http2Session { - def request(headers: Http2Headers, options: Http2RequestOptions = js.native): ClientHttp2Stream = js.native + def request(headers: Http2Headers, options: Http2RequestOptions): ClientHttp2Stream = js.native + def request(headers: Http2Headers): ClientHttp2Stream = js.native } diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2ServerRequest.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2ServerRequest.scala index 0e70bdb38..3df5acad8 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2ServerRequest.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2ServerRequest.scala @@ -22,7 +22,8 @@ class Http2ServerRequest extends stream.Readable with Http2TimeoutOps { @deprecated("Use socket", "Node.js v13.0.0") def connection: net.Socket | tls.TLSSocket = js.native - def destroy(error: io.scalajs.nodejs.Error = js.native): Unit = js.native + def destroy(error: io.scalajs.nodejs.Error): Unit = js.native + def destroy(): Unit = js.native def headers: Http2Headers = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2ServerResponse.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2ServerResponse.scala index e8267e98d..a41eaf81f 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2ServerResponse.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2ServerResponse.scala @@ -17,11 +17,6 @@ class Http2ServerResponse extends stream.Writable with Http2TimeoutOps { def socket: net.Socket | tls.TLSSocket = js.native def stream: Http2Stream = js.native - def end(): js.UndefOr[this.type] = js.native - - def write(chunk: String | Buffer): Boolean = js.native - def write(chunk: String, encoding: String, callback: js.Function1[Error, Any]): Boolean = js.native - def writeHead(statusCode: Int, statusMessage: String, http2Headers: Http2Headers): Unit = js.native def writeHead(statusCode: Int, http2Headers: Http2Headers): Unit = js.native def writeHead(statusCode: Int, statusMessage: String): Unit = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2Session.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2Session.scala index ef00f4223..7c31466dd 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2Session.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2Session.scala @@ -11,7 +11,8 @@ import scala.scalajs.js.| trait Http2Session extends IEventEmitter { def alpnProtocol: js.UndefOr[String] = js.native - def close(callback: js.Function = js.native): Unit = js.native + def close(callback: js.Function): Unit = js.native + def close(): Unit = js.native def closed: Boolean = js.native @@ -53,9 +54,10 @@ trait Http2Session extends IEventEmitter { def state: Http2SessionState = js.native - def settings(settings: Http2Settings = js.native, - callback: js.Function3[Error, Http2Settings, Int, Any] = js.native - ): Unit = js.native + def settings(settings: Http2Settings, callback: js.Function3[Error, Http2Settings, Int, Any]): Unit = js.native + def settings(settings: Http2Settings): Unit = js.native + def settings(callback: js.Function3[Error, Http2Settings, Int, Any]): Unit = js.native + def settings(): Unit = js.native def `type`: Int = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2Stream.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2Stream.scala index b0e459981..5977d00bc 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2Stream.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/http2/Http2Stream.scala @@ -12,7 +12,8 @@ trait Http2Stream extends stream.Duplex { @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def bufferSize: Int = js.native - def close(code: Int, callback: js.Function = js.native): Unit = js.native + def close(code: Int, callback: js.Function): Unit = js.native + def close(code: Int): Unit = js.native def closed: Boolean = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/https/Agent.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/https/Agent.scala index 92c8fef95..36a907f2c 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/https/Agent.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/https/Agent.scala @@ -10,4 +10,6 @@ import scala.scalajs.js.annotation.JSImport */ @js.native @JSImport("https", "Agent") -class Agent(options: AgentOptions = js.native) extends nodejs.http.Agent +class Agent(options: AgentOptions) extends nodejs.http.Agent { + def this() = this(???) +} diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/net/Net.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/net/Net.scala index 92ac31fc1..45f23e9b6 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/net/Net.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/net/Net.scala @@ -37,17 +37,19 @@ trait Net extends js.Object { * parameter will be added as a listener for the 'connect' event once. * @example net.createConnection(options[, connectListener]) */ - def createConnection(options: ConnectOptions, connectListener: js.Function = js.native): Socket = js.native - def createConnection(path: String, connectListener: js.Function): Socket = js.native - def createConnection(path: String): Socket = js.native - def createConnection(port: Int, host: String, connectListener: js.Function): Socket = js.native - def createConnection(port: Int, connectListener: js.Function): Socket = js.native - def createConnection(port: Int, host: String): Socket = js.native - def createConnection(port: Int): Socket = js.native + def createConnection(options: ConnectOptions, connectListener: js.Function): Socket = js.native + def createConnection(options: ConnectOptions): Socket = js.native + def createConnection(path: String, connectListener: js.Function): Socket = js.native + def createConnection(path: String): Socket = js.native + def createConnection(port: Int, host: String, connectListener: js.Function): Socket = js.native + def createConnection(port: Int, connectListener: js.Function): Socket = js.native + def createConnection(port: Int, host: String): Socket = js.native + def createConnection(port: Int): Socket = js.native - def createServer(options: ServerOptions, connectionListener: js.Function = js.native): Server = js.native - def createServer(connectionListener: js.Function): Server = js.native - def createServer(): Server = js.native + def createServer(options: ServerOptions, connectionListener: js.Function): Server = js.native + def createServer(options: ServerOptions): Server = js.native + def createServer(connectionListener: js.Function): Server = js.native + def createServer(): Server = js.native /** * Tests if input is an IP address. Returns 0 for invalid strings, returns 4 for IP version 4 addresses, diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/net/Server.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/net/Server.scala index aff2cbbbe..ad969413d 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/net/Server.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/net/Server.scala @@ -13,9 +13,10 @@ import scala.scalajs.js.| */ @js.native @JSImport("net", "Server") -class Server(options: ServerOptions = js.native) extends IEventEmitter { - def this(options: ServerOptions, connectionListener: js.Function) = this() - def this(connectionListener: js.Function) = this() +class Server(options: ServerOptions, connectionListener: js.Function) extends IEventEmitter { + def this() = this(???, ???) + def this(options: ServerOptions) = this(???, ???) + def this(connectionListener: js.Function) = this(???, ???) /** * A Boolean indicating whether or not the server is listening for connections. @@ -45,7 +46,8 @@ class Server(options: ServerOptions = js.native) extends IEventEmitter { * its only argument if the server was not open when it was closed. * @example server.close([callback]) */ - def close(callback: js.Function1[io.scalajs.nodejs.SystemError, Any] = js.native): Unit = js.native + def close(callback: js.Function1[io.scalajs.nodejs.SystemError, Any]): Unit = js.native + def close(): Unit = js.native /** * Asynchronously get the number of concurrent connections on the server. Works when sockets were sent to forks. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/net/Socket.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/net/Socket.scala index fd77a5328..b210770ae 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/net/Socket.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/net/Socket.scala @@ -13,7 +13,8 @@ import scala.scalajs.js.annotation.JSImport */ @js.native @JSImport("net", "Socket") -class Socket(options: SocketOptions = js.native) extends stream.Duplex with HasHandle { +class Socket(options: SocketOptions) extends stream.Duplex with HasHandle { + def this() = this(???) /** * net.Socket has the property that socket.write() always works. This is to help users get up and running quickly. @@ -112,7 +113,8 @@ class Socket(options: SocketOptions = js.native) extends stream.Duplex with HasH * @param connectListener the optional connect listener * @example socket.connect(options[, connectListener]) */ - def connect(options: ConnectOptions, connectListener: js.Function = js.native): Unit = js.native + def connect(options: ConnectOptions, connectListener: js.Function): Unit = js.native + def connect(options: ConnectOptions): Unit = js.native def connect(port: Int, host: String, connectListener: js.Function): Unit = js.native def connect(port: Int, connectListener: js.Function): Unit = js.native @@ -147,7 +149,8 @@ class Socket(options: SocketOptions = js.native) extends stream.Duplex with HasH * @return socket * @example socket.setNoDelay([noDelay]) */ - def setNoDelay(noDelay: Boolean = js.native): this.type = js.native + def setNoDelay(noDelay: Boolean): this.type = js.native + def setNoDelay(): this.type = js.native /** * Sets the socket to timeout after timeout milliseconds of inactivity on the socket. By default net.Socket do not have a timeout. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/os/OS.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/os/OS.scala index dadcae7ce..fee903bba 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/os/OS.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/os/OS.scala @@ -64,7 +64,8 @@ trait OS extends js.Object { */ def freemem(): Double = js.native - def getPriority(pid: Int = js.native): Int = js.native + def getPriority(pid: Int): Int = js.native + def getPriority(): Int = js.native /** * Returns the home directory of the current user. @@ -147,7 +148,8 @@ trait OS extends js.Object { * falling back to the operating system response. * @return a [[UserInfoObject user information object]] */ - def userInfo(options: UserInfoOptions = js.native): UserInfoObject = js.native + def userInfo(options: UserInfoOptions): UserInfoObject = js.native + def userInfo(): UserInfoObject = js.native /** * Returns a string identifying the kernel version. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/path/Path.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/path/Path.scala index 2059099d3..8db8cb488 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/path/Path.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/path/Path.scala @@ -44,7 +44,8 @@ trait Path extends js.Object { * @param ext optional, if given, must also be a string. * @return the last portion of a path */ - def basename(path: String, ext: String = js.native): String = js.native + def basename(path: String, ext: String): String = js.native + def basename(path: String): String = js.native /** * Return the directory name of a path, similar to the Unix dirname command. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/process/Process.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/process/Process.scala index 39570b5ae..67f784e1d 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/process/Process.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/process/Process.scala @@ -188,7 +188,8 @@ trait Process extends IEventEmitter { */ def chdir(directory: String): Unit = js.native - def cpuUsage(previousValue: CpuUsage = js.native): CpuUsage = js.native + def cpuUsage(previousValue: CpuUsage): CpuUsage = js.native + def cpuUsage(): CpuUsage = js.native /** * Returns the current working directory of the process. @@ -206,21 +207,25 @@ trait Process extends IEventEmitter { */ def disconnect(): js.Any = js.native - def dlopen(module: io.scalajs.nodejs.Module, filename: String, flags: Int = js.native): Unit = js.native + def dlopen(module: io.scalajs.nodejs.Module, filename: String, flags: Int): Unit = js.native + def dlopen(module: io.scalajs.nodejs.Module, filename: String): Unit = js.native - def emitWarning(warning: io.scalajs.nodejs.Error): Unit = js.native - def emitWarning(warning: String, - `type`: String = js.native, - code: String = js.native, - ctor: js.Function = js.native - ): Unit = js.native - def emitWarning(warning: String, options: WarningOptions): Unit = js.native + def emitWarning(warning: io.scalajs.nodejs.Error, options: WarningOptions): Unit = js.native + def emitWarning(warning: io.scalajs.nodejs.Error): Unit = js.native + def emitWarning(warning: String, options: WarningOptions): Unit = js.native + def emitWarning(warning: String, `type`: String, code: String, ctor: js.Function): Unit = js.native + def emitWarning(warning: String, `type`: String, ctor: js.Function): Unit = js.native + def emitWarning(warning: String, ctor: js.Function): Unit = js.native + def emitWarning(warning: String, `type`: String, code: String): Unit = js.native + def emitWarning(warning: String, `type`: String): Unit = js.native + def emitWarning(warning: String): Unit = js.native /** * Ends the process with the specified code. If omitted, exit uses the 'success' code 0. * @example process.exit([code]) */ - def exit(code: Int = js.native): Unit = js.native + def exit(code: Int): Unit = js.native + def exit(): Unit = js.native /** * Gets the effective group identity of the process. This is the numerical group id, not the group name. @@ -286,7 +291,8 @@ trait Process extends IEventEmitter { * like the kill system call. The signal sent may do something other than kill the target process. * @example process.kill(pid[, signal]) */ - def kill(pid: Int, signal: String | Int = js.native): Unit = js.native + def kill(pid: Int, signal: String | Int): Unit = js.native + def kill(pid: Int): Unit = js.native /** * Returns an object describing the memory usage of the Node.js process measured in bytes. @@ -362,7 +368,8 @@ trait Process extends IEventEmitter { */ def setuid(id: String | Int): Unit = js.native - def setUncaughtExceptionCaptureCallback(callback: js.Function = js.native): Unit = js.native + def setUncaughtExceptionCaptureCallback(callback: js.Function): Unit = js.native + def setUncaughtExceptionCaptureCallback(): Unit = js.native /** * Sets or reads the process's file mode creation mask. Child processes inherit the mask from the parent process. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/process/Reporter.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/process/Reporter.scala index 5046d4194..d1fad7704 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/process/Reporter.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/process/Reporter.scala @@ -8,7 +8,8 @@ import scala.scalajs.js.| @enableMembersIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) @js.native trait Reporter extends js.Object { - def getReport(err: io.scalajs.nodejs.Error = js.native): Reporter = js.native + def getReport(err: io.scalajs.nodejs.Error): Reporter = js.native + def getReport(): Reporter = js.native def directory: String = js.native def directory_=(v: String): Unit = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/querystring/QueryString.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/querystring/QueryString.scala index a2d7c243a..ba5546e9b 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/querystring/QueryString.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/querystring/QueryString.scala @@ -37,11 +37,10 @@ trait QueryString extends js.Object { * @param options The given [[QueryDecodeOptions options]] * @return a mapping of the key-value pairs */ - def parse(str: String, - sep: String = js.native, - eq: String = js.native, - options: QueryDecodeOptions = js.native - ): js.Dictionary[String] = js.native + def parse(str: String, sep: String, eq: String, options: QueryDecodeOptions): js.Dictionary[String] = js.native + def parse(str: String, sep: String, eq: String): js.Dictionary[String] = js.native + def parse(str: String, sep: String): js.Dictionary[String] = js.native + def parse(str: String): js.Dictionary[String] = js.native /** * The querystring.stringify() method produces a URL query string from a given obj by iterating through the @@ -51,11 +50,10 @@ trait QueryString extends js.Object { * @param eq The substring used to delimit keys and values in the query string. Defaults to '='. * @param options The given [[QueryEncodeOptions options]] */ - def stringify(obj: js.Any, - sep: String = js.native, - eq: String = js.native, - options: QueryEncodeOptions = js.native - ): String = js.native + def stringify(obj: js.Any, sep: String, eq: String, options: QueryEncodeOptions): String = js.native + def stringify(obj: js.Any, sep: String, eq: String): String = js.native + def stringify(obj: js.Any, sep: String): String = js.native + def stringify(obj: js.Any): String = js.native /** * The querystring.unescape() method performs decoding of URL percent-encoded characters on the given str. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/readline/Readline.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/readline/Readline.scala index 100fb4c24..ba5690c2d 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/readline/Readline.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/readline/Readline.scala @@ -23,13 +23,15 @@ trait Readline extends js.Object { * * @example readline.clearLine(stream, dir) */ - def clearLine(stream: IWritable, dir: Int, callback: js.Function = js.native): Boolean = js.native + def clearLine(stream: IWritable, dir: Int, callback: js.Function): Boolean = js.native + def clearLine(stream: IWritable, dir: Int): Boolean = js.native /** * Clears the screen from the current position of the cursor down. * @example readline.clearScreenDown(stream) */ - def clearScreenDown(stream: IWritable, callback: js.Function = js.native): Boolean = js.native + def clearScreenDown(stream: IWritable, callback: js.Function): Boolean = js.native + def clearScreenDown(stream: IWritable): Boolean = js.native /** * Creates a readline Interface instance. @@ -41,17 +43,20 @@ trait Readline extends js.Object { * Move cursor to the specified position in a given TTY stream. * @example readline.cursorTo(stream, x, y) */ - def cursorTo(stream: IWritable, x: Int, y: Int, callback: js.Function = js.native): Unit = js.native - def cursorTo(stream: IWritable, x: Int, callback: js.Function): Unit = js.native - def cursorTo(stream: IWritable, x: Int): Unit = js.native + def cursorTo(stream: IWritable, x: Int, y: Int, callback: js.Function): Unit = js.native + def cursorTo(stream: IWritable, x: Int, y: Int): Unit = js.native + def cursorTo(stream: IWritable, x: Int, callback: js.Function): Unit = js.native + def cursorTo(stream: IWritable, x: Int): Unit = js.native - def emitKeypressEvents(stream: IReadable, interface: Interface = js.native): Unit = js.native + def emitKeypressEvents(stream: IReadable, interface: Interface): Unit = js.native + def emitKeypressEvents(stream: IReadable): Unit = js.native /** * Move cursor relative to it's current position in a given TTY stream. * @example readline.moveCursor(stream, dx, dy) */ - def moveCursor(stream: IWritable, dx: Int, dy: Int, callback: js.Function = js.native): Unit = js.native + def moveCursor(stream: IWritable, dx: Int, dy: Int, callback: js.Function): Unit = js.native + def moveCursor(stream: IWritable, dx: Int, dy: Int): Unit = js.native } /** diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/repl/REPL.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/repl/REPL.scala index 99256b72d..0e2530532 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/repl/REPL.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/repl/REPL.scala @@ -16,8 +16,9 @@ trait REPL extends js.Object { var REPL_MODE_SLOPPY: js.Symbol = js.native var REPL_MODE_STRICT: js.Symbol = js.native - def start(options: StartOptions = js.native): REPLServer = js.native - def start(prompt: String): REPLServer = js.native + def start(options: StartOptions): REPLServer = js.native + def start(prompt: String): REPLServer = js.native + def start(): REPLServer = js.native } @Factory diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/repl/REPLServer.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/repl/REPLServer.scala index b2d215eee..a2ab51cc0 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/repl/REPLServer.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/repl/REPLServer.scala @@ -46,7 +46,7 @@ trait REPLServer extends IEventEmitter with Interface { * for commands registered using the replServer.defineCommand() method. * @param preserveCursor indicates whether to preserver the cursor (position?) */ - def displayPrompt(preserveCursor: Boolean = js.native): Unit = js.native + def displayPrompt(preserveCursor: Boolean): Unit = js.native /** * Like readline.prompt except also adding indents with ellipses when inside blocks. The preserveCursor argument diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/stream/Stream.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/stream/Stream.scala index 33811e2ba..f3208c409 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/stream/Stream.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/stream/Stream.scala @@ -31,13 +31,18 @@ object Stream extends js.Object { */ @js.native @JSImport("stream", "Readable") -class Readable(options: ReadableOptions = js.native) extends IReadable +class Readable(options: ReadableOptions) extends IReadable { + def this() = this(???) +} @js.native @JSImport("stream", "Readable") object Readable extends js.Object { - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def from(iterable: js.Iterable[_], options: ReadableOptions = js.native): Readable = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def from(iterable: js.Iterable[_], + options: ReadableOptions + ): Readable = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def from(iterable: js.Iterable[_]): Readable = + js.native } /** @@ -47,7 +52,9 @@ object Readable extends js.Object { */ @js.native @JSImport("stream", "Writable") -class Writable(options: WritableOptions = js.native) extends IWritable +class Writable(options: WritableOptions) extends IWritable { + def this() = this(???) +} /** * A "duplex" stream is one that is both Readable and Writable, such as a TCP socket connection. @@ -62,7 +69,9 @@ class Writable(options: WritableOptions = js.native) extends IWritable */ @js.native @JSImport("stream", "Duplex") -class Duplex(options: DuplexOptions = js.native) extends IDuplex +class Duplex(options: DuplexOptions) extends IDuplex { + def this() = this(???) +} /** * Transform streams are Duplex streams where the output is in some way computed from the input. @@ -70,7 +79,9 @@ class Duplex(options: DuplexOptions = js.native) extends IDuplex */ @js.native @JSImport("stream", "Transform") -class Transform(options: TransformOptions = js.native) extends ITransform +class Transform(options: TransformOptions) extends ITransform { + def this() = this(???) +} /** * This is a trivial implementation of a Transform stream that simply passes the input bytes across to the output. @@ -110,7 +121,8 @@ sealed trait IReadable extends LegacyStream { * Multiple destinations can be piped to safely. * @example readable.pipe(destination[, options]) */ - def pipe(destination: IWritable, options: ReadablePipeOptions = js.native): this.type = js.native + def pipe(destination: IWritable, options: ReadablePipeOptions): this.type = js.native + def pipe(destination: IWritable): this.type = js.native /** * When chunk is a Buffer or string, the chunk of data will be added to the internal queue for users @@ -126,7 +138,8 @@ sealed trait IReadable extends LegacyStream { * @param encoding the encoding of String chunks. Must be a valid Buffer encoding, such as 'utf8' or 'ascii' * @return true if additional chunks of data may continued to be pushed; false otherwise. */ - def push(chunk: String, encoding: String = js.native): Boolean = js.native + def push(chunk: String, encoding: String): Boolean = js.native + def push(chunk: String): Boolean = js.native /** * When chunk is a Buffer or string, the chunk of data will be added to the internal queue for users @@ -143,12 +156,12 @@ sealed trait IReadable extends LegacyStream { */ def push(chunk: Uint8Array): Boolean = js.native - @JSName("read") - def readAsString(size: Int = js.native): String = js.native - @JSName("read") - def readAsBuffer(size: Int = js.native): Buffer = js.native - @JSName("read") - def readAsObject(size: Int = js.native): js.Any = js.native + @JSName("read") def readAsString(size: Int): String = js.native + @JSName("read") def readAsString(): String = js.native + @JSName("read") def readAsBuffer(size: Int): Buffer = js.native + @JSName("read") def readAsBuffer(): Buffer = js.native + @JSName("read") def readAsObject(size: Int): js.Any = js.native + @JSName("read") def readAsObject(): js.Any = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def readable: Boolean = js.native @@ -197,7 +210,8 @@ sealed trait IReadable extends LegacyStream { *

If the destination is specified, but no pipe is set up for it, then this is a no-op. * @example readable.unpipe([destination]) */ - def unpipe(destination: IWritable = js.native): Unit = js.native + def unpipe(destination: IWritable): Unit = js.native + def unpipe(): Unit = js.native /** * This is useful in certain cases where a stream is being consumed by a parser, which needs @@ -268,16 +282,18 @@ sealed trait IWritable extends LegacyStream { */ def cork(): Unit = js.native - def destroy(error: io.scalajs.nodejs.Error = js.native): Unit = js.native + def destroy(error: io.scalajs.nodejs.Error): Unit = js.native + def destroy(): Unit = js.native def destroyed: Boolean = 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 | Uint8Array): 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 + def end(callback: js.Function1[Error, Any]): this.type = js.native + def end(): this.type = js.native /** * Sets the default encoding for a writable stream. @@ -307,9 +323,10 @@ sealed trait IWritable extends LegacyStream { @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def writableObjectMode: Boolean = js.native - def write(chunk: Uint8Array | String, callback: js.Function1[Error, Any] = js.native): Boolean = js.native - def write(chunk: String, encoding: String): Boolean = js.native - def write(chunk: String, encoding: String, callback: js.Function1[Error, Any]): Boolean = js.native + def write(chunk: Uint8Array | String, callback: js.Function1[Error, Any]): Boolean = js.native + def write(chunk: Uint8Array | String): Boolean = js.native + def write(chunk: String, encoding: String): Boolean = js.native + def write(chunk: String, encoding: String, callback: js.Function1[Error, Any]): Boolean = js.native } @Factory diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/tls/TLSSocket.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/tls/TLSSocket.scala index 4b7e65557..47f0a5a99 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/tls/TLSSocket.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/tls/TLSSocket.scala @@ -19,7 +19,9 @@ import scala.scalajs.js.| */ @js.native @JSImport("tls", "TLSSocket") -class TLSSocket(socket: stream.IDuplex, options: TLSSocketOptions = js.native) extends net.Socket { +class TLSSocket(socket: stream.IDuplex, options: TLSSocketOptions) extends net.Socket { + def this(socket: stream.IDuplex) = this(???, ???) + def authorizationError: js.UndefOr[Boolean] = js.native def authorized: Boolean = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/tls/Tls.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/tls/Tls.scala index a4e29bf90..e4aa426e2 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/tls/Tls.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/tls/Tls.scala @@ -15,13 +15,16 @@ import scala.scalajs.js.annotation.JSImport trait Tls extends js.Object { def checkServerIdentity(hostname: String, cert: TLSCertificate): js.UndefOr[io.scalajs.nodejs.Error] = js.native - def connect(options: ConnectOptions, callback: js.Function = js.native): Unit = js.native + def connect(options: ConnectOptions, callback: js.Function): Unit = js.native + def connect(options: ConnectOptions): Unit = js.native - def createSecureContext(options: SecureContextOptions = js.native): SecureContext = js.native + def createSecureContext(options: SecureContextOptions): SecureContext = js.native + def createSecureContext(): SecureContext = js.native - def createServer(options: ServerOptions, secureConnectionListener: js.Function = js.native): Server = js.native - def createServer(secureConnectionListener: js.Function): Server = js.native - def createServer(): Server = js.native + def createServer(options: ServerOptions, secureConnectionListener: js.Function): Server = js.native + def createServer(options: ServerOptions): Server = js.native + def createServer(secureConnectionListener: js.Function): Server = js.native + def createServer(): Server = js.native def getCiphers(): js.Array[String] = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/tty/WriteStream.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/tty/WriteStream.scala index 6c4782312..d756e30e4 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/tty/WriteStream.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/tty/WriteStream.scala @@ -44,12 +44,15 @@ class WriteStream(fd: FileDescriptor) extends net.Socket { @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def cursorTo(x: Int, y: Int, callback: js.Function): Boolean = js.native - def getColorDepth(env: io.scalajs.nodejs.process.Environment = js.native): Int = js.native + def getColorDepth(env: io.scalajs.nodejs.process.Environment): Int = js.native + def getColorDepth(): Int = js.native def getWindowSize(): js.Tuple2[Int, Int] = js.native - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def hasColors(count: Int = js.native, env: io.scalajs.nodejs.process.Environment = js.native): Boolean = js.native + def hasColors(count: Int, env: io.scalajs.nodejs.process.Environment): Boolean = js.native + def hasColors(count: Int): Boolean = js.native + def hasColors(env: io.scalajs.nodejs.process.Environment): Boolean = js.native + def hasColors(): Boolean = js.native /** * Indicates whether the stream is a TTY diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/url/URL.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/url/URL.scala index 21b198cfb..c2eee36ca 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/url/URL.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/url/URL.scala @@ -13,7 +13,8 @@ import scala.scalajs.js.| */ @js.native @JSImport("url", "URL") -class URL(input: String, base: String | URL = js.native) extends js.Object { +class URL(input: String, base: String | URL) extends js.Object { + def this(input: String) = this(input, ???) /** * The auth property is the username and password portion of the URL, also referred to as "userinfo". @@ -120,7 +121,8 @@ object URL extends js.Object { * @param options the given [[UrlFormatOptions options]] * @return a customizable serialization of a URL String representation of a WHATWG URL object. */ - def format(url: URL, options: UrlFormatOptions = js.native): String = js.native + def format(url: URL, options: UrlFormatOptions): String = js.native + def format(url: URL): String = js.native /** * Take a URL string, and return an object. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/util/TextDecoder.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/util/TextDecoder.scala index 2922af438..b617ff2cc 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/util/TextDecoder.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/util/TextDecoder.scala @@ -15,7 +15,8 @@ class TextDecoder() extends js.Object { val fatal: Boolean = js.native val ignoreBOM: Boolean = js.native - def decode(buffer: ArrayBuffer | ArrayBufferView, options: TextDecodeOptions = js.native): String = js.native + def decode(buffer: ArrayBuffer | ArrayBufferView, options: TextDecodeOptions): String = js.native + def decode(buffer: ArrayBuffer | ArrayBufferView): String = js.native } @Factory diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/util/Util.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/util/Util.scala index 89fb700fd..7f4d2a1c6 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/util/Util.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/util/Util.scala @@ -27,7 +27,8 @@ trait Util extends js.Object { * Marks that a method should not be used any more. * @example util.deprecate(function, message) */ - def deprecate(function: js.Function, message: String, code: String = js.native): js.Any = js.native + def deprecate(function: js.Function, message: String, code: String): js.Any = js.native + def deprecate(function: js.Function, message: String): js.Any = js.native /** * Returns a formatted string using the first argument as a printf-like format. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/v8/V8.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/v8/V8.scala index 2eb1459e7..66c78bd61 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/v8/V8.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/v8/V8.scala @@ -23,8 +23,9 @@ trait V8 extends js.Object { def setFlagsFromString(flags: String): Unit = js.native - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def writeHeapSnapshot(filename: String = js.native): String = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def writeHeapSnapshot(filename: String): String = + js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def writeHeapSnapshot(): String = js.native def serialize(value: js.Any): Buffer = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/vm/Script.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/vm/Script.scala index 0dae79de1..13fa96ec3 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/vm/Script.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/vm/Script.scala @@ -13,8 +13,9 @@ import scala.scalajs.js.| @js.native @JSImport("vm", "Script") class Script private[this] () extends js.Object { - def this(code: String, options: ScriptOptions = js.native) = this() + def this(code: String, options: ScriptOptions) = this() def this(code: String, filename: String) = this() + def this(code: String) = this() def createCachedData(): io.scalajs.nodejs.buffer.Buffer = js.native @@ -25,7 +26,8 @@ class Script private[this] () extends js.Object { * @param options the optional options * @example script.runInContext(contextifiedSandbox[, options]) */ - def runInContext(contextifiedSandbox: ScriptContext, options: RunInContextOptions = js.native): js.Any = js.native + def runInContext(contextifiedSandbox: ScriptContext, options: RunInContextOptions): js.Any = js.native + def runInContext(contextifiedSandbox: ScriptContext): js.Any = js.native /** * First contextifies the given sandbox, runs the compiled code contained by the vm.Script object within the created @@ -34,8 +36,9 @@ class Script private[this] () extends js.Object { * @param options the optional options * @example script.runInNewContext([sandbox][, options]) */ - def runInNewContext(sandbox: js.Object, options: RunInNewContextOptions = js.native): js.Any = js.native - def runInNewContext(): js.Any = js.native + def runInNewContext(sandbox: js.Object, options: RunInNewContextOptions): js.Any = js.native + def runInNewContext(sandbox: js.Object): js.Any = js.native + def runInNewContext(): js.Any = js.native /** * Runs the compiled code contained by the vm.Script within the context of the current global object. Running code @@ -43,7 +46,8 @@ class Script private[this] () extends js.Object { * @param options the optional options * @example script.runInThisContext([options]) */ - def runInThisContext(options: RunInContextOptions = js.native): Script = js.native + def runInThisContext(options: RunInContextOptions): Script = js.native + def runInThisContext(): Script = js.native } @Factory diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/vm/VM.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/vm/VM.scala index f65572e74..c29cf3520 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/vm/VM.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/vm/VM.scala @@ -35,8 +35,9 @@ trait VM extends js.Object { * @example vm.createContext([sandbox]) * @since 0.11.7 */ - def createContext(sandbox: js.Object, options: CreateContextOptions = js.native): ScriptContext = js.native - def createContext(): ScriptContext = js.native + def createContext(sandbox: js.Object, options: CreateContextOptions): ScriptContext = js.native + def createContext(sandbox: js.Object): ScriptContext = js.native + def createContext(): ScriptContext = js.native /** * Returns true if the given sandbox object has been contextified using vm.createContext(). @@ -66,8 +67,8 @@ trait VM extends js.Object { * @param options the optional options * @example vm.runInNewContext(code[, sandbox][, options]) */ - def runInNewContext(code: String, sandbox: js.Any, options: VMRunInNewContextOptions = js.native): js.Any = - js.native + def runInNewContext(code: String, sandbox: js.Any, options: VMRunInNewContextOptions): js.Any = js.native + def runInNewContext(code: String, sandbox: js.Any): js.Any = js.native /** * Runs the compiled code contained by the vm.Script within the context of the current global object. Running code @@ -76,7 +77,8 @@ trait VM extends js.Object { * @param options the optional options * @example script.runInThisContext([options]) */ - def runInThisContext(code: String, options: VMRunInContextOptions = js.native): Script = js.native + def runInThisContext(code: String, options: VMRunInContextOptions): Script = js.native + def runInThisContext(code: String): Script = js.native } /** diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/worker_threads/Worker.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/worker_threads/Worker.scala index 386f5b0bf..7f6446c74 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/worker_threads/Worker.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/worker_threads/Worker.scala @@ -5,7 +5,9 @@ import scala.scalajs.js.annotation.JSImport @js.native @JSImport("worker_threads", "Worker") -class Worker(filename: String, workerOptions: WorkerOptions = js.native) extends js.Object with MessagePoster { +class Worker(filename: String, workerOptions: WorkerOptions) extends js.Object with MessagePoster { + def this(filename: String) = this(???, ???) + def ref(): Unit = js.native def unref(): Unit = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/zlib/Zlib.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/zlib/Zlib.scala index 602cc6f70..2e5e935f3 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/zlib/Zlib.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/zlib/Zlib.scala @@ -12,11 +12,17 @@ import scala.scalajs.js.annotation.JSImport */ @js.native trait Zlib extends js.Object with UncategorizedConstants with ZlibConstants { - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def createBrotliCompress(options: BrotliOptions = js.native): BrotliCompress = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def createBrotliCompress( + options: BrotliOptions + ): BrotliCompress = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def createBrotliCompress(): BrotliCompress = + js.native - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def createBrotliDecompress(options: BrotliOptions = js.native): BrotliDecompress = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def createBrotliDecompress( + options: BrotliOptions + ): BrotliDecompress = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def createBrotliDecompress(): BrotliDecompress = + js.native /** * Returns a new Deflate object with an options. @@ -28,37 +34,43 @@ trait Zlib extends js.Object with UncategorizedConstants with ZlibConstants { * Returns a new DeflateRaw object with an options. * @example zlib.createDeflateRaw(options) */ - def createDeflateRaw(options: CompressionOptions = js.native): DeflateRaw = js.native + def createDeflateRaw(options: CompressionOptions): DeflateRaw = js.native + def createDeflateRaw(): DeflateRaw = js.native /** * Returns a new Gunzip object with an options. * @example zlib.createGunzip(options) */ - def createGunzip(options: CompressionOptions = js.native): Gunzip = js.native + def createGunzip(options: CompressionOptions): Gunzip = js.native + def createGunzip(): Gunzip = js.native /** * Returns a new Gzip object with an options. * @example zlib.createGzip(options) */ - def createGzip(options: CompressionOptions = js.native): Gzip = js.native + def createGzip(options: CompressionOptions): Gzip = js.native + def createGzip(): Gzip = js.native /** * Returns a new Inflate object with an options. * @example zlib.createInflate(options) */ - def createInflate(options: CompressionOptions = js.native): Inflate = js.native + def createInflate(options: CompressionOptions): Inflate = js.native + def createInflate(): Inflate = js.native /** * Returns a new InflateRaw object with an options. * @example zlib.createInflateRaw(options) */ - def createInflateRaw(options: CompressionOptions = js.native): InflateRaw = js.native + def createInflateRaw(options: CompressionOptions): InflateRaw = js.native + def createInflateRaw(): InflateRaw = js.native /** * Returns a new Unzip object with an options. * @example zlib.createUnzip(options) */ - def createUnzip(options: CompressionOptions = js.native): Unzip = js.native + def createUnzip(options: CompressionOptions): Unzip = js.native + def createUnzip(): Unzip = js.native ///////////////////////////////////////////////////////////////////////////////// // Convenience Methods @@ -68,15 +80,23 @@ trait Zlib extends js.Object with UncategorizedConstants with ZlibConstants { def brotliCompress(buffer: Data, options: BrotliOptions, callback: js.Function): Unit = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def brotliCompress(buffer: Data, callback: js.Function): Unit = js.native - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def brotliCompressSync(buffer: Data, options: BrotliOptions = js.native): Unit = js.native + + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def brotliCompressSync(buffer: Data, + options: BrotliOptions + ): Unit = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def brotliCompressSync(buffer: Data): Unit = + js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def brotliDecompress(buffer: Data, options: BrotliOptions, callback: js.Function): Unit = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def brotliDecompress(buffer: Data, callback: js.Function): Unit = js.native - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) - def brotliDecompressSync(buffer: Data, options: BrotliOptions = js.native): Unit = js.native + + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def brotliDecompressSync(buffer: Data, + options: BrotliOptions + ): Unit = js.native + @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def brotliDecompressSync(buffer: Data): Unit = + js.native /** * Compress a Buffer or string with Deflate. @@ -89,7 +109,8 @@ trait Zlib extends js.Object with UncategorizedConstants with ZlibConstants { * Compress a Buffer or string with Deflate. * @example zlib.deflateSync(buf[, options]) */ - def deflateSync(buffer: Data, options: CompressionOptions = js.native): Unit = js.native + def deflateSync(buffer: Data, options: CompressionOptions): Unit = js.native + def deflateSync(buffer: Data): Unit = js.native /** * Compress a Buffer or string with DeflateRaw. @@ -97,8 +118,9 @@ trait Zlib extends js.Object with UncategorizedConstants with ZlibConstants { */ def deflateRaw(buffer: Data, options: CompressionOptions, callback: js.Function): Unit = js.native - def deflateRaw(buffer: Data, callback: js.Function): Unit = js.native - def deflateRawSync(buffer: Data, options: CompressionOptions = js.native): Unit = js.native + def deflateRaw(buffer: Data, callback: js.Function): Unit = js.native + def deflateRawSync(buffer: Data, options: CompressionOptions): Unit = js.native + def deflateRawSync(buffer: Data): Unit = js.native /** * Decompress a Buffer or string with Gunzip. @@ -111,7 +133,8 @@ trait Zlib extends js.Object with UncategorizedConstants with ZlibConstants { * Decompress a Buffer or string with Gunzip. * @example zlib.gunzipSync(buf[, options]) */ - def gunzipSync(buffer: Data, options: CompressionOptions = js.native): Unit = js.native + def gunzipSync(buffer: Data, options: CompressionOptions): Unit = js.native + def gunzipSync(buffer: Data): Unit = js.native /** * Compress a Buffer or string with Gzip. @@ -124,7 +147,8 @@ trait Zlib extends js.Object with UncategorizedConstants with ZlibConstants { * Compress a Buffer or string with Gzip. * @example zlib.gzipSync(buf[, options]) */ - def gzipSync(buffer: Data, options: CompressionOptions = js.native): Unit = js.native + def gzipSync(buffer: Data, options: CompressionOptions): Unit = js.native + def gzipSync(buffer: Data): Unit = js.native /** * Decompress a Buffer or string with Inflate. @@ -137,7 +161,8 @@ trait Zlib extends js.Object with UncategorizedConstants with ZlibConstants { * Decompress a Buffer or string with Inflate. * @example zlib.inflateSync(buf[, options]) */ - def inflateSync(buffer: Data, options: CompressionOptions = js.native): Unit = js.native + def inflateSync(buffer: Data, options: CompressionOptions): Unit = js.native + def inflateSync(buffer: Data): Unit = js.native /** * Decompress a Buffer or string with InflateRaw. @@ -151,7 +176,8 @@ trait Zlib extends js.Object with UncategorizedConstants with ZlibConstants { * Decompress a Buffer or string with InflateRaw. * @example zlib.inflateRawSync(buf[, options]) */ - def inflateRawSync(buffer: Data, options: CompressionOptions = js.native): Unit = js.native + def inflateRawSync(buffer: Data, options: CompressionOptions): Unit = js.native + def inflateRawSync(buffer: Data): Unit = js.native /** * Decompress a Buffer or string with Unzip. @@ -164,7 +190,8 @@ trait Zlib extends js.Object with UncategorizedConstants with ZlibConstants { * Decompress a Buffer or string with Unzip. * @example zlib.unzipSync(buf[, options]) */ - def unzipSync(buffer: Data, options: CompressionOptions = js.native): Unit = js.native + def unzipSync(buffer: Data, options: CompressionOptions): Unit = js.native + def unzipSync(buffer: Data): Unit = js.native } /** diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/zlib/ZlibBase.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/zlib/ZlibBase.scala index 557a4a033..e4aaa9156 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/zlib/ZlibBase.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/zlib/ZlibBase.scala @@ -15,7 +15,8 @@ import scala.scalajs.js trait ZlibBase extends stream.Transform { def bytesWritten: Double = js.native - def close(callback: js.Function = js.native): Unit = js.native + def close(callback: js.Function): Unit = js.native + def close(): Unit = js.native def flush(kind: CompressionFlush, callback: js.Function): Unit = js.native def flush(callback: js.Function): Unit = js.native