summaryrefslogtreecommitdiff
path: root/js/io.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/io.ts')
-rw-r--r--js/io.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/js/io.ts b/js/io.ts
index f7dbf3318..7f56187c1 100644
--- a/js/io.ts
+++ b/js/io.ts
@@ -9,6 +9,14 @@ export interface ReadResult {
eof: boolean;
}
+// Seek whence values.
+// https://golang.org/pkg/io/#pkg-constants
+export enum SeekMode {
+ SEEK_START = 0,
+ SEEK_CURRENT = 1,
+ SEEK_END = 2
+}
+
// Reader is the interface that wraps the basic read() method.
// https://golang.org/pkg/io/#Reader
export interface Reader {
@@ -74,7 +82,7 @@ export interface Seeker {
* any positive offset is legal, but the behavior of subsequent I/O operations
* on the underlying object is implementation-dependent.
*/
- seek(offset: number, whence: number): Promise<void>;
+ seek(offset: number, whence: SeekMode): Promise<void>;
}
// https://golang.org/pkg/io/#ReadCloser