Fix TypeScript errors

Fixes TypeScript errors related to missing properties and incorrect exports.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-22 07:12:06 +00:00
parent aa8381a823
commit 81afd624a4
7 changed files with 31 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
import React from 'react';
import { useBudgetState } from './useBudgetState';
import { BudgetContext, BudgetContextType } from './useBudget';
import { BudgetPeriod } from './types';
import { BudgetPeriod, Transaction } from './types';
// 컨텍스트 프로바이더 컴포넌트
export const BudgetProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
@@ -19,4 +19,5 @@ export const BudgetProvider: React.FC<{ children: React.ReactNode }> = ({ childr
export { useBudget } from './useBudget';
export type { BudgetContextType } from './useBudget';
export type { BudgetPeriod } from './types';
// types.ts에서 타입들을 export
export { BudgetPeriod, Transaction } from './types';

View File

@@ -27,10 +27,13 @@ export interface BudgetContextType {
budgetData: BudgetData;
selectedTab: BudgetPeriod;
setSelectedTab: (tab: BudgetPeriod) => void;
addTransaction: (transaction: Transaction) => void;
updateTransaction: (updatedTransaction: Transaction) => void;
deleteTransaction: (id: string) => void;
handleBudgetGoalUpdate: (type: BudgetPeriod, amount: number, newCategoryBudgets?: Record<string, number>) => void;
getCategorySpending: () => CategoryBudget[];
getPaymentMethodStats: () => { method: string; amount: number; percentage: number }[];
resetBudgetData?: () => void; // 선택적 필드로 유지
}
// Transaction 타입 (기존 TransactionCard에서 가져옴)

View File

@@ -1,3 +1,4 @@
import { useContext, createContext } from 'react';
import { BudgetData, BudgetPeriod, Transaction } from './types';
@@ -17,6 +18,7 @@ export interface BudgetContextType {
updateTransaction: (transaction: Transaction) => void;
deleteTransaction: (id: string) => void;
handleBudgetGoalUpdate: (type: BudgetPeriod, amount: number, newCategoryBudgets?: Record<string, number>) => void;
getPaymentMethodStats: () => Array<{ method: string; amount: number; percentage: number }>;
resetBudgetData?: () => void; // 선택적 필드로 추가
}