Replace external enum with external sealed object

This commit is contained in:
Alexander Nozik 2023-10-18 11:31:11 +03:00
parent 001efa711a
commit 2578fd6f77

View File

@ -9,30 +9,38 @@ import react.Component
import react.Props import react.Props
import react.State import react.State
external enum class DropEffects { sealed external class DropEffects {
copy, @JsName("copy")
move, object Copy : DropEffects
link,
none @JsName("move")
object Move : DropEffects
@JsName("link")
object Link : DropEffects
@JsName("none")
object None : DropEffects
} }
external interface FileDropProps: Props { external interface FileDropProps : Props {
var className: String? var className: String?
var targetClassName: String? var targetClassName: String?
var draggingOverFrameClassName: String? var draggingOverFrameClassName: String?
var draggingOverTargetClassName: String? var draggingOverTargetClassName: String?
// var frame?: Exclude<HTMLElementTagNameMap[keyof HTMLElementTagNameMap], HTMLElement> | HTMLDocument; // var frame?: Exclude<HTMLElementTagNameMap[keyof HTMLElementTagNameMap], HTMLElement> | HTMLDocument;
var onFrameDragEnter: ((event: DragEvent) -> Unit)? var onFrameDragEnter: ((event: DragEvent) -> Unit)?
var onFrameDragLeave: ((event: DragEvent) -> Unit)? var onFrameDragLeave: ((event: DragEvent) -> Unit)?
var onFrameDrop: ((event: DragEvent) -> Unit)? var onFrameDrop: ((event: DragEvent) -> Unit)?
// var onDragOver: ReactDragEventHandler<HTMLDivElement>?
// var onDragOver: ReactDragEventHandler<HTMLDivElement>?
// var onDragLeave: ReactDragEventHandler<HTMLDivElement>? // var onDragLeave: ReactDragEventHandler<HTMLDivElement>?
var onDrop: ((files: FileList?, event: dynamic) -> Unit)?//event:DragEvent<HTMLDivElement>) var onDrop: ((files: FileList?, event: dynamic) -> Unit)?//event:DragEvent<HTMLDivElement>)
var dropEffect: DropEffects? var dropEffect: DropEffects?
} }
external interface FileDropState: State { external interface FileDropState : State {
var draggingOverFrame: Boolean var draggingOverFrame: Boolean
var draggingOverTarget: Boolean var draggingOverTarget: Boolean
} }