Skip to content

Commit 6c91a3c

Browse files
committed
fix: 修复TypeScript编译错误
- 移除未使用的导入变量(TS6133错误) - HistoryPanel.tsx: 移除Tooltip和UploadIcon - ProfileManager.tsx: 移除EditIcon和AddIcon - ProfileSelector.tsx: 移除Tooltip和AddIcon - FileUpload.tsx: 移除Alert - MarkdownEditor.tsx: 移除getFilterStats - ProfilesPage.tsx: 移除EditIcon - 修复未使用的参数(TS6133错误) - ProfileManager.tsx: 重命名onProfileChange为_onProfileChange - ProfileManager.tsx: 重命名event为_event - 修复类型错误(TS2322和TS2339错误) - PromptTemplate.tsx: 移除不支持的ref属性 - pdfProcessor.ts: 为PDF元数据添加any类型断言 - 验证构建成功,所有TypeScript错误已修复
1 parent 91a5b05 commit 6c91a3c

File tree

8 files changed

+9
-18
lines changed

8 files changed

+9
-18
lines changed

src/components/HistoryPanel.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,14 @@ import {
2323
Alert,
2424
Divider,
2525
Menu,
26-
MenuItem,
27-
Tooltip
26+
MenuItem
2827
} from '@mui/material';
2928
import {
3029
History as HistoryIcon,
3130
Search as SearchIcon,
3231
Delete as DeleteIcon,
3332
Edit as EditIcon,
3433
Download as DownloadIcon,
35-
Upload as UploadIcon,
3634
MoreVert as MoreVertIcon,
3735
Close as CloseIcon,
3836
Restore as RestoreIcon

src/components/ProfileManager.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ import {
2626
Tab
2727
} from '@mui/material';
2828
import {
29-
Edit as EditIcon,
3029
Delete as DeleteIcon,
3130
ContentCopy as CopyIcon,
3231
MoreVert as MoreVertIcon,
33-
Add as AddIcon,
3432
Download as DownloadIcon,
3533
Upload as UploadIcon,
3634
Close as CloseIcon
@@ -68,7 +66,7 @@ function TabPanel(props: TabPanelProps) {
6866
const ProfileManager: React.FC<ProfileManagerProps> = ({
6967
open,
7068
onClose,
71-
onProfileChange
69+
onProfileChange: _onProfileChange
7270
}) => {
7371
const [profiles, setProfiles] = useState<Profile[]>([]);
7472
const [tabValue, setTabValue] = useState(0);
@@ -89,7 +87,7 @@ const ProfileManager: React.FC<ProfileManagerProps> = ({
8987
setProfiles(allProfiles);
9088
};
9189

92-
const handleTabChange = (event: React.SyntheticEvent, newValue: number) => {
90+
const handleTabChange = (_event: React.SyntheticEvent, newValue: number) => {
9391
setTabValue(newValue);
9492
};
9593

src/components/ProfileSelector.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ import {
1313
Divider,
1414
ListItemIcon,
1515
ListItemText,
16-
Chip,
17-
Tooltip
16+
Chip
1817
} from '@mui/material';
1918
import {
2019
ExpandMore as ExpandMoreIcon,
21-
Settings as SettingsIcon,
22-
Add as AddIcon
20+
Settings as SettingsIcon
2321
} from '@mui/icons-material';
2422
import { Profile } from '../types/profile';
2523
import { profileManager } from '../utils/profileManager';

src/pages/FileUpload.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import React, {useState, useRef} from 'react';
33
import {FileInfo} from "../types/types.ts";
44
import { convertPDFToMarkdown, convertPDFResultToFileInfo, isPDFFile } from '../utils/pdfProcessor';
5-
import { Alert, LinearProgress, Typography, Box } from '@mui/material';
5+
import { LinearProgress, Typography, Box } from '@mui/material';
66

77
interface FileUploadProps {
88
onFilesUploaded: (files: FileInfo[]) => void;

src/pages/MarkdownEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import './styles.css';
1515
import { FileInfo } from '../types/types';
1616
import { HistoryRecord, FileFilter, DEFAULT_FILE_FILTER } from '../types/history';
1717
import { historyDB } from '../utils/indexedDB';
18-
import { applyFileFilter, getFilterStats } from '../utils/fileFilter';
18+
import { applyFileFilter } from '../utils/fileFilter';
1919
import HistoryPanel from '../components/HistoryPanel';
2020
import FileFilterComponent from '../components/FileFilter';
2121

src/pages/ProfilesPage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
import {
3030
Search as SearchIcon,
3131
Add as AddIcon,
32-
Edit as EditIcon,
3332
Delete as DeleteIcon,
3433
ContentCopy as CopyIcon,
3534
PlayArrow as LoadIcon,

src/pages/PromptTemplate.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// PromptTemplate.tsx
2-
import {useEffect, useState, useRef} from 'react';
2+
import {useEffect, useState} from 'react';
33
import MarkdownEditor from './MarkdownEditor';
44
import './PromptTemplate.css';
55
import {Button, TextField, Box, Dialog, DialogTitle, DialogContent, DialogActions, Alert} from '@mui/material';
@@ -14,7 +14,6 @@ import ProfileManager from '../components/ProfileManager';
1414
export default function PromptTemplate() {
1515
const {id} = useParams();
1616
const navigate = useNavigate();
17-
const markdownEditorRef = useRef<any>(null);
1817

1918
const [ruleContent, setRuleContent] = useState(() => {
2019
const saved = localStorage.getItem('ruleContent');
@@ -210,7 +209,6 @@ export default function PromptTemplate() {
210209
</div>
211210

212211
<MarkdownEditor
213-
ref={markdownEditorRef}
214212
ruleContent={ruleContent}
215213
roleContent={roleContent}
216214
outputContent={outputContent}

src/utils/pdfProcessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function convertPDFToMarkdown(
5252

5353
// 获取PDF元数据
5454
const metadata = await pdf.getMetadata();
55-
const info = metadata.info;
55+
const info = metadata.info as any;
5656

5757
const totalPages = pdf.numPages;
5858
const pagesToProcess = Math.min(totalPages, maxPages);

0 commit comments

Comments
 (0)