mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-28 16:45:10 +08:00
Added typings for prosemirror-commands 0.18.0
This commit is contained in:
35
prosemirror-commands/index.d.ts
vendored
Normal file
35
prosemirror-commands/index.d.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
// Type definitions for prosemirror-commands 0.18.0
|
||||
// Project: https://github.com/ProseMirror/prosemirror-commands
|
||||
// Definitions by: David Hahn <https://github.com/davidka>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
import { EditorState } from 'prosemirror-state'
|
||||
import { Transaction } from 'prosemirror-state'
|
||||
import { EditorView } from 'prosemirror-view'
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { MarkType } from 'prosemirror-model'
|
||||
import { ProsemirrorNode } from 'prosemirror-model'
|
||||
|
||||
declare module "prosemirror-commands" {
|
||||
export function deleteSelection(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function joinBackward(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean
|
||||
export function joinForward(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean
|
||||
export function joinUp(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function joinDown(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function lift(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function newlineInCode(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function exitCode(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function createParagraphNear(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function liftEmptyBlock(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function splitBlock(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function splitBlockKeepMarks(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function selectParentNode(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function wrapIn(nodeType: NodeType, attrs?: Object): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean
|
||||
export function setBlockType(nodeType: NodeType, attrs?: Object): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean
|
||||
export function toggleMark(markType: MarkType, attrs?: Object): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean
|
||||
export function autoJoin(command: (state: EditorState, fn?: (tr: Transaction) => void) => boolean, isJoinable: ((before: ProsemirrorNode, after: ProsemirrorNode) => boolean) | string[]): (state: EditorState, fn?: (tr: Transaction) => void) => boolean
|
||||
export function chainCommands(...commands: ((p1: EditorState, fn?: (tr: Transaction) => void) => boolean)[]): (p1: EditorState, fn?: (tr: Transaction) => void) => boolean
|
||||
export let baseKeymap: Object;
|
||||
|
||||
}
|
||||
5
prosemirror-commands/prosemirror-commands-tests.ts
Normal file
5
prosemirror-commands/prosemirror-commands-tests.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as commands from 'prosemirror-commands';
|
||||
import {EditorState} from 'prosemirror-state';
|
||||
|
||||
let state = new EditorState();
|
||||
commands.deleteSelection(state);
|
||||
23
prosemirror-commands/tsconfig.json
Normal file
23
prosemirror-commands/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"prosemirror-commands-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user