-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
53 lines (46 loc) · 1.89 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* A small module which automatically hot-swaps changed Lua files in a running LÖVE project.
*
* @noSelf
* @link [Reference](https://github.com/rxi/lurker)
*/
declare module "lurker" {
/**
* Automatically detect changed files and hot-swap them into the running project.
*/
function update(): void;
/**
* Looks for files that have changed and hot-swaps them.
*
* Manual alternative to update()
*/
function scan(): void;
/**
* A callback which is given the name of the file that will be swapped.
*
* If it returns true, the hot-swap is cancelled.
*
* @param fileName The name of the file that is being hot-swapped.
*/
var preswap: (fileName: string) => boolean | void;
/**
* @param fileName The name of the file that was hot-swapped.
*/
var postswap: (fileName: string) => void;
/**
* Dictates whether lurker should run in protected mode; this is true by default. If protected mode is disabled then LÖVE's usual error screen is used when an error occurs in a LÖVE callback function; if it is enabled then lurker's error state (which continues watching for file changes and can resume execution) is used. Changes to this variable should be made before any calls to lurker.update() are made.
*/
var protected: boolean;
/**
* Dictates what should happen if lurker tries to load a file which contains a syntax error. If it is false then lurker's error screen is shown until the syntax error is fixed; if it is true the error message is printed to the console and the program continues. lurker.quiet is false by default.
*/
var quiet: boolean;
/**
* The interval in seconds for how often the scan of the directory is performed. This is .5 by default.
*/
var interval: number;
/**
* The directory that is scanned for changes.
*/
var path: string;
}