Skip to content

Commit aafb914

Browse files
committed
fix: sth about types
1 parent 786ff04 commit aafb914

File tree

5 files changed

+29
-31
lines changed

5 files changed

+29
-31
lines changed

src/packages/uploader/index.taro.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { Uploader } from './uploader.taro'
22

33
export type { UploaderProps } from './uploader.taro'
44

5-
export type { FileType, FileItem, FileItemStatus } from '../uploader'
5+
export type { FileType, FileItem, FileItemStatus } from './types'
66
export default Uploader

src/packages/uploader/index.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,6 @@
1-
import { ReactNode } from 'react'
21
import { Uploader } from './uploader'
32

43
export type { UploaderProps } from './uploader'
54

6-
type FileItem = {
7-
status?: FileItemStatus
8-
9-
message?: string
10-
11-
uid?: string | number
12-
13-
name?: string
14-
15-
url?: string
16-
17-
type?: 'image' | 'list' | string
18-
19-
path?: string
20-
21-
loadingIcon?: ReactNode
22-
23-
failIcon?: ReactNode
24-
25-
file?: File
26-
}
27-
28-
type FileItemStatus = 'ready' | 'uploading' | 'success' | 'error'
29-
30-
type FileType<T> = { [key: string]: T }
31-
32-
export type { FileType, FileItem, FileItemStatus }
5+
export type { FileType, FileItem, FileItemStatus } from './types'
336
export default Uploader

src/packages/uploader/types.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export type FileItem = {
2+
status?: FileItemStatus
3+
4+
message?: string
5+
6+
uid?: string | number
7+
8+
name?: string
9+
10+
url?: string
11+
12+
type?: 'image' | 'list' | string
13+
14+
path?: string
15+
16+
loadingIcon?: React.ReactNode
17+
18+
failIcon?: React.ReactNode
19+
20+
file?: File
21+
}
22+
23+
export type FileItemStatus = 'ready' | 'uploading' | 'success' | 'error'
24+
25+
export type FileType<T> = { [key: string]: T }

src/packages/uploader/uploader.taro.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Button from '@/packages/button/index.taro'
1414
import { useConfig } from '@/packages/configprovider/configprovider.taro'
1515
import { funcInterceptor } from '@/utils/interceptor'
1616
import { BasicComponent, ComponentDefaults } from '@/utils/typings'
17-
import { FileItem } from '../uploader'
17+
import { FileItem } from './types'
1818
import { usePropsValue } from '@/utils/use-props-value'
1919
import { Preview } from '@/packages/uploader/preview.taro'
2020

src/packages/uploader/uploader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { BasicComponent, ComponentDefaults } from '@/utils/typings'
1414
import Button from '@/packages/button'
1515
import { usePropsValue } from '@/utils/use-props-value'
1616
import { Preview } from '@/packages/uploader/preview'
17-
import { FileItem } from '../uploader'
17+
import { FileItem } from './types'
1818
import { mergeProps } from '@/utils/merge-props'
1919

2020
export interface UploaderProps extends BasicComponent {

0 commit comments

Comments
 (0)