diff --git a/prosemirror-history/index.d.ts b/prosemirror-history/index.d.ts new file mode 100644 index 0000000000..e1855fd8d2 --- /dev/null +++ b/prosemirror-history/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for prosemirror-history 0.18.0 +// Project: https://github.com/ProseMirror/prosemirror-history +// Definitions by: David Hahn +// 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 + +} \ No newline at end of file diff --git a/prosemirror-history/prosemirror-history-tests.ts b/prosemirror-history/prosemirror-history-tests.ts new file mode 100644 index 0000000000..3beccd390b --- /dev/null +++ b/prosemirror-history/prosemirror-history-tests.ts @@ -0,0 +1,5 @@ +import * as history from 'prosemirror-history'; +import {EditorState} from 'prosemirror-state'; + +let state = new EditorState(); +history.undo(state); diff --git a/prosemirror-history/tsconfig.json b/prosemirror-history/tsconfig.json new file mode 100644 index 0000000000..d9410dcf2e --- /dev/null +++ b/prosemirror-history/tsconfig.json @@ -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" + ] +} \ No newline at end of file