-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
37 lines (34 loc) · 838 Bytes
/
types.ts
File metadata and controls
37 lines (34 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import type { ReactNode } from 'react'
import type { RLInputRuleType } from '../utils/types'
export interface RLFileInputErrorEvent {
file?: string
size?: number
count?: number
type?: string
message: string
}
export interface RLFileInputProps {
className?: string
value?: File | File[] | null
onChange?: (files: File | File[] | null) => void
name?: string
label: string
placeholder?: string
error?: string
helpText?: string
required?: boolean
disabled?: boolean
accept?: string
multiple?: boolean
acceptedTypes?: string[] // MIME types
maxFileSize?: number // bytes
fileLimit?: number
rules?: RLInputRuleType[]
onError?: (error: RLFileInputErrorEvent) => void
prefix?: ReactNode
suffix?: ReactNode
}
export interface RLFileInputRef {
isValid: () => boolean
validate: () => boolean
}