Skip to content

Commit 0cb3492

Browse files
committed
fix: bouncer type
fix #45, close #50
1 parent 97391ed commit 0cb3492

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"eslint": "^9.26.0",
5959
"nuxt": "^3.17.1",
6060
"playwright": "^1.52.0",
61-
"typescript": "latest",
61+
"typescript": "^5.6.3",
6262
"vitest": "^3.1.2",
6363
"vue-tsc": "^2.2.10"
6464
},

pnpm-lock.yaml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/runtime/components/Bouncer.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ import type { BouncerAbility, BouncerArgs } from '../../utils'
44
import { Primitive } from './Primitive'
55
import { allows, ref, watchEffect } from '#imports'
66
7-
export interface BouncerProps {
7+
export interface BouncerProps<Ability extends BouncerAbility<any>> {
88
ability: Ability | Ability[]
99
args?: BouncerArgs<Ability> | BouncerArgs<Ability>[]
1010
as?: string | Component
1111
}
1212
export interface BouncerEmits {}
1313
export interface BouncerSlots {
14-
default?: (props?: { can: boolean }) => any
14+
default?: (props: { can: boolean }) => any
1515
can?: (props?: object) => any
1616
cannot?: (props?: object) => any
1717
}
1818
</script>
1919

20-
<script lang="ts" setup generic="Ability extends BouncerAbility<any>">
21-
const props = defineProps<BouncerProps>()
20+
<script setup lang="ts" generic="Ability extends BouncerAbility<any>">
21+
const props = defineProps<BouncerProps<Ability>>()
2222
defineEmits<BouncerEmits>()
2323
const slots = defineSlots<BouncerSlots>()
2424

0 commit comments

Comments
 (0)