migrate transaction category preset page to composition API and typescript

This commit is contained in:
MaysWind
2025-01-16 00:43:50 +08:00
parent 6ef42a9303
commit b09b66adc3
5 changed files with 190 additions and 116 deletions
+36
View File
@@ -1,5 +1,41 @@
import type { ColorValue } from '@/core/color.ts';
export enum CategoryType {
Income = 1,
Expense = 2,
Transfer = 3
}
export const ALL_CATEGORY_TYPES: CategoryType[] = [
CategoryType.Income,
CategoryType.Expense,
CategoryType.Transfer
];
export interface PresetCategory {
readonly name: string;
readonly categoryIconId: string;
readonly color: ColorValue;
readonly subCategories: PresetSubCategory[];
}
export interface PresetSubCategory {
readonly name: string;
readonly categoryIconId: string;
readonly color: ColorValue;
}
export interface LocalizedPresetCategory {
readonly name: string;
readonly type: CategoryType;
readonly icon: string;
readonly color: ColorValue;
readonly subCategories: LocalizedPresetSubCategory[];
}
export interface LocalizedPresetSubCategory {
readonly name: string;
readonly type: CategoryType;
readonly icon: string;
readonly color: ColorValue;
}