feat(types): update to Typescript 3.9 (#1106)

This commit is contained in:
Carlos Rodrigues
2020-06-09 15:17:42 +01:00
committed by GitHub
parent 6cd97f0ef2
commit 97dedebd80
17 changed files with 140 additions and 470 deletions

View File

@@ -135,7 +135,7 @@ export interface ComponentOptionsBase<
// type-only differentiator to separate OptionWithoutProps from a constructor
// type returned by defineComponent() or FunctionalComponent
call?: never
call?: (this: unknown, ...args: unknown[]) => never
// type-only differentiators for built-in Vnode types
__isFragment?: never
__isTeleport?: never
@@ -197,9 +197,9 @@ export interface MethodOptions {
}
export type ExtractComputedReturns<T extends any> = {
[key in keyof T]: T[key] extends { get: Function }
? ReturnType<T[key]['get']>
: ReturnType<T[key]>
[key in keyof T]: T[key] extends { get: (...args: any[]) => infer TReturn }
? TReturn
: T[key] extends (...args: any[]) => infer TReturn ? TReturn : never
}
type WatchOptionItem =

View File

@@ -244,6 +244,7 @@ function createSuspenseBoundary(
/* istanbul ignore if */
if (__DEV__ && !__TEST__ && !hasWarned) {
hasWarned = true
// @ts-ignore `console.info` cannot be null error
console[console.info ? 'info' : 'log'](
`<Suspense> is an experimental feature and its API will likely change.`
)

View File

@@ -1331,6 +1331,7 @@ declare global {
}
interface IntrinsicElements extends NativeElements {
// allow arbitrary elements
// @ts-ignore supress ts:2374 = Duplicate string index signature.
[name: string]: any
}
}

View File

@@ -1,4 +1,5 @@
if (__BROWSER__ && __DEV__) {
// @ts-ignore `console.info` cannot be null error
console[console.info ? 'info' : 'log'](
`You are running a development build of Vue.\n` +
`Make sure to use the production build (*.prod.js) when deploying for production.`