|
1 | 1 | package io.scalajs.nodejs.buffer
|
2 | 2 |
|
| 3 | +import com.thoughtworks.enableIf |
3 | 4 | import io.scalajs.collection.Iterator
|
4 | 5 |
|
5 | 6 | import scala.scalajs.js
|
@@ -841,11 +842,36 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ -
|
841 | 842 | */
|
842 | 843 | def writeUIntLE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean = js.native): Int = js.native
|
843 | 844 |
|
| 845 | + /** |
| 846 | + * @see https://nodejs.org/api/buffer.html#buffer_buf_readbiguint64be_offset |
| 847 | + */ |
| 848 | + @enableIf(io.scalajs.nodejs.CompilerSwitches.gteNodeJs12) |
| 849 | + def readBigInt64BE(offset: Int = js.native): Buffer.UnsafeBigInt = js.native |
| 850 | + |
| 851 | + /** |
| 852 | + * @see https://nodejs.org/api/buffer.html#buffer_buf_readbiguint64le_offset |
| 853 | + */ |
| 854 | + @enableIf(io.scalajs.nodejs.CompilerSwitches.gteNodeJs12) |
| 855 | + def readBigUInt64LE(offset: Int = js.native): Buffer.UnsafeBigInt = js.native |
| 856 | + |
| 857 | + /** |
| 858 | + * @see https://nodejs.org/api/buffer.html#buffer_buf_writebigint64be_value_offset |
| 859 | + */ |
| 860 | + @enableIf(io.scalajs.nodejs.CompilerSwitches.gteNodeJs12) |
| 861 | + def writeBigInt64BE(value: Buffer.UnsafeBigInt, offset: Int = js.native): Int = js.native |
| 862 | + |
| 863 | + /** |
| 864 | + * @see https://nodejs.org/api/buffer.html#buffer_buf_writebigint64le_value_offset |
| 865 | + */ |
| 866 | + @enableIf(io.scalajs.nodejs.CompilerSwitches.gteNodeJs12) |
| 867 | + def writeBigInt64LE(value: Buffer.UnsafeBigInt, offset: Int = js.native): Int = js.native |
844 | 868 | }
|
845 | 869 |
|
846 | 870 | @js.native
|
847 | 871 | @JSGlobal
|
848 | 872 | object Buffer extends js.Object {
|
| 873 | + // TODO: Node.js added BigInt-related things (e.g. readBigInt64BE). Should support when Scala.js support it |
| 874 | + type UnsafeBigInt = js.Dynamic |
849 | 875 |
|
850 | 876 | /////////////////////////////////////////////////////////////////////////////////
|
851 | 877 | // Properties
|
@@ -984,5 +1010,4 @@ object Buffer extends js.Object {
|
984 | 1010 | * @see [[https://nodejs.org/api/buffer.html#buffer_class_method_buffer_isencoding_encoding]]
|
985 | 1011 | */
|
986 | 1012 | def isEncoding(encoding: String): Boolean = js.native
|
987 |
| - |
988 | 1013 | }
|
0 commit comments