@utogether/utils 2.8.5 → 3.0.0-beta.0

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.
@@ -1,31 +1,31 @@
1
- declare class Cookies {
2
- constructor();
3
- prefix: null;
4
- /**
5
- * 存储 cookie 值
6
- * @param name
7
- * @param value
8
- * @param cookieSetting
9
- */
10
- set(name?: string, value?: string): void;
11
- /**
12
- * 拿到 cookie 值
13
- * @param name
14
- * @returns
15
- */
16
- get(name?: string): string | undefined;
17
- /**
18
- * 拿到 cookie 全部的值
19
- * @returns
20
- */
21
- getAll(): string | undefined;
22
- /**
23
- * 删除 cookie
24
- * @param name
25
- */
26
- remove(name?: string): void;
27
- private getKey;
28
- addPrefix: (prefix: any) => void;
29
- }
30
- export declare const cookies: Cookies;
31
- export {};
1
+ declare class Cookies {
2
+ constructor();
3
+ prefix: null;
4
+ /**
5
+ * 存储 cookie 值
6
+ * @param name
7
+ * @param value
8
+ * @param cookieSetting
9
+ */
10
+ set(name?: string, value?: string): void;
11
+ /**
12
+ * 拿到 cookie 值
13
+ * @param name
14
+ * @returns
15
+ */
16
+ get(name?: string): string | undefined;
17
+ /**
18
+ * 拿到 cookie 全部的值
19
+ * @returns
20
+ */
21
+ getAll(): string | undefined;
22
+ /**
23
+ * 删除 cookie
24
+ * @param name
25
+ */
26
+ remove(name?: string): void;
27
+ private getKey;
28
+ addPrefix: (prefix: any) => void;
29
+ }
30
+ export declare const cookies: Cookies;
31
+ export {};
@@ -1,7 +1,7 @@
1
- interface BrowserInter {
2
- browser: string;
3
- version: string;
4
- }
5
- export declare const deviceDetection: () => boolean;
6
- export declare const getBrowserInfo: () => BrowserInter;
7
- export {};
1
+ interface BrowserInter {
2
+ browser: string;
3
+ version: string;
4
+ }
5
+ export declare const deviceDetection: () => boolean;
6
+ export declare const getBrowserInfo: () => BrowserInter;
7
+ export {};
@@ -1,9 +1,9 @@
1
- declare type FunctionArgs<Args extends any[] = any[], Return = void> = (...args: Args) => Return;
2
- declare type RefType<T> = T | null;
3
- export declare const hasClass: (ele: RefType<any>, cls: string) => any;
4
- export declare const addClass: (ele: RefType<any>, cls: string, extracls?: string) => any;
5
- export declare const removeClass: (ele: RefType<any>, cls: string, extracls?: string) => any;
6
- export declare const toggleClass: (flag: boolean, clsName: string, target?: RefType<any>) => any;
7
- export declare function useRafThrottle<T extends FunctionArgs>(fn: T): T;
8
- export declare const openLink: <T>(link: T) => void;
9
- export {};
1
+ declare type FunctionArgs<Args extends any[] = any[], Return = void> = (...args: Args) => Return;
2
+ declare type RefType<T> = T | null;
3
+ export declare const hasClass: (ele: RefType<any>, cls: string) => any;
4
+ export declare const addClass: (ele: RefType<any>, cls: string, extracls?: string) => any;
5
+ export declare const removeClass: (ele: RefType<any>, cls: string, extracls?: string) => any;
6
+ export declare const toggleClass: (flag: boolean, clsName: string, target?: RefType<any>) => any;
7
+ export declare function useRafThrottle<T extends FunctionArgs>(fn: T): T;
8
+ export declare const openLink: <T>(link: T) => void;
9
+ export {};
@@ -1,12 +1,12 @@
1
- /**
2
- * 加密方法
3
- * @param data
4
- * @returns {string}
5
- */
6
- export declare function encrypt(data: any): any;
7
- /**
8
- * 解密方法
9
- * @param data
10
- * @returns {string}
11
- */
12
- export declare function decrypt(data: any): any;
1
+ /**
2
+ * 加密方法
3
+ * @param data
4
+ * @returns {string}
5
+ */
6
+ export declare function encrypt(data: any): any;
7
+ /**
8
+ * 解密方法
9
+ * @param data
10
+ * @returns {string}
11
+ */
12
+ export declare function decrypt(data: any): any;
@@ -1,53 +1,53 @@
1
- export declare const formats: {
2
- formatDate: {
3
- cellFormatMethod({ cellValue }: {
4
- cellValue: any;
5
- }, format: any): any;
6
- };
7
- formatAmount: {
8
- cellFormatMethod({ cellValue }: {
9
- cellValue: any;
10
- }, digits?: number): string;
11
- };
12
- formatBankcard: {
13
- cellFormatMethod({ cellValue }: {
14
- cellValue: any;
15
- }): string;
16
- };
17
- formatFixedNumber: {
18
- cellFormatMethod({ cellValue }: {
19
- cellValue: any;
20
- }, digits?: number): any;
21
- };
22
- formatCutNumber: {
23
- cellFormatMethod({ cellValue }: {
24
- cellValue: any;
25
- }, digits?: number): any;
26
- };
27
- formatDict: {
28
- cellFormatMethod({ cellValue }: {
29
- cellValue: any;
30
- }, dictCode: any): any;
31
- };
32
- formatRelateField: {
33
- cellFormatMethod({ row, cellValue }: {
34
- row: any;
35
- cellValue: any;
36
- }, field: any): any;
37
- };
38
- formatContact: {
39
- cellFormatMethod({ row }: {
40
- row: any;
41
- }, fields: any): any;
42
- };
43
- formatSelectLocal: {
44
- cellFormatMethod({ cellValue }: {
45
- cellValue: any;
46
- }, localOptions: any): any;
47
- };
48
- formatMultiValue: {
49
- cellFormatMethod({ row }: {
50
- row: any;
51
- }, multiOptions: any): any;
52
- };
53
- };
1
+ export declare const formats: {
2
+ formatDate: {
3
+ tableCellFormatMethod({ cellValue }: {
4
+ cellValue: any;
5
+ }, format: any): any;
6
+ };
7
+ formatAmount: {
8
+ tableCellFormatMethod({ cellValue }: {
9
+ cellValue: any;
10
+ }, digits?: number): string;
11
+ };
12
+ formatBankcard: {
13
+ tableCellFormatMethod({ cellValue }: {
14
+ cellValue: any;
15
+ }): string;
16
+ };
17
+ formatFixedNumber: {
18
+ tableCellFormatMethod({ cellValue }: {
19
+ cellValue: any;
20
+ }, digits?: number): any;
21
+ };
22
+ formatCutNumber: {
23
+ tableCellFormatMethod({ cellValue }: {
24
+ cellValue: any;
25
+ }, digits?: number): any;
26
+ };
27
+ formatDict: {
28
+ tableCellFormatMethod({ cellValue }: {
29
+ cellValue: any;
30
+ }, dictCode: any): any;
31
+ };
32
+ formatRelateField: {
33
+ tableCellFormatMethod({ row, cellValue }: {
34
+ row: any;
35
+ cellValue: any;
36
+ }, field: any): any;
37
+ };
38
+ formatContact: {
39
+ tableCellFormatMethod({ row }: {
40
+ row: any;
41
+ }, fields: any): any;
42
+ };
43
+ formatSelectLocal: {
44
+ tableCellFormatMethod({ cellValue }: {
45
+ cellValue: any;
46
+ }, localOptions: any): any;
47
+ };
48
+ formatMultiValue: {
49
+ tableCellFormatMethod({ row }: {
50
+ row: any;
51
+ }, multiOptions: any): any;
52
+ };
53
+ };
@@ -1,43 +1,41 @@
1
- /**
2
- * @description: col数据国际化
3
- * @param {*} columns col
4
- * @return {*} 标准化后的col
5
- */
6
- export declare const i18nColums: (columns: any) => any;
7
- /**
8
- * @description: form item数据标准化
9
- * @param {*} items item
10
- * @param {*} status 状态
11
- * @return {*} form item数据标准化后的数据
12
- */
13
- export declare const formatItems: (items: any, status: any, span?: number) => any;
14
- /** 表单form查询按钮组 */
15
- export declare const formSearchButtons: {
16
- span: number;
17
- align: string;
18
- collapseNode: boolean;
19
- itemRender: {
20
- name: string;
21
- children: {
22
- props: {
23
- type: string;
24
- content: string;
25
- status: string;
26
- icon: string;
27
- };
28
- }[];
29
- };
30
- };
31
- /**
32
- * @description: grid 查询item格式化
33
- * @param {*} array items
34
- * @return {*} items
35
- */
36
- export declare const formatGridItems: (array: any, favorite: any) => any;
37
- /**
38
- * @description: 标准化必填数据
39
- * @param {*} records 数据列表
40
- * @param {*} t i18n对象
41
- * @return {*} rule数据
42
- */
43
- export declare const formatRules: (records: any, t: any) => {};
1
+ /**
2
+ * @description: col数据国际化
3
+ * @param {*} columns col
4
+ * @return {*} 标准化后的col
5
+ */
6
+ export declare const i18nColums: (columns: any) => any;
7
+ /**
8
+ * @description: form item数据标准化
9
+ * @param {*} items item
10
+ * @param {*} status 状态
11
+ * @return {*} form item数据标准化后的数据
12
+ */
13
+ export declare const formatItems: (items: any, status: any, span?: number) => any;
14
+ /** 表单form查询按钮组 */
15
+ export declare const formSearchButtons: {
16
+ span: number;
17
+ align: string;
18
+ collapseNode: boolean;
19
+ itemRender: {
20
+ name: string;
21
+ options: {
22
+ type: string;
23
+ content: string;
24
+ status: string;
25
+ icon: string;
26
+ }[];
27
+ };
28
+ };
29
+ /**
30
+ * @description: grid 查询item格式化
31
+ * @param {*} array items
32
+ * @return {*} items
33
+ */
34
+ export declare const formatGridItems: (array: any, favorite: any) => any;
35
+ /**
36
+ * @description: 标准化必填数据
37
+ * @param {*} records 数据列表
38
+ * @param {*} t i18n对象
39
+ * @return {*} rule数据
40
+ */
41
+ export declare const formatRules: (records: any, t: any) => {};
@@ -1,31 +1,32 @@
1
- import { AxiosRequestConfig } from "axios";
2
- import { RequestMethods, SuHttpRequestConfig } from "./types.d";
3
- declare class SuHttp {
4
- constructor();
5
- router: undefined;
6
- baseUrl: null;
7
- /** token过期后,暂存待执行的请求 */
8
- private static requests;
9
- /** 防止重复刷新token */
10
- private static isRefreshing;
11
- /** 设置router调整 */
12
- setRouter(router: any): void;
13
- setBaseUrl(baseUrl: any): void;
14
- private static initConfig;
15
- private static axiosInstance;
16
- /** 重连原始请求 */
17
- private static retryOriginalRequest;
18
- private httpInterceptorsRequest;
19
- private setToken;
20
- private httpInterceptorsResponse;
21
- private transformConfigByMethod;
22
- request<T>(method: RequestMethods, url: string, param?: AxiosRequestConfig, axiosConfig?: SuHttpRequestConfig): Promise<T>;
23
- getNetworkError: (code: any) => any;
24
- post<T, P>(url: string, params?: T, config?: SuHttpRequestConfig): Promise<P>;
25
- delete<T, P>(url: string, params?: T, config?: SuHttpRequestConfig): Promise<P>;
26
- put<T, P>(url: string, params?: T, config?: SuHttpRequestConfig): Promise<P>;
27
- get<T, P>(url: string, params?: T, config?: SuHttpRequestConfig): Promise<P>;
28
- postRouter<T>(params?: any): Promise<T>;
29
- }
30
- export declare const http: SuHttp;
31
- export {};
1
+ import { AxiosRequestConfig } from 'axios';
2
+ import { RequestMethods, SuHttpRequestConfig } from './types.d';
3
+
4
+ declare class SuHttp {
5
+ constructor();
6
+ router: undefined;
7
+ baseUrl: null;
8
+ /** token过期后,暂存待执行的请求 */
9
+ private static requests;
10
+ /** 防止重复刷新token */
11
+ private static isRefreshing;
12
+ /** 设置router调整 */
13
+ setRouter(router: any): void;
14
+ setBaseUrl(baseUrl: any): void;
15
+ private static initConfig;
16
+ private static axiosInstance;
17
+ /** 重连原始请求 */
18
+ private static retryOriginalRequest;
19
+ private httpInterceptorsRequest;
20
+ private setToken;
21
+ private httpInterceptorsResponse;
22
+ private transformConfigByMethod;
23
+ request<T>(method: RequestMethods, url: string, param?: AxiosRequestConfig, axiosConfig?: SuHttpRequestConfig): Promise<T>;
24
+ getNetworkError: (code: any) => any;
25
+ post<T, P>(url: string, params?: T, config?: SuHttpRequestConfig): Promise<P>;
26
+ delete<T, P>(url: string, params?: T, config?: SuHttpRequestConfig): Promise<P>;
27
+ put<T, P>(url: string, params?: T, config?: SuHttpRequestConfig): Promise<P>;
28
+ get<T, P>(url: string, params?: T, config?: SuHttpRequestConfig): Promise<P>;
29
+ postRouter<T>(params?: any): Promise<T>;
30
+ }
31
+ export declare const http: SuHttp;
32
+ export {};