Added typings for prosemirror-history 0.18.0

This commit is contained in:
David Hahn
2017-03-07 10:18:17 +01:00
parent 7ea0ddc89b
commit 3a68ea2769
3 changed files with 45 additions and 0 deletions

17
prosemirror-history/index.d.ts vendored Normal file
View 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
}

View File

@@ -0,0 +1,5 @@
import * as history from 'prosemirror-history';
import {EditorState} from 'prosemirror-state';
let state = new EditorState();
history.undo(state);

View 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"
]
}