From b55af0620b04c92be960f7f89c3c5b4579b66a3e Mon Sep 17 00:00:00 2001 From: Casper Warden Date: Sat, 17 Aug 2024 16:16:43 +0100 Subject: [PATCH] 0.7.24 - Upgrade typescript --- lib/Bot.ts | 2 +- lib/classes/Agent.ts | 5 ++-- lib/classes/Circuit.ts | 12 ++++----- lib/classes/ObjectStoreLite.ts | 3 +-- lib/classes/Region.ts | 7 +++-- .../commands/CommunicationsCommands.ts | 3 +-- lib/classes/commands/RegionCommands.ts | 6 ++--- lib/classes/public/Avatar.ts | 4 +-- package-lock.json | 26 ++++++++++++------- package.json | 6 ++--- 10 files changed, 36 insertions(+), 38 deletions(-) diff --git a/lib/Bot.ts b/lib/Bot.ts index d2b30768..57fcddac 100644 --- a/lib/Bot.ts +++ b/lib/Bot.ts @@ -36,7 +36,7 @@ import Timer = NodeJS.Timer; export class Bot { private loginParams: LoginParameters; - private ping: Timer | null = null; + private ping: NodeJS.Timeout | null = null; private pingNumber = 0; private lastSuccessfulPing = 0; private circuitSubscription: Subscription | null = null; diff --git a/lib/classes/Agent.ts b/lib/classes/Agent.ts index 411d9b59..7e439742 100644 --- a/lib/classes/Agent.ts +++ b/lib/classes/Agent.ts @@ -29,7 +29,6 @@ import { BulkUpdateInventoryMessage } from './messages/BulkUpdateInventory'; import { InventoryItem } from './InventoryItem'; import { AgentDataUpdateMessage } from './messages/AgentDataUpdate'; import { InventoryLibrary } from '../enums/InventoryLibrary'; -import Timer = NodeJS.Timer; export class Agent { @@ -47,7 +46,7 @@ export class Agent hasVoice: boolean; isModerator: boolean }>, - timeout?: Timer + timeout?: NodeJS.Timeout }>(); controlFlags: ControlFlags = 0; openID: { @@ -90,7 +89,7 @@ export class Agent attachments: Wearable[]; serialNumber: number }; - agentUpdateTimer: Timer | null = null; + agentUpdateTimer: NodeJS.Timeout | null = null; estateManager = false; appearanceComplete = false; diff --git a/lib/classes/Circuit.ts b/lib/classes/Circuit.ts index d352070e..6dc4b8b9 100644 --- a/lib/classes/Circuit.ts +++ b/lib/classes/Circuit.ts @@ -22,8 +22,6 @@ import { Utils } from './Utils'; import * as Long from 'long'; -import Timer = NodeJS.Timer; - export class Circuit { secureSessionID: UUID; @@ -39,12 +37,12 @@ export class Circuit awaitingAck: { [key: number]: { packet: Packet, - timeout: Timer, + timeout: NodeJS.Timeout, sent: number } } = {}; receivedPackets: { - [key: number]: Timer + [key: number]: NodeJS.Timeout } = {}; active = false; @@ -179,7 +177,7 @@ export class Circuit return new Promise((resolve, reject) => { let subscription: null | Subscription = null; - let timeout: Timer | null = null; + let timeout: NodeJS.Timeout | null = null; const receivedChunks: { [key: number]: Buffer } = {}; const resetTimeout = function(): void { @@ -326,7 +324,7 @@ export class Circuit return new Promise((resolve, reject) => { const handleObj: { - timeout: Timer | null, + timeout: NodeJS.Timeout | null, subscription: Subscription | null } = { timeout: null, @@ -416,7 +414,7 @@ export class Circuit return new Promise((resolve, reject) => { const handleObj: { - timeout: Timer | null, + timeout: NodeJS.Timeout | null, subscription: Subscription | null } = { timeout: null, diff --git a/lib/classes/ObjectStoreLite.ts b/lib/classes/ObjectStoreLite.ts index 57784b84..7eeb21fd 100644 --- a/lib/classes/ObjectStoreLite.ts +++ b/lib/classes/ObjectStoreLite.ts @@ -41,7 +41,6 @@ import { LLSDNotationParser } from './llsd/LLSDNotationParser'; import { LLSDMap } from './llsd/LLSDMap'; import { LLGLTFMaterialOverride, LLGLTFTextureTransformOverride } from './LLGLTFMaterialOverride'; import * as Long from 'long'; -import Timer = NodeJS.Timer; export class ObjectStoreLite implements IObjectStore { @@ -88,7 +87,7 @@ export class ObjectStoreLite implements IObjectStore }>; private physicsSubscription: Subscription; private selectedPrimsWithoutUpdate = new Map(); - private selectedChecker?: Timer; + private selectedChecker?: NodeJS.Timeout; private blacklist: Map = new Map(); private pendingResolves: Set = new Set(); diff --git a/lib/classes/Region.ts b/lib/classes/Region.ts index 0f96fc8a..de4f43a8 100644 --- a/lib/classes/Region.ts +++ b/lib/classes/Region.ts @@ -38,7 +38,6 @@ import { ParcelOverlayMessage } from './messages/ParcelOverlay'; import { ILandBlock } from './interfaces/ILandBlock'; import { LandFlags } from '../enums/LandFlags'; import { ParcelPropertiesRequestMessage } from './messages/ParcelPropertiesRequest'; -import Timer = NodeJS.Timer; import { UUID } from './UUID'; import { RegionFlags } from '../enums/RegionFlags'; import { BotOptionFlags } from '../enums/BotOptionFlags'; @@ -1089,7 +1088,7 @@ export class Region } else { - let timeout: Timer | null = null; + let timeout: NodeJS.Timeout | null = null; const subscription = this.parcelOverlayCompleteEvent.subscribe(() => { if (timeout !== null) @@ -1118,7 +1117,7 @@ export class Region } else { - let timeout: Timer | null = null; + let timeout: NodeJS.Timeout | null = null; const subscription = this.parcelsCompleteEvent.subscribe(() => { if (timeout !== null) @@ -1147,7 +1146,7 @@ export class Region } else { - let timeout: Timer | null = null; + let timeout: NodeJS.Timeout | null = null; const subscription = this.terrainCompleteEvent.subscribe(() => { if (timeout !== null) diff --git a/lib/classes/commands/CommunicationsCommands.ts b/lib/classes/commands/CommunicationsCommands.ts index 51f8140f..83ef666e 100644 --- a/lib/classes/commands/CommunicationsCommands.ts +++ b/lib/classes/commands/CommunicationsCommands.ts @@ -17,7 +17,6 @@ import { Utils } from '../Utils'; import { UUID } from '../UUID'; import { Vector3 } from '../Vector3'; import { CommandsBase } from './CommandsBase'; -import Timer = NodeJS.Timer; export class CommunicationsCommands extends CommandsBase { @@ -284,7 +283,7 @@ export class CommunicationsCommands extends CommandsBase { to = new UUID(to); } - let typeTimer: Timer | null = null; + let typeTimer: NodeJS.Timeout | null = null; this.startTypingIM(to).then(() => { typeTimer = setInterval(() => diff --git a/lib/classes/commands/RegionCommands.ts b/lib/classes/commands/RegionCommands.ts index 95878d55..1f257500 100644 --- a/lib/classes/commands/RegionCommands.ts +++ b/lib/classes/commands/RegionCommands.ts @@ -33,8 +33,6 @@ import { Vector3 } from '../Vector3'; import { CommandsBase } from './CommandsBase'; import Timeout = NodeJS.Timeout; -import Timer = NodeJS.Timer; - export interface GetObjectsOptions { resolve?: boolean; @@ -436,7 +434,7 @@ export class RegionCommands extends CommandsBase { return new Promise((resolve, reject) => { - let tmr: Timer | null = null; + let tmr: NodeJS.Timeout | null = null; const subscription = this.currentRegion.clientEvents.onNewObjectEvent.subscribe(async(event: NewObjectEvent) => { if (event.localID === localID) @@ -461,7 +459,7 @@ export class RegionCommands extends CommandsBase { return new Promise((resolve, reject) => { - let tmr: Timer | null = null; + let tmr: NodeJS.Timeout | null = null; const subscription = this.currentRegion.clientEvents.onNewObjectEvent.subscribe(async(event: NewObjectEvent) => { if (event.objectID.equals(objectID)) diff --git a/lib/classes/public/Avatar.ts b/lib/classes/public/Avatar.ts index 2962366f..a622f691 100644 --- a/lib/classes/public/Avatar.ts +++ b/lib/classes/public/Avatar.ts @@ -4,8 +4,6 @@ import { Vector3 } from '../Vector3'; import { Quaternion } from '../Quaternion'; import { Subject, Subscription } from 'rxjs'; import { UUID } from '../UUID'; -import Timer = NodeJS.Timer; - export class Avatar extends AvatarQueryResult { private rotation: Quaternion = Quaternion.getIdentity(); @@ -198,7 +196,7 @@ export class Avatar extends AvatarQueryResult catch (ignore) { let subs: Subscription | undefined = undefined; - let timr: Timer | undefined = undefined; + let timr: NodeJS.Timeout | undefined = undefined; subs = this.onAttachmentAdded.subscribe((obj: GameObject) => { if (obj.itemID.equals(itemID)) diff --git a/package-lock.json b/package-lock.json index e986fb6f..6e0fd918 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,7 +40,7 @@ "devDependencies": { "@angular-eslint/eslint-plugin": "^12.7.0", "@types/micromatch": "^4.0.4", - "@types/node": "^16.18.60", + "@types/node": "^22.4.0", "@types/tiny-async-pool": "^2.0.2", "@types/uuid": "^8.3.4", "@types/xml2js": "^0.4.14", @@ -52,7 +52,7 @@ "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "tslint": "^6.1.3", - "typescript": "^4.9.5" + "typescript": "^5.5.4" }, "engines": { "node": ">=7.6.0" @@ -454,9 +454,12 @@ "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==" }, "node_modules/@types/node": { - "version": "16.18.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.60.tgz", - "integrity": "sha512-ZUGPWx5vKfN+G2/yN7pcSNLkIkXEvlwNaJEd4e0ppX7W2S8XAkdc/37hM4OUNJB9sa0p12AOvGvxL4JCPiz9DA==" + "version": "22.4.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.4.0.tgz", + "integrity": "sha512-49AbMDwYUz7EXxKU/r7mXOsxwFr4BYbvB7tWYxVuLdb2ibd30ijjXINSMAHiEEZk5PCRBmW1gUeisn2VMKt3cQ==", + "dependencies": { + "undici-types": "~6.19.2" + } }, "node_modules/@types/responselike": { "version": "1.0.3", @@ -3601,18 +3604,23 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.6.tgz", + "integrity": "sha512-e/vggGopEfTKSvj4ihnOLTsqhrKRN3LeO6qSN/GxohhuRv8qH9bNQ4B8W7e/vFL+0XTnmHPB4/kegunZGA4Org==" + }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", diff --git a/package.json b/package.json index f3b5f214..fded6620 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@caspertech/node-metaverse", - "version": "0.7.22", + "version": "0.7.24", "description": "A node.js interface for Second Life.", "main": "dist/lib/index.js", "types": "dist/lib/index.d.ts", @@ -25,7 +25,7 @@ "devDependencies": { "@angular-eslint/eslint-plugin": "^12.7.0", "@types/micromatch": "^4.0.4", - "@types/node": "^16.18.60", + "@types/node": "^22.4.0", "@types/tiny-async-pool": "^2.0.2", "@types/uuid": "^8.3.4", "@types/xml2js": "^0.4.14", @@ -37,7 +37,7 @@ "source-map-support": "^0.5.21", "ts-node": "^10.9.1", "tslint": "^6.1.3", - "typescript": "^4.9.5" + "typescript": "^5.5.4" }, "dependencies": { "@caspertech/llsd": "^1.0.5",