forked from AtomicGameEngine/AtomicGameEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathduktape.d.ts
More file actions
82 lines (70 loc) · 2.94 KB
/
duktape.d.ts
File metadata and controls
82 lines (70 loc) · 2.94 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Duktape built-ins
// extracted from lib.d.ts
declare interface Console {
log(message?: any, ...optionalParams: any[]): void;
}
declare var console: Console;
// Duktape require isn't recognized as a function, but can be used as one
declare function require(filename: string): any;
/*
* Timer API. These routines are available if you ```import "AtomicEventLoop"```
*/
/**
* schedules a function to be called on the next frame. Must require("AtomicEventLoop") in main.js to use.
* Muat require("AtomicEventLoop") or import "AtomicEventLoop" in main.js to use.
* @method
* @param {function} func the Function to call
* @returns {number} the id of the callback to be used in cancelAnimationFrame in order to cancel the call
*/
declare function requestAnimationFrame(step: any): number;
/**
* stops a previously queued call to requestAnimationFrame
* Muat require("AtomicEventLoop") or import "AtomicEventLoop" in main.js to use.
* @method
* @param {number} call_id the id of the timer that was created via requestAnimationFrame
*/
declare function cancelAnimationFrame(call_id: number);
/**
* schedules a function to be called after a certain number of milliseconds
* Muat require("AtomicEventLoop") or import "AtomicEventLoop" in main.js to use.
* @method
* @param {function} func the Function to call
* @param {number} delay the number of milliseconds
* @param {any} [args] A comma separated list of parameters to pass to func
* @returns {number} the id of the timer to be used in clearTimeout in order to cancel the timeout
*/
declare function setTimeout(func: number, delay: number, ...args): number;
/**
* stops a previously queued timeout.
* Muat require("AtomicEventLoop") or import "AtomicEventLoop" in main.js to use.
* @method
* @param {number} timer_id the id of the timer that was created via setTimeout
*/
declare function clearTimeout(timer_id: number);
/**
* schedules a function to be called after the end of the current update cycle. SetImmediate timers are processed FIFO
* Muat require("AtomicEventLoop") or import "AtomicEventLoop" in main.js to use.
* @method
* @param {function} func the Function to call
* @param {any} [args] A comma separated list of parameters to pass to func
* @returns {number} the id of the setImmediate function to be used in clearImmediate in order to cancel it.
*/
declare function setImmediate(func: any, ...args): number;
/**
* stops a previously queued setImmediate callback.
* Muat require("AtomicEventLoop") or import "AtomicEventLoop" in main.js to use.
* @method
* @param {number} timer_id the id of the timer that was created via setImmediate
*/
declare function clearImmediate(timer_id: number);
declare interface DuktapeModule {
/**
* List of modules that have been loaded via the "require" statement
*
* @type {string[]}
* @memberOf DuktapeModule
*/
modLoaded: string[];
modSearch(id: string, require, exports, module);
}
declare var Duktape: DuktapeModule;