import { isCompatEnabled, softAssertCompatEnabled } from './compat/compatConfig'
import { DeprecationTypes } from './compat/compatConfig'
import { shouldSkipAttr } from './compat/attrsFallthrough'
+import { IfAny } from './helpers/typeUtils'
export type ComponentPropsOptions<P = Data> =
| ComponentObjectPropsOptions<P>
: InferPropType<U>
: [T] extends [Prop<infer V, infer D>]
? unknown extends V
- ? D
+ ? IfAny<V, V, D>
: V
: T
ShallowUnwrapRef,
FunctionalComponent,
ComponentPublicInstance,
- toRefs
+ toRefs,
+ IsAny
} from './index'
declare function extractComponentOptions<Props, RawBindings>(
ffff: Ref<(a: number, b: string) => { a: boolean }>
validated: Ref<string | undefined>
object: Ref<object | undefined>
+ zzz: any
}
describe('defineComponent', () => {
// validator requires explicit annotation
validator: (val: unknown) => val !== ''
},
- object: Object as PropType<object>
+ object: Object as PropType<object>,
+ zzz: Object as PropType<any>
},
setup(props) {
const refs = toRefs(props)
expectType<ExpectedRefs['ffff']>(refs.ffff)
expectType<ExpectedRefs['validated']>(refs.validated)
expectType<ExpectedRefs['object']>(refs.object)
+ expectType<IsAny<typeof props.zzz>>(true)
return {
setupA: 1,