첫 커밋
This commit is contained in:
47
src/types/api.ts
Normal file
47
src/types/api.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
export interface ApiResponse<T = unknown> {
|
||||
success: boolean;
|
||||
data: T;
|
||||
message: string;
|
||||
timestamp: string;
|
||||
}
|
||||
|
||||
export interface ApiErrorResponse {
|
||||
success: false;
|
||||
error: {
|
||||
code: string;
|
||||
message: string;
|
||||
details?: any;
|
||||
};
|
||||
timestamp: string;
|
||||
}
|
||||
|
||||
export interface PaginatedResponse<T> {
|
||||
data: T[];
|
||||
pagination: {
|
||||
page: number;
|
||||
limit: number;
|
||||
total: number;
|
||||
totalPages: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiRequestConfig {
|
||||
timeout?: number;
|
||||
retries?: number;
|
||||
retryDelay?: number;
|
||||
headers?: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface FileUploadProgress {
|
||||
loaded: number;
|
||||
total: number;
|
||||
percentage: number;
|
||||
}
|
||||
|
||||
export interface FileUploadResponse {
|
||||
fileId: string;
|
||||
filename: string;
|
||||
url: string;
|
||||
size: number;
|
||||
mimeType: string;
|
||||
}
|
||||
Reference in New Issue
Block a user