@cowave-cli/utils 2.5.3

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,28 @@
1
+ /**
2
+ *
3
+ * @param callback 回调函数
4
+ * @param throttleTime 节流时长
5
+ *
6
+ *
7
+ * @example
8
+ *
9
+ * 1. 初始化 api/dict.ts -> initDict
10
+ *
11
+ * // initDict 接收callback函数,callback函数的参数为字典类型集合,如['dictType1','dictType2']
12
+ * // initDict 返回值为字典集合,如{dictType1:[],dictType2:[]},可以为异步
13
+ * export const useDict = initDict((dictTypes:string[])=>{
14
+ * return http.get('/api/dict'{dictTypes})
15
+ * })
16
+ *
17
+ * 2. 注册 views/xxx/xxx.vue -> useDict
18
+ *
19
+ * //页面注册dict ( 用于保存页面dict数据 )
20
+ * const dict = useDict()
21
+ *
22
+ * 3. 调用 views/xxx/xxx.vue -> dict
23
+ * dict('dictType1') // 获取dictType1字典
24
+ * dict('dictType2') // 获取dictType2字典
25
+ *
26
+ * @returns
27
+ */
28
+ export declare const initDict: (callback: (dictTypes: string[]) => Promise<Record<string, (Record<string, any>)[]>>, throttleTime?: number) => () => (dictType: string, cb?: () => any[]) => any;
@@ -0,0 +1,16 @@
1
+ /**
2
+ *
3
+ * 将文件夹下的文件按照 {文件名:文件} 的格式返回对象
4
+ *
5
+ * @param files
6
+ * @param stop
7
+ * @returns
8
+ */
9
+ export declare function importFile(files: any, stop?: (key: string) => boolean): {};
10
+ /**
11
+ *
12
+ * 获取文件上传状态
13
+ *
14
+ * @returns 文件被拖入浏览器ref(true) 文件被拖出浏览器/松开鼠标(false)
15
+ */
16
+ export declare function dragEvent(): import("vue").Ref<boolean, boolean>;
@@ -0,0 +1,2 @@
1
+ import { type Ref } from 'vue';
2
+ export declare function defineStore<T>(storeFunction: () => T): ((component?: Ref<any>) => T);
@@ -0,0 +1,4 @@
1
+ export declare function Subscribe(): {
2
+ send(...args: any[]): void;
3
+ onmessage: Function;
4
+ };