types: improve h() and TSX type inference

- Should allow extraneous props as attrs in TSX
- Should check props when using constructor type returned by
  createComponent() in h()
This commit is contained in:
Evan You
2019-10-31 12:43:05 -04:00
parent b114cdf6ee
commit 3a6dcd3aba
4 changed files with 48 additions and 16 deletions

View File

@@ -65,6 +65,10 @@ export interface ComponentOptionsBase<
components?: Record<string, Component>
directives?: Record<string, Directive>
inheritAttrs?: boolean
// type-only differentiator to separate OptionWihtoutProps from a constructor
// type returned by createComponent()
__isConstructor?: never
}
export type ComponentOptionsWithoutProps<