diff --git a/package.json b/package.json index 4ce82b9..1239411 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,13 @@ "version": "0.6.1", "description": "A DraftJS plugin for supporting Markdown syntax shortcuts", "main": "lib/index.js", + "types": "lib/index.d.ts", "scripts": { "eslint": "node_modules/.bin/eslint .", - "build": "npm run clean && npm run build:js", + "build": "npm run clean && npm run build:js && npm run build:types", "build:demo": "rm -rf demo/public/* && NODE_ENV=production npx webpack --config demo/webpack.config.prod.js && rm -rf demo/public/{css,index.html} && cp -R demo/publicTemplate/* demo/public/ && sed \"s/app.js/$(basename $(ls demo/public/app.*.js))/g\" demo/publicTemplate/index.html > demo/public/index.html", "build:js": "BABEL_DISABLE_CACHE=1 BABEL_ENV=production NODE_ENV=production node_modules/.bin/babel --out-dir='lib' --ignore='**/__test__/*' src", + "build:types": "BABEL_DISABLE_CACHE=1 BABEL_ENV=production NODE_ENV=production node_modules/.bin/babel typings --out-dir='lib' --copy-files", "clean": "node_modules/.bin/rimraf lib; node_modules/.bin/rimraf demo/public", "prepare": "npm run build", "start": "npm run start:dev", @@ -20,14 +22,21 @@ }, "watch": { "test": { - "patterns": ["src/**/*.js"] + "patterns": [ + "src/**/*.js" + ] } }, "repository": { "type": "git", "url": "git+https://github.com/ngs/draft-js-markdown-shortcuts-plugin.git" }, - "keywords": ["draftjs", "editor", "plugin", "markdown"], + "keywords": [ + "draftjs", + "editor", + "plugin", + "markdown" + ], "author": "Atsushi Nagase", "license": "MIT", "bugs": { @@ -100,11 +109,14 @@ "react": "^16.13.1", "react-dom": "^16.13.1" }, - "contributors": ["Atsushi Nagase "], + "contributors": [ + "Atsushi Nagase " + ], "dependencies": { "decorate-component-with-props": "^1.1.0", "draft-js": "~0.11.5", "draft-js-checkable-list-item": "^3.0.4", + "draft-js-plugins-editor": "^3.0.0", "draft-js-prism-plugin": "^0.1.3", "immutable": "~3.8.2" }, diff --git a/typings/index.d.ts b/typings/index.d.ts new file mode 100644 index 0000000..2fec421 --- /dev/null +++ b/typings/index.d.ts @@ -0,0 +1,5 @@ +declare module 'draft-js-markdown-shortcuts-plugin' { + import { EditorPlugin } from 'draft-js-plugins-editor'; + const createMarkdownShortcutsPlugin: (config?: any) => EditorPlugin; + export default createMarkdownShortcutsPlugin; +}