diff --git a/packages/casl-vue/index.d.ts b/packages/casl-vue/index.d.ts new file mode 100644 index 000000000..3a1345246 --- /dev/null +++ b/packages/casl-vue/index.d.ts @@ -0,0 +1,11 @@ +import Vue from 'vue' +import { Ability } from '@casl/ability' + +export function abilitiesPlugin(Vue: Vue, providedAbility?: Ability): void + +declare module "vue/types/vue" { + interface Vue { + $ability: Ability + $can(action: string, subject: any, field?: string): boolean + } +} diff --git a/packages/casl-vue/package-lock.json b/packages/casl-vue/package-lock.json index e3e03764f..b4413b263 100644 --- a/packages/casl-vue/package-lock.json +++ b/packages/casl-vue/package-lock.json @@ -1,23 +1,11 @@ { - "name": "@casl/vue", - "version": "0.1.1", - "lockfileVersion": 1, "requires": true, + "lockfileVersion": 1, "dependencies": { - "@casl/ability": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@casl/ability/-/ability-2.0.2.tgz", - "integrity": "sha512-1CjTaX33LGQi2sy8QlgzB/95mEvg8sQ4YMXy/0i/jhNUodGRTD4XivlbpGCFxgpkcIcnm16fi1PH6ATIFGo2/Q==", - "dev": true, - "requires": { - "sift": "5.1.0" - } - }, "@vue/test-utils": { "version": "1.0.0-beta.13", "resolved": "https://registry.npmjs.org/@vue/test-utils/-/test-utils-1.0.0-beta.13.tgz", "integrity": "sha512-HVhh4n8i661BJpVKp2SFUWT9J4kSFFSXF/ZvtlEI2ndEKjNx+1BUGB5V3t3ls1OIDQEFOVoJEuwz3xP/PsCnPQ==", - "dev": true, "requires": { "lodash": "4.17.5" } @@ -25,38 +13,27 @@ "de-indent": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", - "integrity": "sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0=", - "dev": true + "integrity": "sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0=" }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" }, "lodash": { "version": "4.17.5", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", - "dev": true - }, - "sift": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/sift/-/sift-5.1.0.tgz", - "integrity": "sha1-G78t+w63HlbEzH+1Z/vRNRtlAV4=", - "dev": true + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" }, "vue": { "version": "2.5.16", "resolved": "https://registry.npmjs.org/vue/-/vue-2.5.16.tgz", - "integrity": "sha512-/ffmsiVuPC8PsWcFkZngdpas19ABm5mh2wA7iDqcltyCTwlgZjHGeJYOXkBMo422iPwIcviOtrTCUpSfXmToLQ==", - "dev": true + "integrity": "sha512-/ffmsiVuPC8PsWcFkZngdpas19ABm5mh2wA7iDqcltyCTwlgZjHGeJYOXkBMo422iPwIcviOtrTCUpSfXmToLQ==" }, "vue-template-compiler": { "version": "2.5.16", "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.5.16.tgz", "integrity": "sha512-ZbuhCcF/hTYmldoUOVcu2fcbeSAZnfzwDskGduOrnjBiIWHgELAd+R8nAtX80aZkceWDKGQ6N9/0/EUpt+l22A==", - "dev": true, "requires": { "de-indent": "1.0.2", "he": "1.1.1" diff --git a/packages/casl-vue/package.json b/packages/casl-vue/package.json index 76d4c7d79..9aa99e88d 100644 --- a/packages/casl-vue/package.json +++ b/packages/casl-vue/package.json @@ -5,6 +5,7 @@ "main": "dist/umd/index.js", "module": "index.js", "es2015": "dist/es6/index.js", + "typings": "./index.d.ts", "repository": { "type": "git", "url": "git@github.com:stalniy/casl.git"