rename AllCommands to Commands
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
blur: {
|
||||
/**
|
||||
* Removes focus from the editor.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
clearContent: {
|
||||
/**
|
||||
* Clear the whole document.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { liftTarget } from 'prosemirror-transform'
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
clearNodes: {
|
||||
/**
|
||||
* Normalize nodes to a simple paragraph.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
command: {
|
||||
/**
|
||||
* Define a command inline.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { createParagraphNear as originalCreateParagraphNear } from 'prosemirror-
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
createParagraphNear: {
|
||||
/**
|
||||
* Create a paragraph nearby.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Command, RawCommands, Range } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
deleteRange: {
|
||||
/**
|
||||
* Delete a given range.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { deleteSelection as originalDeleteSelection } from 'prosemirror-commands
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
deleteSelection: {
|
||||
/**
|
||||
* Delete the selection, if there is one.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
enter: {
|
||||
/**
|
||||
* Trigger enter.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { exitCode as originalExitCode } from 'prosemirror-commands'
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
exitCode: {
|
||||
/**
|
||||
* Exit from a code block.
|
||||
|
||||
@@ -5,7 +5,7 @@ import getMarkType from '../helpers/getMarkType'
|
||||
import getMarkRange from '../helpers/getMarkRange'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
extendMarkRange: {
|
||||
/**
|
||||
* Extends the text selection to the current mark.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
first: {
|
||||
/**
|
||||
* Runs one command after the other and stops at the first which returns true.
|
||||
|
||||
@@ -31,7 +31,7 @@ function resolveSelection(state: EditorState, position: FocusPosition = null) {
|
||||
}
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
focus: {
|
||||
/**
|
||||
* Focus the editor at the given position.
|
||||
|
||||
@@ -18,7 +18,7 @@ function selectionToInsertionEnd(tr: Transaction, startLen: number, bias: number
|
||||
}
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
insertHTML: {
|
||||
/**
|
||||
* Insert a string of HTML at the current position.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
insertText: {
|
||||
/**
|
||||
* Insert a string of text at the current position.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { joinBackward as originalJoinBackward } from 'prosemirror-commands'
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
joinBackward: {
|
||||
/**
|
||||
* Join two nodes backward.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { joinForward as originalJoinForward } from 'prosemirror-commands'
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
joinForward: {
|
||||
/**
|
||||
* Join two nodes forward.
|
||||
|
||||
@@ -57,7 +57,7 @@ function normalizeKeyName(name: string) {
|
||||
}
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
keyboardShortcut: {
|
||||
/**
|
||||
* Trigger a keyboard shortcut.
|
||||
|
||||
@@ -5,7 +5,7 @@ import isNodeActive from '../helpers/isNodeActive'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
lift: {
|
||||
/**
|
||||
* Removes an existing wrap.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { liftEmptyBlock as originalLiftEmptyBlock } from 'prosemirror-commands'
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
liftEmptyBlock: {
|
||||
/**
|
||||
* Lift block if empty.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Command, RawCommands } from '../types'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
liftListItem: {
|
||||
/**
|
||||
* Lift the list item into a wrapping list.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { newlineInCode as originalNewlineInCode } from 'prosemirror-commands'
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
newlineInCode: {
|
||||
/**
|
||||
* Add a newline character in code.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { NodeType } from 'prosemirror-model'
|
||||
import { Command, RawCommands, AnyObject } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
replace: {
|
||||
/**
|
||||
* Replaces text with a node.
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
replaceRange: {
|
||||
/**
|
||||
* Replaces text with a node within a range.
|
||||
|
||||
@@ -4,7 +4,7 @@ import deleteProps from '../utilities/deleteProps'
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
resetNodeAttributes: {
|
||||
/**
|
||||
* Resets node attributes to the default value.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
scrollIntoView: {
|
||||
/**
|
||||
* Scroll the selection into view.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { selectAll as originalSelectAll } from 'prosemirror-commands'
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
selectAll: {
|
||||
/**
|
||||
* Select the whole document.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { selectNodeBackward as originalSelectNodeBackward } from 'prosemirror-co
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
selectNodeBackward: {
|
||||
/**
|
||||
* Select a node backward.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { selectNodeForward as originalSelectNodeForward } from 'prosemirror-comm
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
selectNodeForward: {
|
||||
/**
|
||||
* Select a node forward.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { selectParentNode as originalSelectParentNode } from 'prosemirror-comman
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
selectParentNode: {
|
||||
/**
|
||||
* Select the parent node.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { TextSelection } from 'prosemirror-state'
|
||||
import { AnyObject, Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
setContent: {
|
||||
/**
|
||||
* Replace the whole document with new content.
|
||||
|
||||
@@ -4,7 +4,7 @@ import getMarkType from '../helpers/getMarkType'
|
||||
import getMarkAttributes from '../helpers/getMarkAttributes'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
setMark: {
|
||||
/**
|
||||
* Add a mark with new attributes.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { AnyObject, Command, RawCommands } from '../types'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
setNode: {
|
||||
/**
|
||||
* Replace a given range with a node.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Command, RawCommands } from '../types'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
sinkListItem: {
|
||||
/**
|
||||
* Sink the list item down into an inner list.
|
||||
|
||||
@@ -25,7 +25,7 @@ function ensureMarks(state: EditorState) {
|
||||
}
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
splitBlock: {
|
||||
/**
|
||||
* Forks a new node from an existing node.
|
||||
|
||||
@@ -11,7 +11,7 @@ import getNodeType from '../helpers/getNodeType'
|
||||
import getSplittedAttributes from '../helpers/getSplittedAttributes'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
splitListItem: {
|
||||
/**
|
||||
* Splits one list item into two list items.
|
||||
|
||||
@@ -5,7 +5,7 @@ import findParentNode from '../helpers/findParentNode'
|
||||
import isList from '../helpers/isList'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
toggleList: {
|
||||
/**
|
||||
* Toggle between different list types.
|
||||
|
||||
@@ -4,7 +4,7 @@ import getMarkType from '../helpers/getMarkType'
|
||||
import isMarkActive from '../helpers/isMarkActive'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
toggleMark: {
|
||||
/**
|
||||
* Toggle a mark on and off.
|
||||
|
||||
@@ -4,7 +4,7 @@ import isNodeActive from '../helpers/isNodeActive'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
toggleNode: {
|
||||
/**
|
||||
* Toggle a node with another node.
|
||||
|
||||
@@ -5,7 +5,7 @@ import isNodeActive from '../helpers/isNodeActive'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
toggleWrap: {
|
||||
/**
|
||||
* Wraps nodes in another node, or removes an existing wrap.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { undoInputRule as originalUndoInputRule } from 'prosemirror-inputrules'
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
undoInputRule: {
|
||||
/**
|
||||
* Undo an input rule.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
unsetAllMarks: {
|
||||
/**
|
||||
* Remove all marks in the current selection.
|
||||
|
||||
@@ -4,7 +4,7 @@ import getMarkType from '../helpers/getMarkType'
|
||||
import getMarkRange from '../helpers/getMarkRange'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
unsetMark: {
|
||||
/**
|
||||
* Remove all marks in the current selection.
|
||||
|
||||
@@ -3,7 +3,7 @@ import getNodeType from '../helpers/getNodeType'
|
||||
import { AnyObject, Command, RawCommands } from '../types'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
updateNodeAttributes: {
|
||||
/**
|
||||
* Update attributes of a node.
|
||||
|
||||
@@ -5,7 +5,7 @@ import isNodeActive from '../helpers/isNodeActive'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
wrapIn: {
|
||||
/**
|
||||
* Wraps nodes in another node.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { AnyObject, Command, RawCommands } from '../types'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface AllCommands {
|
||||
interface Commands {
|
||||
wrapInList: {
|
||||
/**
|
||||
* Wrap a node in a list.
|
||||
|
||||
@@ -21,4 +21,4 @@ export { default as isTextSelection } from './helpers/isTextSelection'
|
||||
export { default as isCellSelection } from './helpers/isCellSelection'
|
||||
export { default as findParentNodeClosestToPos } from './helpers/findParentNodeClosestToPos'
|
||||
|
||||
export interface AllCommands {}
|
||||
export interface Commands {}
|
||||
|
||||
@@ -14,9 +14,9 @@ import { Extension } from './Extension'
|
||||
import { Node } from './Node'
|
||||
import { Mark } from './Mark'
|
||||
import { Editor } from './Editor'
|
||||
import { AllCommands } from '.'
|
||||
import { Commands } from '.'
|
||||
|
||||
export { AllCommands }
|
||||
export { Commands }
|
||||
|
||||
export type Extensions = (Extension | Node | Mark)[]
|
||||
|
||||
@@ -112,7 +112,7 @@ export type NodeViewRendererProps = {
|
||||
|
||||
export type NodeViewRenderer = (props: NodeViewRendererProps) => (NodeView | {})
|
||||
|
||||
export type UnionCommands = UnionToIntersection<ValuesOf<Pick<AllCommands, KeysWithTypeOf<AllCommands, {}>>>>
|
||||
export type UnionCommands = UnionToIntersection<ValuesOf<Pick<Commands, KeysWithTypeOf<Commands, {}>>>>
|
||||
|
||||
export type RawCommands = {
|
||||
[Item in keyof UnionCommands]: UnionCommands[Item] extends (...args: any[]) => any
|
||||
|
||||
Reference in New Issue
Block a user