mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 19:54:39 +00:00
074e73b0fd
This change adds JSDoc-style comments to several functions and classes across the codebase to improve readability and maintainability. Comments were added to: - `src/SEQTA.ts`: Explained the `init()` function. - `src/seqta/utils/waitForElm.ts`: Detailed the `waitForElm()` function, its parameters, and behavior. - `src/seqta/utils/stringToHTML.ts`: Clarified the `stringToHTML()` function, including its sanitization and styling features. - `src/seqta/utils/delay.ts`: Added a brief explanation for the `delay()` utility. - `src/seqta/utils/mutex.ts`: Documented the `Mutex` class and its `acquire` method (renamed from `lock`), explaining its asynchronous locking mechanism and the role of the returned unlock function.
13 lines
461 B
TypeScript
13 lines
461 B
TypeScript
/**
|
|
* Pauses execution for a specified number of milliseconds.
|
|
*
|
|
* This function returns a Promise that resolves after the given delay,
|
|
* allowing it to be used with `async/await` to pause asynchronous operations.
|
|
*
|
|
* @param {number} ms The number of milliseconds to delay.
|
|
* @returns {Promise<void>} A Promise that resolves after the specified delay.
|
|
*/
|
|
export function delay(ms: number) {
|
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
}
|