mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-10 09:40:21 +08:00
Added typings for prosemirror-history 0.18.0
This commit is contained in:
17
prosemirror-history/index.d.ts
vendored
Normal file
17
prosemirror-history/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for prosemirror-history 0.18.0
|
||||
// Project: https://github.com/ProseMirror/prosemirror-history
|
||||
// Definitions by: David Hahn <https://github.com/davidka>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Plugin } from 'prosemirror-state'
|
||||
import { EditorState } from 'prosemirror-state'
|
||||
import { Transaction } from 'prosemirror-state'
|
||||
|
||||
declare module "prosemirror-history" {
|
||||
export function history(config?: { depth?: number, newGroupDelay: number, preserveItems?: boolean }): Plugin
|
||||
export function undo(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function redo(state: EditorState, dispatch?: (tr: Transaction) => void): boolean
|
||||
export function undoDepth(state: EditorState): number
|
||||
export function redoDepth(state: EditorState): number
|
||||
|
||||
}
|
||||
5
prosemirror-history/prosemirror-history-tests.ts
Normal file
5
prosemirror-history/prosemirror-history-tests.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as history from 'prosemirror-history';
|
||||
import {EditorState} from 'prosemirror-state';
|
||||
|
||||
let state = new EditorState();
|
||||
history.undo(state);
|
||||
23
prosemirror-history/tsconfig.json
Normal file
23
prosemirror-history/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-history-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user