fix: restore full typecheck stability

This commit is contained in:
Misaka
2026-03-21 09:17:58 +08:00
parent 08bd2cb7d5
commit 2fba07fd8f
13 changed files with 114 additions and 130 deletions

View File

@@ -0,0 +1,30 @@
import type { UserInfo } from './user.types'
export interface LoginRequest {
username: string
password: string
}
export interface LoginResponse {
success: boolean
userInfo?: UserInfo
error?: string
}
export interface SilentLoginResponse {
success: boolean
userInfo?: UserInfo
requiresUserSelection?: boolean
error?: string
}
export interface UserSelectionResponse {
success: boolean
userInfo?: UserInfo
error?: string
}
export interface CurrentUserResponse {
isAuthenticated: boolean
userInfo?: UserInfo
}

View File

@@ -11,7 +11,7 @@ import type {
ExportResultItem,
ExportResultResponse
} from './cleaner.types'
import type { IpcResult } from '../ipc'
import type { IpcResult } from './ipc.types'
/**
* MySQL connection configuration
@@ -176,13 +176,23 @@ export interface ReportAPI {
/**
* List all reports across all users (Admin only typically)
*/
listAll: () => Promise<IpcResult<{ key: string; filename: string; username: string; lastModified?: Date; size?: number }[]>>
listAll: () => Promise<
IpcResult<
{ key: string; filename: string; username: string; lastModified?: Date; size?: number }[]
>
>
/**
* List reports for a specific user
* @param username - Username to list reports for
*/
listByUser: (username: string) => Promise<IpcResult<{ key: string; filename: string; username: string; lastModified?: Date; size?: number }[]>>
listByUser: (
username: string
) => Promise<
IpcResult<
{ key: string; filename: string; username: string; lastModified?: Date; size?: number }[]
>
>
/**
* Download a specific report by key

View File

@@ -0,0 +1,6 @@
export interface IpcResult<T = unknown> {
success: boolean
data?: T
error?: string
code?: string
}

View File

@@ -0,0 +1,18 @@
export interface OrderMapping {
input: string
productionId?: string
orderNumber?: string
resolved: boolean
error?: string
}
export type OrderNumberType = 'productionId' | 'orderNumber' | 'unknown'
export interface ResolutionStats {
totalInputs: number
validOrderNumbers: number
validProductionIds: number
resolvedCount: number
failedCount: number
unknownFormat: number
}

View File

@@ -0,0 +1,14 @@
import type { OrderMapping, ResolutionStats } from './order-resolver.types'
export interface ResolverInput {
inputs: string[]
}
export interface ResolverResponse {
success: boolean
mappings?: OrderMapping[]
validOrderNumbers?: string[]
warnings?: string[]
stats?: ResolutionStats
error?: string
}