core icon indicating copy to clipboard operation
core copied to clipboard

types: export `UnwrapRefSimple`, emit typecheck, markRaw/toReadonly return types improvements

Open pikax opened this issue 2 years ago • 0 comments

Fixes #7278

Note: This has 3 different commit messages:

  • types(ref): fix ref<T>() when emitting types
  • types(toRaw): fix returning type to Raw<T>
  • types(toReadonly): make returning type Readonly

Added a declaration emit step to our types, to prevent regression on #7278.

Noticed the markRaw({} gives an error, the error makes sense but I don't know what should be the fix for it:

import { markRaw } from 'vue'

// error here, because the type is just { [RawSymbol]?: true }
export const a = markRaw({})

export const b = markRaw({
  a: 1
})

playground

pikax avatar Dec 07 '22 09:12 pikax