zy-react-library 1.3.10 → 1.3.11

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.
@@ -13,7 +13,7 @@ export interface DeleteFileOptions {
13
13
  single?: boolean;
14
14
  }
15
15
 
16
- export type DeleteFileFunction = (options: DeleteFileOptions) => Promise<any>;
16
+ export type DeleteFileFunction = (options: DeleteFileOptions) => Promise<void | any>;
17
17
 
18
18
  /**
19
19
  * 删除文件
@@ -7,7 +7,7 @@ interface UseDownloadBlobOptions {
7
7
  params?: Record<string, any>;
8
8
  }
9
9
 
10
- export type DownloadBlobFunction = (url: string, options?: UseDownloadBlobOptions) => Promise<any>;
10
+ export type DownloadBlobFunction = (url: string, options?: UseDownloadBlobOptions) => Promise<{ data: Blob }>;
11
11
 
12
12
  /**
13
13
  * 下载Blob流文件
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.3.10",
4
+ "version": "1.3.11",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",
package/utils/index.d.ts CHANGED
@@ -81,7 +81,7 @@ export function image2Base642(file: File): Promise<string>;
81
81
  /**
82
82
  * 判断图片是否可访问成功
83
83
  */
84
- export function checkImgExists(imgUrl: string): Promise<any>;
84
+ export function checkImgExists(imgUrl: string): Promise<Event>;
85
85
 
86
86
  /**
87
87
  * 获取数据类型
@@ -135,7 +135,7 @@ export function getUrlParam(key: string): string;
135
135
  */
136
136
  export function paging<T>(options: {
137
137
  /** 分页的数组 */
138
- list: any[];
138
+ list: Record<string, any>[];
139
139
  /** 当前页 */
140
140
  currentPage: number | string;
141
141
  /** 每页条数 */
@@ -184,7 +184,7 @@ export function getLabelName<T>(options: {
184
184
  /** 状态 */
185
185
  status: number | string;
186
186
  /** 翻译的数组 */
187
- list: any[];
187
+ list: Record<string, any>[];
188
188
  /** id字段名 */
189
189
  idKey?: string;
190
190
  /** name字段名 */
@@ -206,7 +206,7 @@ export function idCardGetDateAndGender(idCard: string): { sex: "1" | "0"; date:
206
206
  */
207
207
  export function getMatchedItems<T>(options: {
208
208
  /** 获取的数组 */
209
- list: any[];
209
+ list: Record<string, any>[];
210
210
  /** 获取的值 */
211
211
  value: (number | string)[];
212
212
  /** 获取的id字段名 */
@@ -218,7 +218,7 @@ export function getMatchedItems<T>(options: {
218
218
  */
219
219
  export function getUnmatchedItems<T>(options: {
220
220
  /** 获取的数组 */
221
- list: any[];
221
+ list: Record<string, any>[];
222
222
  /** 获取的值 */
223
223
  value: (number | string)[];
224
224
  /** 获取的id字段名 */
@@ -230,7 +230,7 @@ export function getUnmatchedItems<T>(options: {
230
230
  */
231
231
  export function listTransTree<T>(options: {
232
232
  /** 需要转换的json */
233
- json: any[];
233
+ json: Record<string, any>[];
234
234
  /** id字段 */
235
235
  idKey: string;
236
236
  /** 父级id字段 */
@@ -289,7 +289,7 @@ export function base642File(base64: string, filename?: string): File;
289
289
  export function getTreeNodePaths<T extends Record<string, any> = Record<string, any>>(
290
290
  options: {
291
291
  /** 树形数据 */
292
- data: any[];
292
+ data: Record<string, any>[];
293
293
  /** 目标节点ID */
294
294
  targetId: string | number;
295
295
  /** id字段名 */
@@ -297,7 +297,7 @@ export function getTreeNodePaths<T extends Record<string, any> = Record<string,
297
297
  /** 子节点字段名 */
298
298
  childrenKey: string;
299
299
  /** 路径数组 */
300
- path?: any[];
300
+ path?: Record<string, any>[];
301
301
  /** 是否包含自身 */
302
302
  isIncludeOneself?: boolean;
303
303
  },
@@ -309,7 +309,7 @@ export function getTreeNodePaths<T extends Record<string, any> = Record<string,
309
309
  export function processTreeDataByLevel(
310
310
  options: {
311
311
  /** 树形数据 */
312
- data: any[];
312
+ data: Record<string, any>[];
313
313
  /** 层级限制 */
314
314
  level?: number;
315
315
  /** 子节点字段名 */
@@ -330,7 +330,7 @@ export function processTreeDataByLevel(
330
330
  export function processTreeDataForOnlyLastLevel(
331
331
  options: {
332
332
  /** 树形数据 */
333
- data: any[];
333
+ data: Record<string, any>[];
334
334
  /** 子节点字段名 */
335
335
  childrenKey: string;
336
336
  /** 是否只允许选择最后一级 */
@@ -347,21 +347,21 @@ export function processTreeDataForOnlyLastLevel(
347
347
  * 验证结束时间是否大于开始时间
348
348
  */
349
349
  export function validatorEndTime(options: { startTime: string; message?: string; type?: "date" | "datetime" }): {
350
- validator: (_: any, value: any) => Promise<void | string>;
350
+ validator: (_: any, value: any) => Promise<void | any> | void;
351
351
  };
352
352
 
353
353
  /**
354
354
  * 验证时间是否大于当前时间
355
355
  */
356
356
  export function validatorTimeGTCurrentDay(options?: { message?: string; type?: "date" | "datetime" }): {
357
- validator: (_: any, value: any) => Promise<void | string>;
357
+ validator: (_: any, value: any) => Promise<void | any> | void;
358
358
  };
359
359
 
360
360
  /**
361
361
  * 验证时间是否大于等于当前时间
362
362
  */
363
363
  export function validatorTimeGECurrentDay(options?: { message?: string; type?: "date" | "datetime" }): {
364
- validator: (_: any, value: any) => Promise<void | string>;
364
+ validator: (_: any, value: any) => Promise<void | any> | void;
365
365
  };
366
366
 
367
367
  /**