mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 12:49:10 +00:00
seek should return cursor position (#4211)
This commit is contained in:
parent
c14cc84a85
commit
4a47ffa5c4
6 changed files with 79 additions and 40 deletions
9
cli/js/lib.deno.shared_globals.d.ts
vendored
9
cli/js/lib.deno.shared_globals.d.ts
vendored
|
@ -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 {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue