morghulis 2.0.45 → 2.0.46

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.
Files changed (2) hide show
  1. package/index.d.ts +77 -6
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,33 +1,103 @@
1
- import type { App, Component } from 'vue';
1
+ import type { App, DefineComponent, ComponentOptionsMixin } from 'vue';
2
2
 
3
+ // 按钮类型
3
4
  export declare type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
5
+
6
+ // 按钮尺寸
4
7
  export declare type ButtonSize = 'large' | 'default' | 'small';
5
8
 
9
+ // 按钮属性
6
10
  export interface ButtonProps {
11
+ /**
12
+ * 按钮类型
13
+ * @default 'default'
14
+ */
7
15
  type?: ButtonType;
16
+
17
+ /**
18
+ * 按钮尺寸
19
+ * @default 'default'
20
+ */
8
21
  size?: ButtonSize;
22
+
23
+ /**
24
+ * 是否为朴素按钮
25
+ * @default false
26
+ */
9
27
  plain?: boolean;
28
+
29
+ /**
30
+ * 是否为圆角按钮
31
+ * @default false
32
+ */
10
33
  round?: boolean;
34
+
35
+ /**
36
+ * 是否为圆形按钮
37
+ * @default false
38
+ */
11
39
  circle?: boolean;
40
+
41
+ /**
42
+ * 是否禁用按钮
43
+ * @default false
44
+ */
12
45
  disabled?: boolean;
46
+
47
+ /**
48
+ * 是否显示加载状态
49
+ * @default false
50
+ */
13
51
  loading?: boolean;
52
+
53
+ /**
54
+ * 按钮图标类名
55
+ */
14
56
  icon?: string;
15
57
  }
16
58
 
17
- export interface ButtonInstance {
18
- $props: ButtonProps;
19
- }
20
-
59
+ // 按钮事件
21
60
  export interface ButtonEvents {
61
+ /**
62
+ * 点击按钮时触发
63
+ * @param event 鼠标事件对象
64
+ */
22
65
  click: (event: MouseEvent) => void;
23
66
  }
24
67
 
25
- export declare const MButton: Component & {
68
+ // 按钮实例
69
+ export interface ButtonInstance {
70
+ $props: ButtonProps;
71
+
72
+ /**
73
+ * 触发按钮点击事件
74
+ */
75
+ triggerClick: () => void;
76
+ }
77
+
78
+ // MButton组件
79
+ export declare const MButton: DefineComponent<
80
+ ButtonProps,
81
+ {},
82
+ {},
83
+ {},
84
+ {},
85
+ ComponentOptionsMixin,
86
+ ComponentOptionsMixin,
87
+ {
88
+ click: (event: MouseEvent) => void
89
+ },
90
+ string,
91
+ ButtonProps,
92
+ {}
93
+ > & {
26
94
  install(app: App): void;
27
95
  };
28
96
 
97
+ // 全局安装函数
29
98
  export declare function install(app: App): void;
30
99
 
100
+ // 默认导出
31
101
  declare const _default: {
32
102
  install: typeof install;
33
103
  MButton: typeof MButton;
@@ -35,6 +105,7 @@ declare const _default: {
35
105
 
36
106
  export default _default;
37
107
 
108
+ // 为全局组件扩展类型
38
109
  declare module '@vue/runtime-core' {
39
110
  export interface GlobalComponents {
40
111
  MButton: typeof MButton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "2.0.45",
3
+ "version": "2.0.46",
4
4
  "description": "一个Vue 3按钮组件库,支持TypeScript和IDE自动补全",
5
5
  "type": "module",
6
6
  "main": "dist/morghulis.es.js",