From 4a47ffa5c455be213523cb1a7211a0a454b5fcf8 Mon Sep 17 00:00:00 2001 From: bartOssh Date: Mon, 2 Mar 2020 17:44:46 +0100 Subject: seek should return cursor position (#4211) --- cli/js/io.ts | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'cli/js/io.ts') diff --git a/cli/js/io.ts b/cli/js/io.ts index 151c69f22..e7311d0f4 100644 --- a/cli/js/io.ts +++ b/cli/js/io.ts @@ -105,23 +105,15 @@ export interface Seeker { * and `SEEK_END` means relative to the end. * * Seeking to an offset before the start of the file is an error. Seeking to - * any positive offset is legal, but the behavior of subsequent I/O - * operations on the underlying object is implementation-dependent. + * any positive offset is legal, but the behavior of subsequent I/O operations + * on the underlying object is implementation-dependent. It returns the cursor + * position. */ - seek(offset: number, whence: SeekMode): Promise; + seek(offset: number, whence: SeekMode): Promise; } export interface SyncSeeker { - /** Seek sets the offset for the next `readSync()` or `writeSync()` to - * offset, interpreted according to `whence`: `SEEK_START` means relative - * to the start of the file, `SEEK_CURRENT` means relative to the current - * offset, and `SEEK_END` means relative to the end. - * - * Seeking to an offset before the start of the file is an error. Seeking to - * any positive offset is legal, but the behavior of subsequent I/O - * operations on the underlying object is implementation-dependent. - */ - seekSync(offset: number, whence: SeekMode): void; + seekSync(offset: number, whence: SeekMode): number; } // https://golang.org/pkg/io/#ReadCloser -- cgit v1.2.3