@@ -5,21 +5,20 @@ interface EngineLibraries {
55}
66
77/**
8- * Prints to chat.
9- * @param contents The contents to log .
8+ * Adds chat message(s) to the chat.
9+ * @param contents The contents to send to chat. They will be separated into different chat messages .
1010 */
11- declare function clientMessage ( ... contents : any [ ] ) : void ;
11+ declare function clientMessage ( ... messages : any [ ] ) : void ;
1212
1313/**
1414 * Load a specified library.
15- * @param path The filepath, HTTP or HTTPS link to the JS file.
16- * @throws Invalid filepath or Non-OK HTTP/HTTPS error code
15+ * @param library The Latite Scripting engine built-in library.
1716 */
18- declare function require < K extends keyof EngineLibraries > ( path : K ) : EngineLibraries [ K ] ;
17+ declare function require < K extends keyof EngineLibraries > ( library : K ) : EngineLibraries [ K ] ;
1918
2019/**
21- *
22- * @param path The path to load the library
20+ * Load and run a specified JavaScript module. This returns whatever is in `exports` or `module.exports` of the JavaScript module.
21+ * @param path The path to load the JavaScript file.
2322 */
2423declare function require ( path : string ) : any ;
2524
@@ -43,10 +42,22 @@ declare function setTimeout(func: () => void, timeout: number): number;
4342 * Calls a function every x milliseconds.
4443 * @param func The function to call
4544 * @param timeout The time in milliseconds
46- * @returns The Timeout ID
45+ * @returns The Interval ID
4746 */
4847declare function setInterval ( func : ( ) => void , timeout : number ) : number ;
4948
49+ /**
50+ * Cancels a timeout with a specified ID (stops it from executing.) No effect if the id is invalid.
51+ * @param timeoutId A valid Timeout ID. It is the return value of the `setTimeout` function.
52+ */
53+ declare function clearTimeout ( timeoutId : number ) : void ;
54+
55+ /**
56+ * Cancels an interval with a specified ID (stops it from executing.) No effect if the id is invalid.
57+ * @param intervalId A valid Interval ID. It is the return value of the `setInterval` function.
58+ */
59+ declare function clearInterval ( intervalId : number ) : void ;
60+
5061interface ScriptModule {
5162 /**
5263 * What the script exports.
0 commit comments