morghulis 2.0.42 → 2.0.44

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 +39 -0
  2. package/package.json +7 -5
package/index.d.ts ADDED
@@ -0,0 +1,39 @@
1
+ import type { App } from 'vue';
2
+
3
+ export declare type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
4
+ export declare type ButtonSize = 'large' | 'default' | 'small';
5
+
6
+ export interface ButtonProps {
7
+ type?: ButtonType;
8
+ size?: ButtonSize;
9
+ plain?: boolean;
10
+ round?: boolean;
11
+ circle?: boolean;
12
+ disabled?: boolean;
13
+ loading?: boolean;
14
+ icon?: string;
15
+ }
16
+
17
+ export interface ButtonInstance {
18
+ $props: ButtonProps;
19
+ }
20
+
21
+ export interface ButtonEvents {
22
+ click: (event: MouseEvent) => void;
23
+ }
24
+
25
+ export declare const MButton: {
26
+ new (): {
27
+ $props: ButtonProps;
28
+ };
29
+ install(app: App): void;
30
+ };
31
+
32
+ export declare function install(app: App): void;
33
+
34
+ declare const _default: {
35
+ install: typeof install;
36
+ MButton: typeof MButton;
37
+ };
38
+
39
+ export default _default;
package/package.json CHANGED
@@ -1,27 +1,29 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "2.0.42",
3
+ "version": "2.0.44",
4
4
  "description": "一个Vue 3按钮组件库,支持TypeScript和IDE自动补全",
5
5
  "type": "module",
6
6
  "main": "dist/morghulis.es.js",
7
7
  "module": "dist/morghulis.es.js",
8
- "types": "dist/types/index.d.ts",
8
+ "types": "index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "types": "./dist/types/index.d.ts",
11
+ "types": "./index.d.ts",
12
12
  "import": "./dist/morghulis.es.js",
13
13
  "require": "./dist/morghulis.es.js"
14
14
  }
15
15
  },
16
16
  "files": [
17
- "dist"
17
+ "dist",
18
+ "index.d.ts"
18
19
  ],
19
20
  "scripts": {
20
21
  "dev": "vite",
21
- "build": "run-p type-check build-only",
22
+ "build": "run-p type-check build-only generate-types",
22
23
  "preview": "vite preview",
23
24
  "build-only": "vite build",
24
25
  "type-check": "vue-tsc --build",
26
+ "generate-types": "vue-tsc --project tsconfig.app.json --declaration --emitDeclarationOnly --outDir dist/types",
25
27
  "prepublishOnly": "npm run build"
26
28
  },
27
29
  "keywords": [