WatchEventRepresents file system events emitted when watching files or directories.
When to use
Use when consuming file system watch streams and pattern matching on _tag
to handle created, updated, or removed paths.
Details
The union covers create, update, and remove events. Each event carries the
reported path.
export type type WatchEvent = WatchEvent.Create | WatchEvent.Update | WatchEvent.RemoveRepresents file system events emitted when watching files or directories.
When to use
Use when consuming file system watch streams and pattern matching on _tag
to handle created, updated, or removed paths.
Details
The union covers create, update, and remove events. Each event carries the
reported path.
Namespace containing the concrete event shapes emitted by FileSystem.watch.
WatchEvent = WatchEvent.interface WatchEvent.CreateEvent representing the creation of a new file or directory.
Details
This event is triggered when a new file or directory is created
in the watched location.
Create | WatchEvent.interface WatchEvent.UpdateEvent representing the modification of an existing file or directory.
Details
This event is triggered when an existing file or directory is
modified in the watched location.
Update | WatchEvent.interface WatchEvent.RemoveEvent representing the deletion of a file or directory.
Details
This event is triggered when a file or directory is deleted
from the watched location.
Remove
/**
* Namespace containing the concrete event shapes emitted by `FileSystem.watch`.
*
* @since 4.0.0
*/
export declare namespace WatchEvent {
/**
* Event representing the creation of a new file or directory.
*
* **Details**
*
* This event is triggered when a new file or directory is created
* in the watched location.
*
* @category models
* @since 4.0.0
*/
export interface interface WatchEvent.CreateEvent representing the creation of a new file or directory.
Details
This event is triggered when a new file or directory is created
in the watched location.
Create {
readonly WatchEvent.Create._tag: "Create"_tag: "Create"
readonly WatchEvent.Create.path: stringpath: string
}
/**
* Event representing the modification of an existing file or directory.
*
* **Details**
*
* This event is triggered when an existing file or directory is
* modified in the watched location.
*
* @category models
* @since 4.0.0
*/
export interface interface WatchEvent.UpdateEvent representing the modification of an existing file or directory.
Details
This event is triggered when an existing file or directory is
modified in the watched location.
Update {
readonly WatchEvent.Update._tag: "Update"_tag: "Update"
readonly WatchEvent.Update.path: stringpath: string
}
/**
* Event representing the deletion of a file or directory.
*
* **Details**
*
* This event is triggered when a file or directory is deleted
* from the watched location.
*
* @category models
* @since 4.0.0
*/
export interface interface WatchEvent.RemoveEvent representing the deletion of a file or directory.
Details
This event is triggered when a file or directory is deleted
from the watched location.
Remove {
readonly WatchEvent.Remove._tag: "Remove"_tag: "Remove"
readonly WatchEvent.Remove.path: stringpath: string
}
}