Refactor type annotations and router initialization

Standardized type annotations for interfaces in user.ts and improved type safety in webapi.ts. Updated all Express router initializations to explicitly declare the Router type. Added missing RequestHandler typings in uploader modules for better type checking.
This commit is contained in:
手瓜一十雪 committed 2026-01-22 17:35:54 +08:00
1 parent e25dd38acd
commit dd9b2252b7
16 files changed
+123 -121

No files matched your search

@@ -1,5 +1,5 @@
import multer from 'multer';
import { Request, Response } from 'express';
import { Request, Response, RequestHandler } from 'express';
import fs from 'fs';
import path from 'path';
import { randomUUID } from 'crypto';
@@ -65,7 +65,7 @@ export const createDiskStorage = (uploadPath: string) => {
});
};
export const createDiskUpload = (uploadPath: string) => {
export const createDiskUpload = (uploadPath: string): RequestHandler => {
const upload = multer({
storage: createDiskStorage(uploadPath),
limits: {