source: imaps-frontend/node_modules/@parcel/watcher/index.d.ts@ 0c6b92a

main
Last change on this file since 0c6b92a was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago

Pred finalna verzija

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[0c6b92a]1declare type FilePath = string;
2declare type GlobPattern = string;
3
4declare namespace ParcelWatcher {
5 export type BackendType =
6 | 'fs-events'
7 | 'watchman'
8 | 'inotify'
9 | 'windows'
10 | 'brute-force';
11 export type EventType = 'create' | 'update' | 'delete';
12 export interface Options {
13 ignore?: (FilePath|GlobPattern)[];
14 backend?: BackendType;
15 }
16 export type SubscribeCallback = (
17 err: Error | null,
18 events: Event[]
19 ) => unknown;
20 export interface AsyncSubscription {
21 unsubscribe(): Promise<void>;
22 }
23 export interface Event {
24 path: FilePath;
25 type: EventType;
26 }
27 export function getEventsSince(
28 dir: FilePath,
29 snapshot: FilePath,
30 opts?: Options
31 ): Promise<Event[]>;
32 export function subscribe(
33 dir: FilePath,
34 fn: SubscribeCallback,
35 opts?: Options
36 ): Promise<AsyncSubscription>;
37 export function unsubscribe(
38 dir: FilePath,
39 fn: SubscribeCallback,
40 opts?: Options
41 ): Promise<void>;
42 export function writeSnapshot(
43 dir: FilePath,
44 snapshot: FilePath,
45 opts?: Options
46 ): Promise<FilePath>;
47}
48
49export = ParcelWatcher;
Note: See TracBrowser for help on using the repository browser.