mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-16 12:09:24 +08:00
Merge pull request #16659 from timjb/prosemirror-menu-update-to-0.21
Update prosemirror-menu to version 0.21
This commit is contained in:
19
types/prosemirror-menu/index.d.ts
vendored
19
types/prosemirror-menu/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for prosemirror-menu 0.18
|
||||
// Type definitions for prosemirror-menu 0.21
|
||||
// Project: https://github.com/ProseMirror/prosemirror-menu
|
||||
// Definitions by: David Hahn <https://github.com/davidka>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -8,6 +8,7 @@ import { ProsemirrorNode } from 'prosemirror-model'
|
||||
import { EditorView } from 'prosemirror-view'
|
||||
import { EditorState } from 'prosemirror-state'
|
||||
import { Transaction } from 'prosemirror-state'
|
||||
import { Plugin } from 'prosemirror-state'
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { EditorProps } from 'prosemirror-view'
|
||||
|
||||
@@ -23,14 +24,14 @@ declare module "prosemirror-menu" {
|
||||
|
||||
}
|
||||
export interface MenuItemSpec {
|
||||
run(p1: EditorState, fn: (p: Transaction) => void, p2: EditorView): void
|
||||
run(p1: EditorState, fn: (p: Transaction) => void, p2: EditorView, ev: Event): void
|
||||
select?(p: EditorState): boolean
|
||||
onDeselect?: string;
|
||||
onDeselected?: string;
|
||||
active?(p: EditorState): boolean
|
||||
render?(p: EditorView): Node
|
||||
icon?: Object;
|
||||
label?: string;
|
||||
title?: string;
|
||||
title?: string | ((s: EditorState) => string);
|
||||
class: string;
|
||||
css: string;
|
||||
execEvent: string;
|
||||
@@ -55,14 +56,6 @@ declare module "prosemirror-menu" {
|
||||
export function redoItem(p: Object): MenuItem
|
||||
export function wrapItem(nodeType: NodeType, options: Object): MenuItem
|
||||
export function blockTypeItem(nodeType: NodeType, options: Object): MenuItem
|
||||
export class MenuBarEditorView {
|
||||
wrapper: Node;
|
||||
editor: EditorView;
|
||||
props: EditorProps;
|
||||
update(props: EditorProps): void
|
||||
updateState(state: EditorState): void
|
||||
destroy(): void
|
||||
|
||||
}
|
||||
export function menuBar(options: { content: MenuElement[][], floating?: boolean }): Plugin
|
||||
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
import * as menu from 'prosemirror-menu';
|
||||
|
||||
let editorView = new menu.MenuBarEditorView();
|
||||
let menuBarPlugin = menu.menuBar({ content: [], floating: false });
|
||||
Reference in New Issue
Block a user