seek should return cursor position (#4211)

This commit is contained in:
bartOssh 2020-03-02 17:44:46 +01:00 committed by GitHub
parent c14cc84a85
commit 4a47ffa5c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 79 additions and 40 deletions

View file

@ -1191,13 +1191,14 @@ declare namespace __io {
* relative to the start of the file and an error, if any.
*
* 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 {
seekSync(offset: number, whence: SeekMode): void;
seekSync(offset: number, whence: SeekMode): number;
}
export interface ReadCloser extends Reader, Closer {}
export interface WriteCloser extends Writer, Closer {}