fix: resolve TypeScript import errors for download types module

### Changes:
- Moved types from legacy 'types/download.ts' to '@lib/download/types'
- Updated all imports to use the new location:
  - src/components/download/DownloadListingContent.tsx
  - src/components/download/FileTable.tsx
  - src/lib/download-data.ts
  - src/lib/download-manifest.ts
  - src/app/download/[...segments]/page.tsx

### Why:
- Resolved TS6137 error: Cannot import type declaration files
- Aligns with codebase pattern: types co-located with modules (@lib/iac/types, @lib/mail/types)
- Uses consistent @ alias import pattern throughout codebase

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Haitao Pan 2025-11-11 17:08:46 +08:00
parent 79d7ca0dc5
commit 2b0010d92e
9 changed files with 8 additions and 9921 deletions

View File

@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
import "./.next/dev/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ import {
formatSegmentLabel,
} from '../../../lib/download-data'
import { DOWNLOAD_LISTINGS, getDownloadListings } from '../../../lib/download-manifest'
import type { DirListing } from '../../../../types/download'
import type { DirListing } from '@lib/download/types'
const allListings = getDownloadListings()

View File

@ -8,7 +8,7 @@ import { useLanguage } from '@i18n/LanguageProvider'
import { translations } from '@i18n/translations'
import { formatDate } from '@lib/format'
import { formatSegmentLabel, type DownloadSection } from '@lib/download-data'
import type { DirListing } from '../../types/download'
import type { DirListing } from '@lib/download/types'
type DownloadListingContentProps = {
segments: string[]

View File

@ -6,7 +6,7 @@ import CopyButton from './CopyButton'
import { useLanguage } from '@i18n/LanguageProvider'
import { translations } from '@i18n/translations'
import { formatBytes, formatDate } from '../../lib/format'
import type { DirListing } from '../../types/download'
import type { DirListing } from '@lib/download/types'
interface FileTableProps {
listing: DirListing

View File

@ -1,4 +1,4 @@
import type { DirListing } from '../types/download'
import type { DirListing } from '@lib/download/types'
export interface DownloadSection {
key: string

View File

@ -3,7 +3,7 @@ import 'server-only'
import fs from 'node:fs'
import path from 'node:path'
import type { DirListing } from '../types/download'
import type { DirListing } from '@lib/download/types'
const readListings = (relativePath: string): DirListing[] => {
try {

File diff suppressed because one or more lines are too long