Skip to content

Commit

Permalink
release: vue-class-setup@1.3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
lzxb committed Jul 19, 2023
1 parent b020cfa commit a740f5f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 1.3.8

- types: fix `DeepReadonly` to `Readonly`

## 1.3.7

- types: fix `VueInstance` type error
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "vue-class-setup",
"version": "1.3.7",
"version": "1.3.8",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
"types": "dist/index.d.ts",
Expand Down
14 changes: 2 additions & 12 deletions src/define.ts
Expand Up @@ -3,27 +3,17 @@ import { Context, DefaultProps, DefaultEmit } from './context';
import { createDefineProperty } from './property-descriptors';
import { SETUP_SETUP_DEFINE } from './config';

type DeepReadonly<T> = T extends object
? T extends Array<any>
? T
: T extends Function
? T
: {
readonly [P in keyof T]: DeepReadonly<T[P]>;
}
: T;

interface DefineInstance<T, E> {
readonly $props: T;
readonly $emit: E;
readonly $vm: VueInstance;
readonly $defaultProps: DeepReadonly<Partial<T>>;
readonly $defaultProps: Readonly<Partial<T>>;
}

type DefineInstanceType<
T extends DefaultProps,
E extends DefaultEmit = DefaultEmit
> = DeepReadonly<T> & DefineInstance<T, E>;
> = Readonly<T> & DefineInstance<T, E>;

export interface DefineConstructor {
inject: typeof Context['inject'];
Expand Down

0 comments on commit a740f5f

Please sign in to comment.