Introduce c2.later() function to Lua API. (#5154)

This commit is contained in:
Mm2PL
2024-02-25 12:45:59 +01:00
committed by GitHub
parent 101dc82ea0
commit a737d4b755
10 changed files with 128 additions and 2 deletions
+1
View File
@@ -95,4 +95,5 @@ declare module c2 {
: never;
function register_callback<T>(type: T, func: CbFunc<T>): void;
function later(callback: () => void, msec: number): void;
}
+6
View File
@@ -185,3 +185,9 @@ function c2.register_callback(type, func) end
---@param ... any Values to log. Should be convertible to a string with `tostring()`.
function c2.log(level, ...) end
--- Calls callback around msec milliseconds later. Does not freeze Chatterino.
---
---@param callback fun() The callback that will be called.
---@param msec number How long to wait.
function c2.later(callback, msec) end