rename AllCommands to Commands

This commit is contained in:
Philipp Kühn 2021-02-16 18:39:37 +01:00
parent a705134998
commit 56b4df044f
74 changed files with 76 additions and 76 deletions

View File

@ -50,7 +50,7 @@ function getMapFromOptions(options: AnnotationOptions): Y.Map<any> {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
annotation: {
addAnnotation: (data: any) => Command,
updateAnnotation: (id: string, data: any) => Command,

View File

@ -7,7 +7,7 @@ export interface DetailsOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
details: {
/**
* Set a details node

View File

@ -8,7 +8,7 @@ export interface IframeOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
iframe: {
/**
* Add an iframe

View File

@ -1,7 +1,7 @@
import { Command, RawCommands } from '../types'
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
blur: {
/**
* Removes focus from the editor.

View File

@ -1,7 +1,7 @@
import { Command, RawCommands } from '../types'
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
clearContent: {
/**
* Clear the whole document.

View File

@ -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.

View File

@ -1,7 +1,7 @@
import { Command, RawCommands } from '../types'
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
command: {
/**
* Define a command inline.

View File

@ -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.

View File

@ -1,7 +1,7 @@
import { Command, RawCommands, Range } from '../types'
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
deleteRange: {
/**
* Delete a given range.

View File

@ -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.

View File

@ -1,7 +1,7 @@
import { Command, RawCommands } from '../types'
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
enter: {
/**
* Trigger enter.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -57,7 +57,7 @@ function normalizeKeyName(name: string) {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
keyboardShortcut: {
/**
* Trigger a keyboard shortcut.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -8,7 +8,7 @@ import {
} from '../types'
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
replaceRange: {
/**
* Replaces text with a node within a range.

View File

@ -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.

View File

@ -1,7 +1,7 @@
import { Command, RawCommands } from '../types'
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
scrollIntoView: {
/**
* Scroll the selection into view.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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 {}

View File

@ -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

View File

@ -8,7 +8,7 @@ export interface BlockquoteOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
blockQuote: {
/**
* Set a blockquote node

View File

@ -13,7 +13,7 @@ export interface BoldOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
bold: {
/**
* Set a bold mark

View File

@ -8,7 +8,7 @@ export interface BulletListOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
bulletList: {
/**
* Toggle a bullet list

View File

@ -9,7 +9,7 @@ export interface CodeBlockOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
codeBlock: {
/**
* Set a code block

View File

@ -13,7 +13,7 @@ export interface CodeOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
code: {
/**
* Set a code mark

View File

@ -9,7 +9,7 @@ export interface CollaborationCursorOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
collaborationCursor: {
/**
* Update details of the current user

View File

@ -7,7 +7,7 @@ import {
} from 'y-prosemirror'
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
collaboration: {
/**
* Undo recent changes

View File

@ -6,7 +6,7 @@ type FontFamilyOptions = {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
fontFamily: {
/**
* Set the font family

View File

@ -8,7 +8,7 @@ export interface HardBreakOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
hardBreak: {
/**
* Add a hard break

View File

@ -11,7 +11,7 @@ export interface HeadingOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
heading: {
/**
* Set a heading node

View File

@ -14,7 +14,7 @@ export interface HighlightOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
highlight: {
/**
* Set a highlight mark

View File

@ -7,7 +7,7 @@ export interface HistoryOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
history: {
/**
* Undo recent changes

View File

@ -12,7 +12,7 @@ export interface HorizontalRuleOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
horizontalRule: {
/**
* Add a horizontal rule

View File

@ -13,7 +13,7 @@ export interface ImageOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
image: {
/**
* Add an image

View File

@ -13,7 +13,7 @@ export interface ItalicOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
italic: {
/**
* Set an italic mark

View File

@ -14,7 +14,7 @@ export interface LinkOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
link: {
/**
* Set a link mark

View File

@ -8,7 +8,7 @@ export interface OrderedListOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
orderedList: {
/**
* Toggle an ordered list

View File

@ -7,7 +7,7 @@ export interface ParagraphOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
paragraph: {
/**
* Toggle a paragraph

View File

@ -13,7 +13,7 @@ export interface StrikeOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
strike: {
/**
* Set a strike mark

View File

@ -42,7 +42,7 @@ export interface TableOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
table: {
insertTable: (options?: { rows?: number, cols?: number, withHeaderRow?: boolean }) => Command,
addColumnBefore: () => Command,

View File

@ -7,7 +7,7 @@ export interface TaskListOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
taskList: {
/**
* Toggle a task list

View File

@ -7,7 +7,7 @@ type TextAlignOptions = {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
textAlign: {
/**
* Set the text align attribute

View File

@ -12,7 +12,7 @@ export interface TextStyleOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
textStyle: {
/**
* Remove spans without inline style attributes.

View File

@ -7,7 +7,7 @@ export interface UnderlineOptions {
}
declare module '@tiptap/core' {
interface AllCommands {
interface Commands {
underline: {
/**
* Set an underline mark