fix all typescript lenting errors

This commit is contained in:
KingKDot
2026-05-06 20:07:15 -05:00
parent df0f4e45a4
commit 7c858e4984
14 changed files with 56 additions and 47 deletions
+7 -21
View File
@@ -1,7 +1,6 @@
import { encodeMessage, decodeMessage, WireMessage } from "./protocol";
import { Buffer } from "node:buffer";
import { encodeMessage, type Hello, type Ping, type WireMessage } from "./protocol";
let _geoip: typeof import("geoip-lite") extends { default: infer D } ? D : never;
let _geoip: typeof import("geoip-lite");
async function getGeoip() {
if (!_geoip) {
_geoip = (await import("geoip-lite")).default;
@@ -15,7 +14,7 @@ import {
generateThumbnail,
setLatestFrame,
} from "./thumbnails";
import { upsertClientRow } from "./db";
import { upsertClientRow, type ClientDbRow } from "./db";
import { metrics } from "./metrics";
/** Strip control chars and clamp length on client-supplied info strings. */
@@ -58,22 +57,9 @@ function sanitizeJsonField(
const MAX_PING_RTT_MS = 15_000;
const CLIENT_DB_SYNC_INTERVAL_MS = Number(process.env.OVERLORD_CLIENT_DB_SYNC_MS || 5000);
const lastClientDbSync = new Map<string, number>();
const pendingClientDbUpdates = new Map<
string,
Partial<ClientInfo> & {
id: string;
lastSeen?: number;
online?: number;
}
>();
const pendingClientDbUpdates = new Map<string, ClientDbRow>();
function queueClientDbUpdate(
partial: Partial<ClientInfo> & {
id: string;
lastSeen?: number;
online?: number;
},
): void {
function queueClientDbUpdate(partial: ClientDbRow): void {
const existing = pendingClientDbUpdates.get(partial.id);
if (!existing) {
pendingClientDbUpdates.set(partial.id, { ...partial });
@@ -117,7 +103,7 @@ export function clearClientSyncState(clientId: string): void {
export async function handleHello(
info: ClientInfo,
payload: WireMessage,
payload: Hello,
ws: any,
ip?: string,
) {
@@ -189,7 +175,7 @@ export async function handleHello(
}
export function handlePing(info: ClientInfo, payload: WireMessage, ws: any) {
export function handlePing(info: ClientInfo, payload: Ping, ws: any) {
//console.log(`[ping] from client=${info.id} ts=${payload.ts ?? ""}`);
const now = Date.now();
info.lastSeen = now;