diff --git a/packages/casl-vue/src/component/can.ts b/packages/casl-vue/src/component/can.ts index be6bfe9c7..d22ac5b78 100644 --- a/packages/casl-vue/src/component/can.ts +++ b/packages/casl-vue/src/component/can.ts @@ -1,13 +1,13 @@ -import { defineComponent, ComponentCustomProperties } from 'vue'; import { - SubjectType, - Generics, - AnyAbility, - Ability, Abilities, - IfString, AbilityTuple, + AnyAbility, + Generics, + IfString, + MongoAbility, + SubjectType } from '@casl/ability'; +import { ComponentCustomProperties, defineComponent } from 'vue'; import { useAbility } from '../useAbility'; type AbilityCanProps< @@ -27,7 +27,7 @@ export type CanProps = AbilityCanProps['abilit type VueAbility = ComponentCustomProperties extends { $ability: AnyAbility } ? ComponentCustomProperties['$ability'] - : Ability; + : MongoAbility; function detectSubjectProp(props: Record) { if (props.a !== undefined) { diff --git a/packages/casl-vue/src/useAbility.ts b/packages/casl-vue/src/useAbility.ts index dc88fe7ca..c04af6491 100644 --- a/packages/casl-vue/src/useAbility.ts +++ b/packages/casl-vue/src/useAbility.ts @@ -1,10 +1,10 @@ +import type { AnyAbility, MongoAbility } from '@casl/ability'; import { inject, InjectionKey, provide } from 'vue'; -import type { AnyAbility, Ability } from '@casl/ability'; import { reactiveAbility } from './reactiveAbility'; export const ABILITY_TOKEN: InjectionKey = Symbol('ability'); -export function useAbility(): T { +export function useAbility(): T { const ability = inject(ABILITY_TOKEN); if (!ability) {