import { expectType } from 'tsd' import { Ref, ref, isRef, unref } from './index' function foo(arg: number | Ref) { // ref coercing const coerced = ref(arg) expectType>(coerced) // isRef as type guard if (isRef(arg)) { expectType>(arg) } // ref unwrapping expectType(unref(arg)) } foo(1)