chore: remove deprecated defineEmit & useContext APIs
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import {
|
||||
expectType,
|
||||
defineProps,
|
||||
defineEmit,
|
||||
defineEmits,
|
||||
useContext,
|
||||
useAttrs,
|
||||
useSlots,
|
||||
withDefaults,
|
||||
@@ -113,30 +111,6 @@ describe('defineEmits w/ runtime declaration', () => {
|
||||
emit2('baz')
|
||||
})
|
||||
|
||||
describe('deprecated defineEmit', () => {
|
||||
const emit = defineEmit({
|
||||
foo: () => {},
|
||||
bar: null
|
||||
})
|
||||
emit('foo')
|
||||
emit('bar', 123)
|
||||
// @ts-expect-error
|
||||
emit('baz')
|
||||
})
|
||||
|
||||
describe('useContext', () => {
|
||||
const { attrs, emit, slots } = useContext()
|
||||
expectType<Record<string, unknown>>(attrs)
|
||||
expectType<(...args: any[]) => void>(emit)
|
||||
expectType<Slots>(slots)
|
||||
|
||||
// @ts-expect-error
|
||||
props.foo
|
||||
// should be able to emit anything
|
||||
emit('foo')
|
||||
emit('bar')
|
||||
})
|
||||
|
||||
describe('useAttrs', () => {
|
||||
const attrs = useAttrs()
|
||||
expectType<Record<string, unknown>>(attrs)
|
||||
|
||||
Reference in New Issue
Block a user