Skip to content

Commit

Permalink
test: add dts tests for defineComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jun 23, 2020
1 parent 9047e4a commit 1cb270e
Show file tree
Hide file tree
Showing 4 changed files with 622 additions and 8 deletions.
6 changes: 1 addition & 5 deletions src/component/componentOptions.ts
@@ -1,11 +1,7 @@
import { Data } from './common'
import { ComponentPropsOptions, ExtractPropTypes } from './componentProps'
import { VNode } from 'vue'
import {
ComponentInstance,
VueProxy,
ComponentRenderProxy,
} from './componentProxy'
import { ComponentInstance, ComponentRenderProxy } from './componentProxy'

import { ComponentOptions as Vue2ComponentOptions } from 'vue'

Expand Down
7 changes: 4 additions & 3 deletions src/component/componentProxy.ts
Expand Up @@ -25,18 +25,19 @@ export type ComponentRenderProxy<
PublicProps = P
> = {
$data: D
$props: P & PublicProps
$props: Readonly<P & PublicProps>
$attrs: Data
$refs: Data
$slots: Data
$root: ComponentInstance | null
$parent: ComponentInstance | null
$emit: (event: string, ...args: unknown[]) => void
} & P &
} & Readonly<P> &
UnwrapRef<B> &
D &
M &
ExtractComputedReturns<C>
ExtractComputedReturns<C> &
Vue

// for Vetur and TSX support
type VueConstructorProxy<PropsOptions, RawBindings> = VueConstructor & {
Expand Down

0 comments on commit 1cb270e

Please sign in to comment.