From ca9a362f29600697ce514cccf39ced9e5461da78 Mon Sep 17 00:00:00 2001 From: Daniil Dotsev Date: Mon, 17 Sep 2018 19:25:31 +0300 Subject: [PATCH] Add type definitions for prosemirror-dropcursor --- types/prosemirror-dropcursor/index.d.ts | 20 ++++++++++++++++ .../prosemirror-dropcursor-tests.ts | 4 ++++ types/prosemirror-dropcursor/tsconfig.json | 24 +++++++++++++++++++ types/prosemirror-dropcursor/tslint.json | 3 +++ 4 files changed, 51 insertions(+) create mode 100644 types/prosemirror-dropcursor/index.d.ts create mode 100644 types/prosemirror-dropcursor/prosemirror-dropcursor-tests.ts create mode 100644 types/prosemirror-dropcursor/tsconfig.json create mode 100644 types/prosemirror-dropcursor/tslint.json diff --git a/types/prosemirror-dropcursor/index.d.ts b/types/prosemirror-dropcursor/index.d.ts new file mode 100644 index 0000000000..548834b6df --- /dev/null +++ b/types/prosemirror-dropcursor/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for prosemirror-dropcursor 1.0 +// Project: https://github.com/ProseMirror/prosemirror-dropcursor +// Definitions by: Bradley Ayers +// David Hahn +// Daniil Dotsev +// 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; diff --git a/types/prosemirror-dropcursor/prosemirror-dropcursor-tests.ts b/types/prosemirror-dropcursor/prosemirror-dropcursor-tests.ts new file mode 100644 index 0000000000..f6341817ea --- /dev/null +++ b/types/prosemirror-dropcursor/prosemirror-dropcursor-tests.ts @@ -0,0 +1,4 @@ +import { dropCursor } from 'prosemirror-dropcursor'; +import { Plugin } from 'prosemirror-state'; + +const dropCursorPlugin: Plugin = dropCursor(); diff --git a/types/prosemirror-dropcursor/tsconfig.json b/types/prosemirror-dropcursor/tsconfig.json new file mode 100644 index 0000000000..706e5b2d16 --- /dev/null +++ b/types/prosemirror-dropcursor/tsconfig.json @@ -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" + ] +} \ No newline at end of file diff --git a/types/prosemirror-dropcursor/tslint.json b/types/prosemirror-dropcursor/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/prosemirror-dropcursor/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}