1.0.6 • Published 6 months ago
@types/watch v1.0.6
Installation
npm install --save @types/watch
Summary
This package contains type definitions for watch (https://github.com/mikeal/watch).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/watch.
index.d.ts
// Type definitions for watch 1.0
// Project: https://github.com/mikeal/watch
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>, Gyusun Yeom <https://github.com/Perlmint>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/watch.d.ts
/// <reference types="node" />
import fs = require("fs");
import events = require("events");
export interface Files { [key: string]: fs.Stats; }
export interface Monitor extends events.EventEmitter {
files: Files;
on(event: "created" | "removed", listener: (f: string, stat: fs.Stats) => void): this;
on(event: "changed", listener: (f: string, current: fs.Stats, prev: fs.Stats) => void): this;
on(event: string, listener: (...args: any[]) => void): this;
stop(): void;
}
export interface BaseOptions {
ignoreDotFiles?: boolean | undefined;
filter?(path: string, stat: fs.Stats): boolean;
}
export interface Options extends BaseOptions {
interval?: number | undefined;
}
export interface WalkOptions extends BaseOptions {
ignoreUnreadableDir?: boolean | undefined;
ignoreNotPermitted?: boolean | undefined;
ignoreDirectoryPattern?: RegExp | undefined;
}
export function watchTree(root: string, callback: (f: string, curr: fs.Stats, prev: fs.Stats) => void): void;
export function watchTree(root: string, options: Options, callback: (f: string, curr: fs.Stats, prev: fs.Stats) => void): void;
export function unwatchTree(root: string): void;
export function createMonitor(root: string, callback: (monitor: Monitor) => void): void;
export function createMonitor(root: string, options: Options, callback: (monitor: Monitor) => void): void;
export function walk(root: string, callback: (error: Error | null, files: Files | undefined) => void): void;
export function walk(root: string, options: WalkOptions, callback: (error: Error | null, files: Files | undefined) => void): void;
Additional Details
- Last updated: Wed, 05 Jan 2022 21:01:28 GMT
- Dependencies: @types/node
- Global values: none
Credits
These definitions were written by Carlos Ballesteros Velasco, and Gyusun Yeom.
1.0.6
6 months ago
1.0.5
7 months ago
1.0.4
7 months ago
1.0.3
2 years ago
1.0.2
3 years ago
1.0.1
5 years ago
1.0.0
7 years ago
0.0.28
8 years ago
0.0.27
8 years ago
0.0.26-alpha
8 years ago
0.0.25-alpha
8 years ago
0.0.24-alpha
8 years ago
0.0.23-alpha
8 years ago
0.0.22-alpha
8 years ago
0.0.21-alpha
8 years ago
0.0.20-alpha
8 years ago
0.0.15-alpha
8 years ago
0.0.14-alpha
8 years ago