types: basic tsx support

This commit is contained in:
Evan You
2018-10-13 20:46:30 -04:00
parent 2599580bca
commit b3e3fd6ef5
4 changed files with 779 additions and 3 deletions

12
packages/core/jsx.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
declare namespace JSX {
interface Element {}
interface ElementClass {
render(props: any, slots: any, attrs: any): any
}
interface ElementAttributesProperty {
$props: {}
}
interface IntrinsicElements {
[name: string]: any
}
}

View File

@@ -13,9 +13,9 @@ import { nextTick } from '@vue/scheduler'
import { ErrorTypes } from './errorHandling'
import { initializeComponentInstance } from './componentUtils'
export interface ComponentClass<P = {}> extends ComponentClassOptions {
export interface ComponentClass extends ComponentClassOptions {
options?: ComponentOptions
new <P = {}, D = {}>(props?: P): MergedComponent<P, D>
new <P = {}, D = {}>(): MergedComponent<P, D>
}
export type MergedComponent<P, D> = D & P & ComponentInstance<P, D>
@@ -96,7 +96,6 @@ class InternalComponent {
public _events: { [event: string]: Function[] | null } | null = null
public _updateHandle: Autorun | null = null
public _queueJob: ((fn: () => void) => void) | null = null
public _revokeProxy: () => void
public _isVue: boolean = true
public _inactiveRoot: boolean = false