Skip to content

Commit bd84b37

Browse files
committed
Merge branch 'release/13.0.0-beta.2' of github.com:sikanhe/reason-nodejs into release/13.0.0-beta.2
2 parents 79c9a92 + 4e770d9 commit bd84b37

File tree

10 files changed

+944
-997
lines changed

10 files changed

+944
-997
lines changed

src/Console.re

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ type consoleOptions;
88
[@bs.obj]
99
external consoleOptions:
1010
(
11-
~stdout: Stream.Writable.subtype('w, 'r, 'a),
12-
~stderr: Stream.Writable.subtype('w, 'r, 'a)=?,
11+
~stdout: Stream.Writable.subtype('w, 'a),
12+
~stderr: Stream.Writable.subtype('w, 'a)=?,
1313
~ignoreErrors: bool=?,
1414
~colorMode: bool=?,
1515
~inspectOptions: Util.inspectOptions=?,
@@ -20,7 +20,7 @@ external consoleOptions:
2020
[@bs.new] [@bs.module "console"]
2121
external make: consoleOptions => t = "Console";
2222
[@bs.new] [@bs.module "console"]
23-
external make2: {.. "stdout": Stream.Writable.subtype('w, 'r, 'a)} => t =
23+
external make2: {.. "stdout": Stream.Writable.subtype('w, 'a)} => t =
2424
"Console";
2525

2626
[@bs.send] external assert_: (t, bool) => unit = "assert";

src/Crypto.re

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module KeyObject = {
3636

3737
module PivateKey = {
3838
include KeyObject.Impl;
39-
type kind = [ KeyObject.publicKey];
39+
type kind = [ KeyObject.privateKey];
4040
type t('a) = KeyObject.t('a, [ kind]);
4141
[@bs.module "crypto"] external make: Buffer.t => t('a) = "createPrivateKey";
4242
[@bs.module "crypto"]
@@ -61,11 +61,10 @@ module PublicKey = {
6161
};
6262

6363
module Hash = {
64-
type kind = [ Stream.transform | `Hash];
65-
type subtype('w, 'r, 'a) =
66-
Stream.Transform.subtype('w, 'r, [> kind] as 'a);
67-
type supertype('w, 'r, 'a) = Stream.subtype('w, 'r, [< kind] as 'a);
68-
type t = subtype(Buffer.t, Buffer.t, kind);
64+
type kind('w, 'r) = [ Stream.transform('w, 'r) | `Hash];
65+
type subtype('w, 'r, 'a) = Stream.subtype([> kind('w, 'r)] as 'a);
66+
type supertype('w, 'r, 'a) = Stream.subtype([< kind('w, 'r)] as 'a);
67+
type t = Stream.subtype(kind(Buffer.t, Buffer.t));
6968
module Impl = {
7069
include Stream.Transform.Impl;
7170
[@bs.send] external copy: t => t = "copy";
@@ -78,11 +77,10 @@ module Hash = {
7877
[@bs.module "crypto"] external createHash: string => Hash.t = "createHash";
7978

8079
module Hmac = {
81-
type kind = [ Stream.transform | `Hmac];
82-
type subtype('w, 'r, 'a) =
83-
Stream.Transform.subtype('w, 'r, [> kind] as 'a);
84-
type supertype('w, 'r, 'a) = Stream.subtype('w, 'r, [< kind] as 'a);
85-
type t = subtype(Buffer.t, Buffer.t, kind);
80+
type kind('w, 'r) = [ Stream.transform('w, 'r) | `Hmac];
81+
type subtype('w, 'r, 'a) = Stream.subtype([> kind('w, 'r)] as 'a);
82+
type supertype('w, 'r, 'a) = Stream.subtype([< kind('w, 'r)] as 'a);
83+
type t = subtype(Buffer.t, Buffer.t, kind('w, 'r));
8684
module Impl = {
8785
include Stream.Transform.Impl;
8886
[@bs.send] external digest: t => Buffer.t = "digest";
@@ -105,11 +103,10 @@ module Certificate = {
105103
};
106104

107105
module Cipher = {
108-
type kind = [ Stream.transform | `Cipher];
109-
type subtype('w, 'r, 'a) =
110-
Stream.Transform.subtype('w, 'r, [> kind] as 'a);
111-
type supertype('w, 'r, 'a) = Stream.subtype('w, 'r, [< kind] as 'a);
112-
type t = subtype(Buffer.t, Buffer.t, kind);
106+
type kind('w, 'r) = [ Stream.transform('w, 'r) | `Cipher];
107+
type subtype('w, 'r, 'a) = Stream.subtype([> kind('w, 'r)] as 'a);
108+
type supertype('w, 'r, 'a) = Stream.subtype([< kind('w, 'r)] as 'a);
109+
type t = Stream.subtype(kind(Buffer.t, Buffer.t));
113110
module Impl = {
114111
include Stream.Transform.Impl;
115112
[@bs.send] external final: (t, string) => Buffer.t = "final";
@@ -150,11 +147,10 @@ module Cipher = {
150147
};
151148

152149
module Decipher = {
153-
type kind = [ Stream.transform | `Decipher];
154-
type subtype('w, 'r, 'a) =
155-
Stream.Transform.subtype('w, 'r, [> kind] as 'a);
156-
type supertype('w, 'r, 'a) = Stream.subtype('w, 'r, [< kind] as 'a);
157-
type t = subtype(Buffer.t, Buffer.t, kind);
150+
type kind('w, 'r) = [ Stream.transform('w, 'r) | `Decipher];
151+
type subtype('w, 'r, 'a) = Stream.subtype([> kind('w, 'r)] as 'a);
152+
type supertype('w, 'r, 'a) = Stream.subtype([< kind('w, 'r)] as 'a);
153+
type t = Stream.subtype(kind(Buffer.t, Buffer.t));
158154
module Impl = {
159155
[@bs.send]
160156
external final: (subtype('w, 'r, 'a), string) => Buffer.t = "final";
@@ -197,7 +193,7 @@ module Decipher = {
197193
) =>
198194
t =
199195
"createDecipheriv";
200-
};
196+
} /* }*/ /* }*/ /* module Verify = */;
201197

202198
// module DiffieHellman = {
203199

@@ -207,10 +203,4 @@ module Decipher = {
207203

208204
// };
209205

210-
// module Sign = {
211-
212-
// };
213-
214-
// module Verify = {
215-
216-
// };
206+
// module Sign = {

src/Fs.re

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -352,21 +352,21 @@ external openWithMode:
352352
"open";
353353

354354
module WriteStream = {
355-
type kind = [ Stream.writable | `FileSystem];
356-
type subtype('w, 'r, 'a) = Stream.Writable.subtype('w, 'r, [> kind] as 'a);
357-
type supertype('w, 'r, 'a) = Stream.subtype('w, 'r, [< kind] as 'a);
358-
type t = subtype(Buffer.t, Buffer.t, [ kind]);
355+
type kind('w) = [ Stream.writable('w) | `FileSystem];
356+
type subtype('w, 'ty) = Stream.subtype([> kind('w)] as 'ty);
357+
type supertype('w, 'ty) = Stream.subtype([< kind('w)] as 'ty);
358+
type t = subtype(Buffer.t, [ kind(Buffer.t)]);
359359
module Impl = {
360360
include Stream.Writable.Impl;
361361
[@bs.send]
362-
external bytesWritten: subtype('w, 'r, [> kind]) => int = "bytesWritten";
363-
[@bs.send] external path: subtype('w, 'r, [> kind]) => string = "path";
362+
external bytesWritten: subtype('w, [> kind('w)]) => int = "bytesWritten";
363+
[@bs.send] external path: subtype('w, [> kind('w)]) => string = "path";
364364
[@bs.send]
365-
external pending: subtype('w, 'r, [> kind]) => bool = "pending";
365+
external pending: subtype('w, [> kind('w)]) => bool = "pending";
366366
[@bs.send]
367367
external onOpen:
368368
(
369-
subtype('w, 'r, [> kind]) as 'stream',
369+
subtype('w, [> kind('w)]) as 'stream',
370370
[@bs.as "open"] _,
371371
[@bs.uncurry] (fd => unit)
372372
) =>
@@ -375,7 +375,7 @@ module WriteStream = {
375375
[@bs.send]
376376
external onReady:
377377
(
378-
subtype('w, 'r, [> kind]) as 'stream,
378+
subtype('w, [> kind('w)]) as 'stream,
379379
[@bs.as "ready"] _,
380380
[@bs.uncurry] (unit => unit)
381381
) =>
@@ -386,23 +386,22 @@ module WriteStream = {
386386
};
387387

388388
module ReadStream = {
389-
type kind = [ Stream.readable | `FileSystem];
390-
type subtype('w, 'r, 'a) =
391-
Stream.Readable.subtype(Stream.void, 'r, [> kind] as 'a);
392-
type supertype('w, 'r, 'a) =
393-
Stream.subtype(Stream.void, 'r, [< kind] as 'a);
394-
type t = subtype(Stream.void, Buffer.t, [ kind]);
389+
type kind('r) = [ Stream.readable('r) | `FileSystem];
390+
type subtype('r, 'ty) = Stream.subtype([> kind('r)] as 'ty);
391+
type supertype('r, 'ty) =
392+
Stream.subtype([< kind('r)] as 'ty);
393+
type t = subtype(Buffer.t, [ kind(Buffer.t)]);
395394
module Impl = {
396395
include Stream.Readable.Impl;
397396
[@bs.send]
398-
external bytesRead: subtype('w, 'r, [> kind]) => int = "bytesWritten";
399-
[@bs.send] external path: subtype('w, 'r, [> kind]) => string = "path";
397+
external bytesRead: subtype('r, [> kind('r)]) => int = "bytesWritten";
398+
[@bs.send] external path: subtype('r, [> kind('r)]) => string = "path";
400399
[@bs.send]
401-
external pending: subtype('w, 'r, [> kind]) => bool = "pending";
400+
external pending: subtype('r, [> kind('r)]) => bool = "pending";
402401
[@bs.send]
403402
external onOpen:
404403
(
405-
subtype('w, 'r, [> kind]) as 'stream,
404+
subtype('r, [> kind('r)]) as 'stream,
406405
[@bs.as "open"] _,
407406
[@bs.uncurry] (fd => unit)
408407
) =>
@@ -411,7 +410,7 @@ module ReadStream = {
411410
[@bs.send]
412411
external onReady:
413412
(
414-
subtype('w, 'r, [> kind]) as 'stream,
413+
subtype('r, [> kind('r)]) as 'stream,
415414
[@bs.as "ready"] _,
416415
[@bs.uncurry] (unit => unit)
417416
) =>

0 commit comments

Comments
 (0)