diff options
author | bartOssh <blenart@eagleeyenetworks.com> | 2020-03-02 17:44:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 11:44:46 -0500 |
commit | 4a47ffa5c455be213523cb1a7211a0a454b5fcf8 (patch) | |
tree | 6359cf99d149461ae1435481cc0c919ee357b36e /cli/js/io.ts | |
parent | c14cc84a85224870d2188df1a3741bf02eb8c5da (diff) |
seek should return cursor position (#4211)
Diffstat (limited to 'cli/js/io.ts')
-rw-r--r-- | cli/js/io.ts | 18 |
1 files changed, 5 insertions, 13 deletions
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<void>; + seek(offset: number, whence: SeekMode): Promise<number>; } 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 |