@travetto/manifest 3.0.1 → 3.0.2-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -96,14 +96,14 @@ The module also leverages [fetch](https://www.npmjs.com/package/@parcel/watcher)
|
|
|
96
96
|
**Code: Watch Folder Signature**
|
|
97
97
|
```typescript
|
|
98
98
|
export type WatchEvent = { action: 'create' | 'update' | 'delete', file: string };
|
|
99
|
-
type
|
|
99
|
+
export type WatchEventFilter = (ev: WatchEvent) => boolean;
|
|
100
100
|
|
|
101
101
|
export type WatchEventListener = (ev: WatchEvent, folder: string) => void;
|
|
102
102
|
export type WatchConfig = {
|
|
103
103
|
/**
|
|
104
104
|
* Predicate for filtering events
|
|
105
105
|
*/
|
|
106
|
-
filter?:
|
|
106
|
+
filter?: WatchEventFilter;
|
|
107
107
|
/**
|
|
108
108
|
* List of top level folders to ignore
|
|
109
109
|
*/
|
|
@@ -119,15 +119,15 @@ export type WatchConfig = {
|
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
|
-
*
|
|
123
|
-
* @param
|
|
122
|
+
* Watch files for a given folder
|
|
123
|
+
* @param folder
|
|
124
124
|
* @param onEvent
|
|
125
|
-
* @
|
|
125
|
+
* @param options
|
|
126
126
|
*/
|
|
127
|
-
export async function
|
|
128
|
-
|
|
127
|
+
export async function watchFolderImmediate(
|
|
128
|
+
folder: string,
|
|
129
129
|
onEvent: WatchEventListener,
|
|
130
|
-
|
|
130
|
+
options: WatchConfig = {}
|
|
131
131
|
): Promise<() => Promise<void>> {
|
|
132
132
|
```
|
|
133
133
|
|