mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
Use return type deduction for timers
Fix updates to Node.js timers types breaking the TypeScript build by deducing the correct type from the return type of the setTimeout/setInterval functions.
This commit is contained in:
1 parent
e51a644788
commit
9c9adf7c8e
6 files changed
+8
-8
No files matched your search
@@ -87,7 +87,7 @@ export default class Controller {
|
||||
|
||||
logDirectory: string = "";
|
||||
clusterLogIndex: lib.LogIndex | null = null;
|
||||
clusterLogBuildInterval: NodeJS.Timer | null = null;
|
||||
clusterLogBuildInterval: ReturnType<typeof setInterval> | null = null;
|
||||
|
||||
constructor(
|
||||
clusterLogger: winston.Logger,
|
||||
|
||||
@@ -17,7 +17,7 @@ export interface WebSocketClusterio extends WebSocket {
|
||||
* @alias module:controller/src/WsServerConnector
|
||||
*/
|
||||
export default class WsServerConnector extends lib.WebSocketBaseConnector {
|
||||
_timeoutId: NodeJS.Timeout | null = null;
|
||||
_timeoutId: ReturnType<typeof setTimeout> | null = null;
|
||||
declare _socket: WebSocketClusterio | null;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -255,7 +255,7 @@ interface ProxyStream {
|
||||
mime: string | null;
|
||||
filename: string | null;
|
||||
events: events.EventEmitter;
|
||||
timeout: NodeJS.Timeout;
|
||||
timeout: ReturnType<typeof setTimeout>;
|
||||
}
|
||||
|
||||
export async function createProxyStream(app: Application): Promise<ProxyStream> {
|
||||
|
||||
Reference in new issue
Block a user