py-test-component 1.0.0 → 1.0.2
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.
- package/dist/py-component.js +1 -1
- package/index.d.ts +70 -0
- package/package.json +10 -3
- package/src/vue/index.js +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
declare module 'py-test-component' {
|
|
2
|
+
export interface PyComponentStore {
|
|
3
|
+
set(config: Record<string, any>): void;
|
|
4
|
+
get(key?: string): any;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const store: PyComponentStore;
|
|
8
|
+
export function init(config?: Record<string, any>): void;
|
|
9
|
+
|
|
10
|
+
const _default: {
|
|
11
|
+
init: typeof init;
|
|
12
|
+
store: PyComponentStore;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare module 'py-test-component/vue' {
|
|
18
|
+
import { Component } from 'vue';
|
|
19
|
+
|
|
20
|
+
/** 表格组件 - Vue 版本 */
|
|
21
|
+
export const PyTable: Component;
|
|
22
|
+
/** 天气组件 - Vue 版本 */
|
|
23
|
+
export const PyWeather: Component;
|
|
24
|
+
|
|
25
|
+
const _default: {
|
|
26
|
+
PyTable: typeof PyTable;
|
|
27
|
+
PyWeather: typeof PyWeather;
|
|
28
|
+
};
|
|
29
|
+
export default _default;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare module 'py-test-component/react' {
|
|
33
|
+
import { ReactNode, Ref, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
34
|
+
|
|
35
|
+
export interface PyTableProps {
|
|
36
|
+
/** 表格数据 */
|
|
37
|
+
data?: Record<string, any>[];
|
|
38
|
+
/** 其他 HTML 属性 */
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface PyWeatherProps {
|
|
43
|
+
/** 城市名称 */
|
|
44
|
+
city?: string;
|
|
45
|
+
/** 其他 HTML 属性 */
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface PyTableRef {
|
|
50
|
+
/** 获取 DOM 元素 */
|
|
51
|
+
getElement: () => HTMLElement | null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface PyWeatherRef {
|
|
55
|
+
/** 获取 DOM 元素 */
|
|
56
|
+
getElement: () => HTMLElement | null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** 表格组件 */
|
|
60
|
+
export const PyTable: ForwardRefExoticComponent<PyTableProps & RefAttributes<PyTableRef>>;
|
|
61
|
+
|
|
62
|
+
/** 天气组件 */
|
|
63
|
+
export const PyWeather: ForwardRefExoticComponent<PyWeatherProps & RefAttributes<PyWeatherRef>>;
|
|
64
|
+
|
|
65
|
+
/** 初始化组件库 */
|
|
66
|
+
export function initPyComponent(config?: Record<string, any>): void;
|
|
67
|
+
|
|
68
|
+
/** 获取全局 store */
|
|
69
|
+
export function getStore(): Record<string, any> | null;
|
|
70
|
+
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "py-test-component",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Vue2 + ElementUI 组件库,支持 React 使用",
|
|
5
5
|
"main": "dist/py-component.js",
|
|
6
6
|
"module": "dist/py-component.esm.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
|
-
".":
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/py-component.esm.js",
|
|
11
|
+
"require": "./dist/py-component.js"
|
|
12
|
+
},
|
|
13
|
+
"./vue": "./src/vue/index.js",
|
|
9
14
|
"./react": "./src/react/index.js"
|
|
10
15
|
},
|
|
11
16
|
"files": [
|
|
12
17
|
"dist",
|
|
13
|
-
"src/react"
|
|
18
|
+
"src/react",
|
|
19
|
+
"src/vue",
|
|
20
|
+
"index.d.ts"
|
|
14
21
|
],
|
|
15
22
|
"scripts": {
|
|
16
23
|
"build": "webpack --mode production",
|