mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 18:43:21 +08:00
Support Atom v1.21. Remove Electron dependency. (#20282)
This commit is contained in:
6
types/pathwatcher/index.d.ts
vendored
6
types/pathwatcher/index.d.ts
vendored
@@ -7,6 +7,8 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="event-kit" />
|
||||
|
||||
import { ReadStream, WriteStream } from "fs";
|
||||
|
||||
declare global {
|
||||
namespace PathWatcher {
|
||||
/** Objects that appear as parameters to callbacks. */
|
||||
@@ -128,13 +130,13 @@ declare global {
|
||||
read(flushCache?: boolean): Promise<string>;
|
||||
|
||||
/** Returns a stream to read the content of the file. */
|
||||
createReadStream(): NodeJS.ReadableStream;
|
||||
createReadStream(): ReadStream;
|
||||
|
||||
/** Overwrites the file with the given text. */
|
||||
write(text: string): Promise<undefined>;
|
||||
|
||||
/** Returns a stream to write content to the file. */
|
||||
createWriteStream(): NodeJS.WritableStream;
|
||||
createWriteStream(): WriteStream;
|
||||
|
||||
/** Overwrites the file with the given text. */
|
||||
writeSync(text: string): undefined;
|
||||
|
||||
@@ -59,7 +59,8 @@ async function readFile() {
|
||||
str = await file.read();
|
||||
}
|
||||
|
||||
file.createReadStream();
|
||||
const stream = file.createReadStream();
|
||||
stream.close();
|
||||
|
||||
async function writeFile() {
|
||||
await file.write("Test");
|
||||
|
||||
Reference in New Issue
Block a user