refactor: change type from 'any' to 'unknown' in ApiResponse and EventHandler for better type safety
Some checks failed
Frontend CI / lint (push) Failing after 19s
Frontend CI / build (push) Has been skipped

This commit is contained in:
JSC
2025-08-15 00:02:20 +02:00
parent 4e50e7e79d
commit c6912f5a92
2 changed files with 3 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
// Generic API types // Generic API types
export interface ApiResponse<T = any> { export interface ApiResponse<T = unknown> {
data?: T data?: T
message?: string message?: string
error?: string error?: string

View File

@@ -2,7 +2,7 @@
* Simple event emitter for cross-component communication * Simple event emitter for cross-component communication
*/ */
type EventHandler = (...args: any[]) => void type EventHandler = (...args: unknown[]) => void
class EventEmitter { class EventEmitter {
private events: Map<string, EventHandler[]> = new Map() private events: Map<string, EventHandler[]> = new Map()
@@ -24,7 +24,7 @@ class EventEmitter {
} }
} }
emit(event: string, ...args: any[]): void { emit(event: string, ...args: unknown[]): void {
const handlers = this.events.get(event) const handlers = this.events.get(event)
if (handlers) { if (handlers) {
handlers.forEach(handler => handler(...args)) handlers.forEach(handler => handler(...args))