main
Last change
on this file was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago |
Pred finalna verzija
|
-
Property mode
set to
100644
|
File size:
998 bytes
|
Rev | Line | |
---|
[0c6b92a] | 1 | // @flow
|
---|
| 2 | declare type FilePath = string;
|
---|
| 3 | declare type GlobPattern = string;
|
---|
| 4 |
|
---|
| 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?: Array<FilePath | GlobPattern>,
|
---|
| 14 | backend?: BackendType
|
---|
| 15 | }
|
---|
| 16 | export type SubscribeCallback = (
|
---|
| 17 | err: ?Error,
|
---|
| 18 | events: Array<Event>
|
---|
| 19 | ) => mixed;
|
---|
| 20 | export interface AsyncSubscription {
|
---|
| 21 | unsubscribe(): Promise<void>
|
---|
| 22 | }
|
---|
| 23 | export interface Event {
|
---|
| 24 | path: FilePath,
|
---|
| 25 | type: EventType
|
---|
| 26 | }
|
---|
| 27 | declare module.exports: {
|
---|
| 28 | getEventsSince(
|
---|
| 29 | dir: FilePath,
|
---|
| 30 | snapshot: FilePath,
|
---|
| 31 | opts?: Options
|
---|
| 32 | ): Promise<Array<Event>>,
|
---|
| 33 | subscribe(
|
---|
| 34 | dir: FilePath,
|
---|
| 35 | fn: SubscribeCallback,
|
---|
| 36 | opts?: Options
|
---|
| 37 | ): Promise<AsyncSubscription>,
|
---|
| 38 | unsubscribe(
|
---|
| 39 | dir: FilePath,
|
---|
| 40 | fn: SubscribeCallback,
|
---|
| 41 | opts?: Options
|
---|
| 42 | ): Promise<void>,
|
---|
| 43 | writeSnapshot(
|
---|
| 44 | dir: FilePath,
|
---|
| 45 | snapshot: FilePath,
|
---|
| 46 | opts?: Options
|
---|
| 47 | ): Promise<FilePath>
|
---|
| 48 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.