morghulis 2.0.46 → 2.0.47

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 (3) hide show
  1. package/global.d.ts +58 -0
  2. package/index.d.ts +2 -16
  3. package/package.json +4 -3
package/global.d.ts ADDED
@@ -0,0 +1,58 @@
1
+ // 为全局组件扩展类型
2
+ declare module '@vue/runtime-core' {
3
+ export interface GlobalComponents {
4
+ MButton: {
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
+ * 点击按钮时触发
54
+ */
55
+ onClick?: (event: MouseEvent) => void;
56
+ }
57
+ }
58
+ }
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { App, DefineComponent, ComponentOptionsMixin } from 'vue';
1
+ import type { App, Component } from 'vue';
2
2
 
3
3
  // 按钮类型
4
4
  export declare type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
@@ -76,21 +76,7 @@ export interface ButtonInstance {
76
76
  }
77
77
 
78
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
- > & {
79
+ export declare const MButton: Component & {
94
80
  install(app: App): void;
95
81
  };
96
82
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "2.0.46",
3
+ "version": "2.0.47",
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",
11
+ "types": ["./index.d.ts", "./global.d.ts"],
12
12
  "import": "./dist/morghulis.es.js",
13
13
  "require": "./dist/morghulis.es.js"
14
14
  },
@@ -16,7 +16,8 @@
16
16
  },
17
17
  "files": [
18
18
  "dist",
19
- "index.d.ts"
19
+ "index.d.ts",
20
+ "global.d.ts"
20
21
  ],
21
22
  "scripts": {
22
23
  "dev": "vite",