Allow void return type in timer callbacks (#1916)

This commit is contained in:
Alienmario 2023-03-03 06:28:42 +01:00 committed by GitHub
parent 693e584dcd
commit 850f96b986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,17 +54,36 @@ typeset Timer
* @param data Handle or value passed to CreateTimer() when timer was created.
* @return Plugin_Stop to stop a repeating timer, any other value for
* default behavior.
* Ignored for non-repeating timers (use void return type).
*/
function Action(Handle timer, any data);
/**
* Called when the timer interval has elapsed.
* For repeating timers, use the callback with return value.
*
* @param timer Handle to the timer object.
* @param data Handle or value passed to CreateTimer() when timer was created.
*/
function void(Handle timer, any data);
/**
* Called when the timer interval has elapsed.
*
* @param timer Handle to the timer object.
* @return Plugin_Stop to stop a repeating timer, any other value for
* default behavior.
* Ignored for non-repeating timers (use void return type).
*/
function Action(Handle timer);
/**
* Called when the timer interval has elapsed.
* For repeating timers, use the callback with return value.
*
* @param timer Handle to the timer object.
*/
function void(Handle timer);
};
/**