morghulis 2.0.47 → 2.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ // 自动生成的组件声明文件
2
+ declare module '@vue/runtime-core' {
3
+ export interface GlobalComponents {
4
+ MButton: {
5
+ type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
6
+ size?: 'large' | 'default' | 'small'
7
+ plain?: boolean
8
+ round?: boolean
9
+ circle?: boolean
10
+ disabled?: boolean
11
+ loading?: boolean
12
+ icon?: string
13
+ }
14
+ }
15
+ }
package/global.d.ts CHANGED
@@ -1,58 +1,107 @@
1
- // 为全局组件扩展类型
1
+ import { DefineComponent } from 'vue'
2
+
3
+ declare module 'morghulis' {
4
+ export interface MButtonProps {
5
+ /**
6
+ * 按钮类型
7
+ * @default 'default'
8
+ */
9
+ type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
10
+
11
+ /**
12
+ * 按钮尺寸
13
+ * @default 'default'
14
+ */
15
+ size?: 'large' | 'default' | 'small'
16
+
17
+ /**
18
+ * 是否为朴素按钮
19
+ * @default false
20
+ */
21
+ plain?: boolean
22
+
23
+ /**
24
+ * 是否为圆角按钮
25
+ * @default false
26
+ */
27
+ round?: boolean
28
+
29
+ /**
30
+ * 是否为圆形按钮
31
+ * @default false
32
+ */
33
+ circle?: boolean
34
+
35
+ /**
36
+ * 是否禁用按钮
37
+ * @default false
38
+ */
39
+ disabled?: boolean
40
+
41
+ /**
42
+ * 是否显示加载状态
43
+ * @default false
44
+ */
45
+ loading?: boolean
46
+
47
+ /**
48
+ * 按钮图标类名
49
+ */
50
+ icon?: string
51
+ }
52
+
53
+ export const MButton: DefineComponent<MButtonProps>
54
+ }
55
+
2
56
  declare module '@vue/runtime-core' {
3
- export interface GlobalComponents {
4
- MButton: {
57
+ interface GlobalComponents {
58
+ MButton: DefineComponent<{
5
59
  /**
6
60
  * 按钮类型
7
61
  * @default 'default'
8
62
  */
9
- type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
63
+ type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
10
64
 
11
65
  /**
12
66
  * 按钮尺寸
13
67
  * @default 'default'
14
68
  */
15
- size?: 'large' | 'default' | 'small';
69
+ size?: 'large' | 'default' | 'small'
16
70
 
17
71
  /**
18
72
  * 是否为朴素按钮
19
73
  * @default false
20
74
  */
21
- plain?: boolean;
75
+ plain?: boolean
22
76
 
23
77
  /**
24
78
  * 是否为圆角按钮
25
79
  * @default false
26
80
  */
27
- round?: boolean;
81
+ round?: boolean
28
82
 
29
83
  /**
30
84
  * 是否为圆形按钮
31
85
  * @default false
32
86
  */
33
- circle?: boolean;
87
+ circle?: boolean
34
88
 
35
89
  /**
36
90
  * 是否禁用按钮
37
91
  * @default false
38
92
  */
39
- disabled?: boolean;
93
+ disabled?: boolean
40
94
 
41
95
  /**
42
96
  * 是否显示加载状态
43
97
  * @default false
44
98
  */
45
- loading?: boolean;
99
+ loading?: boolean
46
100
 
47
101
  /**
48
102
  * 按钮图标类名
49
103
  */
50
- icon?: string;
51
-
52
- /**
53
- * 点击按钮时触发
54
- */
55
- onClick?: (event: MouseEvent) => void;
56
- }
104
+ icon?: string
105
+ }>
57
106
  }
58
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "2.0.47",
3
+ "version": "2.0.48",
4
4
  "description": "一个Vue 3按钮组件库,支持TypeScript和IDE自动补全",
5
5
  "type": "module",
6
6
  "main": "dist/morghulis.es.js",
@@ -8,7 +8,7 @@
8
8
  "types": "index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "types": ["./index.d.ts", "./global.d.ts"],
11
+ "types": ["./index.d.ts", "./global.d.ts", "./volar.d.ts", "./components.d.ts"],
12
12
  "import": "./dist/morghulis.es.js",
13
13
  "require": "./dist/morghulis.es.js"
14
14
  },
@@ -17,7 +17,9 @@
17
17
  "files": [
18
18
  "dist",
19
19
  "index.d.ts",
20
- "global.d.ts"
20
+ "global.d.ts",
21
+ "volar.d.ts",
22
+ "components.d.ts"
21
23
  ],
22
24
  "scripts": {
23
25
  "dev": "vite",
package/volar.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ declare module 'vue' {
2
+ export interface GlobalComponents {
3
+ MButton: {
4
+ type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
5
+ size?: 'large' | 'default' | 'small'
6
+ plain?: boolean
7
+ round?: boolean
8
+ circle?: boolean
9
+ disabled?: boolean
10
+ loading?: boolean
11
+ icon?: string
12
+ }
13
+ }
14
+ }