diff --git a/shared/js/timers.js b/shared/js/timers.js index 9efefc78..47be0788 100644 --- a/shared/js/timers.js +++ b/shared/js/timers.js @@ -38,6 +38,7 @@ class Timer { lastTick; /** @type {boolean} */ once; + /** @type {{ fileName: string, lineNumber: number }} */ location; @@ -81,6 +82,7 @@ class Timer { assertIsType(type, "number", "Expected a number as first argument"); assertIsType(callback, "function", "Expected a function as second argument"); assertIsType(interval, "number", "Expected a number as third argument"); + assertIsType(once, "boolean", "Expected a boolean as fourth argument"); this.interval = interval; this.callback = callback.bind(this, ...(Array.isArray(args) ? args : [])); diff --git a/types/shared/index.d.ts b/types/shared/index.d.ts index cf0b639a..305677c9 100644 --- a/types/shared/index.d.ts +++ b/types/shared/index.d.ts @@ -3468,7 +3468,7 @@ declare abstract class Timer { public interval: number; public callback: Function; public lastTick: number; - public once?: boolean; + public once: boolean; public location: import("@altv/shared").SourceLocation; public get type(): import("@altv/shared").Enums.TimerType; diff --git a/types/shared/package.json b/types/shared/package.json index aefe9daa..83a6fa75 100644 --- a/types/shared/package.json +++ b/types/shared/package.json @@ -1,6 +1,6 @@ { "name": "@altv/shared", - "version": "0.0.23", + "version": "0.0.24", "description": "This package contains the type definitions for the alt:V JS module v2 shared types", "types": "index.d.ts", "files": [