fix. 코드 리팩토링, 워닝 수정

This commit is contained in:
clkim
2025-09-16 18:24:35 +09:00
parent 84b8607bec
commit d6301350ae
10 changed files with 317 additions and 250 deletions

View File

@@ -0,0 +1,45 @@
/**
* 공통 API 타입 정의
*/
// HTTP 메소드 타입
export type HttpMethod =
| 'GET'
| 'HEAD'
| 'PATCH'
| 'POST'
| 'PUT'
| 'DELETE'
| 'CONNECT'
| 'OPTIONS'
| 'TRACE'
// 공통 Fetch 옵션 타입
export interface FetchOptions {
query?: object | null
headers?: object | null
body?: object | null
key?: string | null
loading?: { localId?: string } | boolean
}
// Fetch 요청 옵션 타입
export interface FetchRequestOptions {
method: HttpMethod
headers: Record<string, string>
query?: object
body?: object
key?: string
}
export interface FetchErrorObject {
data?: unknown
statusCode?: number
statusMessage?: string
}
// 요청 객체 타입 (IP 조회용)
export interface RequestObject {
headers: Record<string, string>
socket: { remoteAddress?: string }
}