mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
53
src/components/contextMenu/index.d.ts
vendored
53
src/components/contextMenu/index.d.ts
vendored
@ -1,6 +1,53 @@
|
||||
type ContextMenu = {
|
||||
// type ContextMenu = (
|
||||
// | {
|
||||
// type: 'group'
|
||||
// key: string
|
||||
// items: ContextMenuItem[]
|
||||
// }
|
||||
// | {
|
||||
// type: 'sub'
|
||||
// key: string
|
||||
// trigger: {
|
||||
// key: string
|
||||
// props: {
|
||||
// disabled: boolean
|
||||
// destructive: boolean
|
||||
// hidden: boolean
|
||||
// }
|
||||
// title: string
|
||||
// icon?: string
|
||||
// }
|
||||
// items: ContextMenuItem[]
|
||||
// }
|
||||
// )[]
|
||||
|
||||
type ContextMenu = (ContextMenuItem | ContextMenuSub)[][]
|
||||
|
||||
type ContextMenuItem = {
|
||||
type: 'item'
|
||||
key: string
|
||||
item: { onSelect: () => void; disabled: boolean; destructive: boolean; hidden: boolean }
|
||||
props: {
|
||||
onSelect: () => void
|
||||
disabled: boolean
|
||||
destructive: boolean
|
||||
hidden: boolean
|
||||
}
|
||||
title: string
|
||||
icon: string
|
||||
icon?: string
|
||||
}
|
||||
|
||||
type ContextMenuSub = {
|
||||
type: 'sub'
|
||||
key: string
|
||||
trigger: {
|
||||
key: string
|
||||
props: {
|
||||
disabled: boolean
|
||||
destructive: boolean
|
||||
hidden: boolean
|
||||
}
|
||||
title: string
|
||||
icon?: string
|
||||
}
|
||||
items: Omit<ContextMenuItem, 'type'>[]
|
||||
}
|
||||
|
Reference in New Issue
Block a user