diff --git a/package.json b/package.json index f7ec743..83f4979 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "test": "jest", "lint": "eslint src", "build": "rollup -c", - "prepare": "rollup -c" + "prepare": "rollup -c", + "test:types": "tsc -p ./types/tsconfig.json" }, "repository": { "type": "git", @@ -35,6 +36,7 @@ "lint-staged": "^6.1.0", "puppeteer": "^1.0.0", "rollup": "^0.55.3", + "typescript": "^3.2.2", "vue": "^2.5.13", "yorkie": "^1.0.3" }, diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 0000000..8b67b7b --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,8 @@ +import _Vue, { Component, AsyncComponent } from 'vue' + +declare function wrap( + Vue: typeof _Vue, + Component: Component | AsyncComponent +): HTMLElement + +export default wrap diff --git a/types/tsconfig.json b/types/tsconfig.json new file mode 100644 index 0000000..b3fd0f9 --- /dev/null +++ b/types/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "strict": true, + "noEmit": true, + "lib": [ + "es2015", + "dom" + ] + }, + "include": [ + "./*.ts" + ] +} diff --git a/yarn.lock b/yarn.lock index 2622dc1..b005ff2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3390,6 +3390,11 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" +typescript@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.2.tgz#fe8101c46aa123f8353523ebdcf5730c2ae493e5" + integrity sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg== + uglify-js@^2.6: version "2.8.29" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd"