This repository was archived by the owner on Mar 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathReadWriteStream.cs
More file actions
128 lines (84 loc) · 3.31 KB
/
ReadWriteStream.cs
File metadata and controls
128 lines (84 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using NodeJS.BufferModule;
using NodeJS.EventsModule;
namespace NodeJS {
[Imported]
public class ReadWriteStream : EventEmitter {
[NonScriptable]
public ReadWriteStream() {}
// Hacky stuff
[ScriptSkip]
public static implicit operator ReadableStream(ReadWriteStream s) { return null; }
[ScriptSkip]
public static implicit operator WritableStream(ReadWriteStream s) { return null; }
[ScriptSkip]
public static explicit operator ReadWriteStream(ReadableStream s) { return null; }
[ScriptSkip]
public static explicit operator ReadWriteStream(WritableStream s) { return null; }
// ReadableStream
[IntrinsicProperty]
public bool Readable { get; private set; }
public void SetEncoding(Encoding encoding) {}
public void Pause() {}
public void Resume() {}
public void Destroy() {}
public void Pipe(WritableStream dest) {}
public void Pipe(WritableStream dest, PipeOptions options) {}
public event Action<Buffer> OnData {
[InlineCode("{this}.addListener('data', {value})")] add {}
[InlineCode("{this}.removeListener('data', {value})")] remove {}
}
[InlineCode("{this}.once('data', {callback})")]
public void OnceData(Action<Buffer> callback) {}
public event Action<string> OnEncodedData {
[InlineCode("{this}.addListener('data', {value})")] add {}
[InlineCode("{this}.removeListener('data', {value})")] remove {}
}
[InlineCode("{this}.once('data', {callback})")]
public void OnceEncodedData(Action<string> callback) {}
public event Action OnEnd {
[InlineCode("{this}.addListener('end', {value})")] add {}
[InlineCode("{this}.removeListener('end', {value})")] remove {}
}
[InlineCode("{this}.once('end', {callback})")]
public void OnceEnd(Action callback) {}
public event Action<Error> OnError {
[InlineCode("{this}.addListener('error', {value})")] add {}
[InlineCode("{this}.removeListener('error', {value})")] remove {}
}
[InlineCode("{this}.once('error', {callback})")]
public void OnceError(Action<Error> callback) {}
public event Action OnClose {
[InlineCode("{this}.addListener('close', {value})")] add {}
[InlineCode("{this}.removeListener('close', {value})")] remove {}
}
[InlineCode("{this}.once('close', {callback})")]
public void OnceClose(Action callback) {}
// WritableStream
[IntrinsicProperty]
public bool Writable { get; private set; }
public bool Write(string data) { return false; }
public bool Write(string data, Encoding encoding) { return false; }
public bool Write(Buffer data) { return false; }
public void End() {}
public void End(string data) {}
public void End(string data, Encoding encoding) {}
public void End(Buffer data) {}
public void DestroySoon() {}
public event Action OnDrain {
[InlineCode("{this}.addListener('drain', {value})")] add {}
[InlineCode("{this}.removeListener('drain', {value})")] remove {}
}
[InlineCode("{this}.once('drain', {callback})")]
public void OnceDrain(Action callback) {}
public event Action OnPipe {
[InlineCode("{this}.addListener('pipe', {value})")] add {}
[InlineCode("{this}.removeListener('pipe', {value})")] remove {}
}
[InlineCode("{this}.once('pipe', {callback})")]
public void OncePipe(Action callback) {}
}
}