Comparing version 2.0.0 to 2.1.0
@@ -16,2 +16,6 @@ declare module 'nsfw' { | ||
export interface NSFW { | ||
/** Returns a Promise that resolves after NSFW has paused listening to events. */ | ||
pause: () => Promise<void>; | ||
/** Returns a Promise that resolves after NSFW has resumed listening to events. */ | ||
resume: () => Promise<void>; | ||
/** Returns a Promise that resolves when the NSFW object has started watching the path. */ | ||
@@ -30,10 +34,12 @@ start: () => Promise<void>; | ||
type CreatedFileEvent = GenericFileEvent<ActionType.CREATED>; | ||
type DeletedFileEvent = GenericFileEvent<ActionType.DELETED>; | ||
type ModifiedFileEvent = GenericFileEvent<ActionType.MODIFIED>; | ||
type FileChangeEvent = CreatedFileEvent | DeletedFileEvent | ModifiedFileEvent | RenamedFileEvent; | ||
export type CreatedFileEvent = GenericFileEvent<ActionType.CREATED>; | ||
export type DeletedFileEvent = GenericFileEvent<ActionType.DELETED>; | ||
export type ModifiedFileEvent = GenericFileEvent<ActionType.MODIFIED>; | ||
export type FileChangeEvent = CreatedFileEvent | DeletedFileEvent | ModifiedFileEvent | RenamedFileEvent; | ||
interface RenamedFileEvent { | ||
export interface RenamedFileEvent { | ||
/** the type of event that occurred */ | ||
action: ActionType.RENAMED; | ||
/** the directory before a rename */ | ||
directory: string; | ||
/** the name of the file before a rename*/ | ||
@@ -47,3 +53,3 @@ oldFile: string; | ||
interface GenericFileEvent<T extends ActionType> { | ||
export interface GenericFileEvent<T extends ActionType> { | ||
/** the type of event that occurred */ | ||
@@ -50,0 +56,0 @@ action: T; |
@@ -48,2 +48,5 @@ const { promises: fs } = require('fs'); | ||
}; | ||
this.pause = () => this.stop(); | ||
this.resume = () => this.start(); | ||
} | ||
@@ -92,2 +95,4 @@ | ||
this.stop = () => implementation.stop(); | ||
this.pause = () => implementation.pause(); | ||
this.resume = () => implementation.resume(); | ||
} | ||
@@ -94,0 +99,0 @@ |
{ | ||
"name": "nsfw", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "A simple file watcher for Node", | ||
@@ -5,0 +5,0 @@ "main": "js/src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76024
148