Skip to content

Commit a740f5f

Browse files
committed
1 parent b020cfa commit a740f5f

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.3.8
2+
3+
- types: fix `DeepReadonly` to `Readonly`
4+
15
## 1.3.7
26

37
- types: fix `VueInstance` type error

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-class-setup",
3-
"version": "1.3.7",
3+
"version": "1.3.8",
44
"main": "dist/index.cjs.js",
55
"module": "dist/index.es.js",
66
"types": "dist/index.d.ts",

src/define.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,17 @@ import { Context, DefaultProps, DefaultEmit } from './context';
33
import { createDefineProperty } from './property-descriptors';
44
import { SETUP_SETUP_DEFINE } from './config';
55

6-
type DeepReadonly<T> = T extends object
7-
? T extends Array<any>
8-
? T
9-
: T extends Function
10-
? T
11-
: {
12-
readonly [P in keyof T]: DeepReadonly<T[P]>;
13-
}
14-
: T;
15-
166
interface DefineInstance<T, E> {
177
readonly $props: T;
188
readonly $emit: E;
199
readonly $vm: VueInstance;
20-
readonly $defaultProps: DeepReadonly<Partial<T>>;
10+
readonly $defaultProps: Readonly<Partial<T>>;
2111
}
2212

2313
type DefineInstanceType<
2414
T extends DefaultProps,
2515
E extends DefaultEmit = DefaultEmit
26-
> = DeepReadonly<T> & DefineInstance<T, E>;
16+
> = Readonly<T> & DefineInstance<T, E>;
2717

2818
export interface DefineConstructor {
2919
inject: typeof Context['inject'];

0 commit comments

Comments
 (0)