Add type definitions for prosemirror-dropcursor

This commit is contained in:
Daniil Dotsev
2018-09-17 19:25:31 +03:00
parent 38d022f09e
commit ca9a362f29
4 changed files with 51 additions and 0 deletions

20
types/prosemirror-dropcursor/index.d.ts vendored Normal file
View File

@@ -0,0 +1,20 @@
// Type definitions for prosemirror-dropcursor 1.0
// Project: https://github.com/ProseMirror/prosemirror-dropcursor
// Definitions by: Bradley Ayers <https://github.com/bradleyayers>
// David Hahn <https://github.com/davidka>
// Daniil Dotsev <https://github.com/dddotsev>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { Plugin } from 'prosemirror-state';
/**
* Create a plugin that, when added to a ProseMirror instance,
* causes a decoration to show up at the drop position when something
* is dragged over the editor.
*
* @param options These options are supported:
* @param options.color The color of the cursor. Defaults to `black`.
* @param options.width The precise width of the cursor in pixels. Defaults to 1.
*/
export function dropCursor(options?: { color?: string | null, width?: number | null }): Plugin;

View File

@@ -0,0 +1,4 @@
import { dropCursor } from 'prosemirror-dropcursor';
import { Plugin } from 'prosemirror-state';
const dropCursorPlugin: Plugin = dropCursor();

View File

@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"prosemirror-dropcursor-tests.ts"
]
}

View File

@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}