Skip to content

Commit

Permalink
feat: use CmdKey as ButtonConfig key
Browse files Browse the repository at this point in the history
  • Loading branch information
enpitsuLin committed Oct 23, 2023
1 parent 9038601 commit 75ee891
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/plugin-menu/src/menu-item.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { commandsCtx, editorViewCtx } from '@milkdown/core'
import { CmdKey, commandsCtx, editorViewCtx } from '@milkdown/core'
import { Ctx } from '@milkdown/ctx'

type CommandPayload = unknown

export type ButtonConfig = {
export type ButtonConfig<T = unknown> = {
type: 'button'
content: string | HTMLElement
key: string | [string, CommandPayload]
key: string | [string, CommandPayload] | [CmdKey<T>, T]
active?: (ctx: Ctx) => boolean
disabled?: (ctx: Ctx) => boolean
}
Expand Down

0 comments on commit 75ee891

Please sign in to comment.