diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-04-28 13:23:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-28 13:23:30 +0200 |
commit | 2cb875bcfb272057e83ed56b9020291837d96998 (patch) | |
tree | fb4dbc2a6abe124c8405ba30b6dc196083e81373 /std/io | |
parent | b980b26d853ef4a8d3dd64ba8a4d4cdbda369c41 (diff) |
refactor: rename sync io interfaces (#4945)
This commit renames sync io interfaces:
* SyncReader -> ReaderSync
* SyncWriter -> WriterSync
* SyncSeeker -> SeekerSync
Diffstat (limited to 'std/io')
-rw-r--r-- | std/io/bufio.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/std/io/bufio.ts b/std/io/bufio.ts index a4e729cfd..cd08fbefa 100644 --- a/std/io/bufio.ts +++ b/std/io/bufio.ts @@ -5,7 +5,7 @@ type Reader = Deno.Reader; type Writer = Deno.Writer; -type SyncWriter = Deno.SyncWriter; +type WriterSync = Deno.WriterSync; import { charCode, copyBytes } from "./util.ts"; import { assert } from "../testing/asserts.ts"; @@ -524,17 +524,17 @@ export class BufWriter extends AbstractBufBase implements Writer { } } -/** BufWriterSync implements buffering for a deno.SyncWriter object. - * If an error occurs writing to a SyncWriter, no more data will be +/** BufWriterSync implements buffering for a deno.WriterSync object. + * If an error occurs writing to a WriterSync, no more data will be * accepted and all subsequent writes, and flush(), will return the error. * After all data has been written, the client should call the * flush() method to guarantee all data has been forwarded to - * the underlying deno.SyncWriter. + * the underlying deno.WriterSync. */ -export class BufWriterSync extends AbstractBufBase implements SyncWriter { +export class BufWriterSync extends AbstractBufBase implements WriterSync { /** return new BufWriterSync unless writer is BufWriterSync */ static create( - writer: SyncWriter, + writer: WriterSync, size: number = DEFAULT_BUF_SIZE ): BufWriterSync { return writer instanceof BufWriterSync @@ -542,7 +542,7 @@ export class BufWriterSync extends AbstractBufBase implements SyncWriter { : new BufWriterSync(writer, size); } - constructor(private writer: SyncWriter, size: number = DEFAULT_BUF_SIZE) { + constructor(private writer: WriterSync, size: number = DEFAULT_BUF_SIZE) { super(); if (size <= 0) { size = DEFAULT_BUF_SIZE; @@ -553,13 +553,13 @@ export class BufWriterSync extends AbstractBufBase implements SyncWriter { /** Discards any unflushed buffered data, clears any error, and * resets buffer to write its output to w. */ - reset(w: SyncWriter): void { + reset(w: WriterSync): void { this.err = null; this.usedBufferBytes = 0; this.writer = w; } - /** Flush writes any buffered data to the underlying io.SyncWriter. */ + /** Flush writes any buffered data to the underlying io.WriterSync. */ flush(): void { if (this.err !== null) throw this.err; if (this.usedBufferBytes === 0) return; |