refactor(frontend): comprehensive architectural optimization and base component extraction
- Standardized table loading logic with enhanced useTableLoader. - Unified form submission patterns via new useForm composable. - Extracted common UI components: SearchInput and StatusBadge. - Centralized common interface definitions in types/index.ts. - Achieved TypeScript zero-error status across refactored files. - Greatly improved code reusability and maintainability.
This commit is contained in:
@@ -2,6 +2,26 @@
|
||||
* Core Type Definitions for Sub2API Frontend
|
||||
*/
|
||||
|
||||
// ==================== Common Types ====================
|
||||
|
||||
export interface SelectOption {
|
||||
value: string | number | boolean | null
|
||||
label: string
|
||||
[key: string]: any // Support extra properties for custom templates
|
||||
}
|
||||
|
||||
export interface BasePaginationResponse<T> {
|
||||
items: T[]
|
||||
total: number
|
||||
page: number
|
||||
page_size: number
|
||||
pages: number
|
||||
}
|
||||
|
||||
export interface FetchOptions {
|
||||
signal?: AbortSignal
|
||||
}
|
||||
|
||||
// ==================== User & Auth Types ====================
|
||||
|
||||
export interface User {
|
||||
@@ -890,4 +910,4 @@ export interface UpdateUserAttributeRequest {
|
||||
|
||||
export interface UserAttributeValuesMap {
|
||||
[attributeId: number]: string
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user