mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-06 13:11:46 +00:00
Merge pull request #22166 from lierdakil/patch-1
@types/atom: watchPath returns a Promise
This commit is contained in:
@@ -1587,7 +1587,8 @@ function testPanel() {
|
||||
}
|
||||
|
||||
// PathWatcher ================================================================
|
||||
function testPathWatcher() {
|
||||
async function testPathWatcher() {
|
||||
const pathWatcher = await pathWatcherPromise;
|
||||
pathWatcher.dispose();
|
||||
subscription = pathWatcher.onDidError((error) => str = error.name);
|
||||
|
||||
@@ -3213,7 +3214,7 @@ function testWorkspaceCenter() {
|
||||
}
|
||||
|
||||
// watchPath ==================================================================
|
||||
const pathWatcher = Atom.watchPath("/var/test", {}, (events) => {
|
||||
const pathWatcherPromise = Atom.watchPath("/var/test", {}, (events) => {
|
||||
for (const event of events) {
|
||||
str = event.path;
|
||||
str = event.action;
|
||||
|
||||
Vendored
+1
-1
@@ -24,7 +24,7 @@ declare global {
|
||||
* Project::onDidChangeFiles instead.
|
||||
*/
|
||||
export function watchPath(rootPath: string, options: {}, eventCallback: (events:
|
||||
FilesystemChangeEvent) => void): PathWatcher;
|
||||
FilesystemChangeEvent) => void): Promise<PathWatcher>;
|
||||
|
||||
// Essential Classes ==========================================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user