Skip to content

Commit 1cb270e

Browse files
committed
test: add dts tests for defineComponent
1 parent 9047e4a commit 1cb270e

File tree

4 files changed

+622
-8
lines changed

4 files changed

+622
-8
lines changed

src/component/componentOptions.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { Data } from './common'
22
import { ComponentPropsOptions, ExtractPropTypes } from './componentProps'
33
import { VNode } from 'vue'
4-
import {
5-
ComponentInstance,
6-
VueProxy,
7-
ComponentRenderProxy,
8-
} from './componentProxy'
4+
import { ComponentInstance, ComponentRenderProxy } from './componentProxy'
95

106
import { ComponentOptions as Vue2ComponentOptions } from 'vue'
117

src/component/componentProxy.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,19 @@ export type ComponentRenderProxy<
2525
PublicProps = P
2626
> = {
2727
$data: D
28-
$props: P & PublicProps
28+
$props: Readonly<P & PublicProps>
2929
$attrs: Data
3030
$refs: Data
3131
$slots: Data
3232
$root: ComponentInstance | null
3333
$parent: ComponentInstance | null
3434
$emit: (event: string, ...args: unknown[]) => void
35-
} & P &
35+
} & Readonly<P> &
3636
UnwrapRef<B> &
3737
D &
3838
M &
39-
ExtractComputedReturns<C>
39+
ExtractComputedReturns<C> &
40+
Vue
4041

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

0 commit comments

Comments
 (0)