defineSlots,
VNode,
Ref,
- defineModel
+ defineModel,
+ toRefs
} from 'vue'
import { describe, expectType } from './utils'
import { defineComponent } from 'vue'
foo: string
bool?: boolean
boolAndUndefined: boolean | undefined
+ file?: File | File[]
}>()
// explicitly declared type should be refined
expectType<string>(props.foo)
const slots = useSlots()
expectType<Slots>(slots)
})
+
+// #6420
+describe('toRefs w/ type declaration', () => {
+ const props = defineProps<{
+ file?: File | File[]
+ }>()
+ expectType<Ref<File | File[] | undefined>>(toRefs(props).file)
+})
isFunction,
Prettify,
UnionToIntersection,
- extend
+ extend,
+ LooseRequired
} from '@vue/shared'
import {
getCurrentInstance,
>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>
// overload 3: typed-based declaration
export function defineProps<TypeProps>(): DefineProps<
- TypeProps,
+ LooseRequired<TypeProps>,
BooleanKey<TypeProps>
>
// implementation