@vope/utils 1.4.4 → 1.4.6

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 (58) hide show
  1. package/cjs/index.js +129 -56
  2. package/lib/clamp.js +2 -2
  3. package/lib/classnames.js +2 -2
  4. package/lib/compare/version.js +1 -2
  5. package/lib/compare/weak-equal.js +1 -2
  6. package/lib/convert/json.js +1 -2
  7. package/lib/convert/object.js +1 -2
  8. package/lib/convert/strings.js +1 -2
  9. package/lib/desens.js +51 -0
  10. package/lib/encoding.js +16 -16
  11. package/lib/index.js +56 -48
  12. package/lib/input-regex.js +1 -2
  13. package/lib/is/class.js +1 -2
  14. package/lib/is/empty.js +2 -3
  15. package/lib/is/null.js +1 -2
  16. package/lib/load/image.js +11 -0
  17. package/lib/memory/basic.js +2 -2
  18. package/lib/memory/list.js +2 -2
  19. package/lib/memory/power.js +3 -3
  20. package/lib/once.js +2 -2
  21. package/lib/power/decon.js +1 -2
  22. package/lib/rotate/angle.js +2 -3
  23. package/lib/rotate/rad.js +1 -2
  24. package/lib/style/css.js +26 -0
  25. package/lib/table/flex.js +1 -1
  26. package/lib/union.js +1 -1
  27. package/lib/url/join.js +1 -2
  28. package/lib/url/params.js +1 -2
  29. package/lib/wait.js +2 -2
  30. package/package.json +56 -55
  31. package/types/clamp.d.ts +1 -2
  32. package/types/classnames.d.ts +2 -2
  33. package/types/compare/version.d.ts +1 -2
  34. package/types/compare/weak-equal.d.ts +1 -2
  35. package/types/convert/json.d.ts +1 -2
  36. package/types/convert/object.d.ts +1 -2
  37. package/types/convert/strings.d.ts +1 -2
  38. package/types/desens.d.ts +40 -0
  39. package/types/encoding.d.ts +1 -2
  40. package/types/index.d.ts +27 -24
  41. package/types/input-regex.d.ts +2 -3
  42. package/types/is/class.d.ts +1 -2
  43. package/types/is/empty.d.ts +1 -2
  44. package/types/is/null.d.ts +1 -2
  45. package/types/load/image.d.ts +5 -0
  46. package/types/memory/basic.d.ts +1 -1
  47. package/types/memory/list.d.ts +2 -2
  48. package/types/memory/power.d.ts +2 -2
  49. package/types/once.d.ts +1 -2
  50. package/types/power/decon.d.ts +2 -2
  51. package/types/rotate/angle.d.ts +1 -2
  52. package/types/rotate/rad.d.ts +1 -2
  53. package/types/style/css.d.ts +9 -0
  54. package/types/table/flex.d.ts +1 -1
  55. package/types/union.d.ts +1 -1
  56. package/types/url/join.d.ts +1 -2
  57. package/types/url/params.d.ts +2 -2
  58. package/types/wait.d.ts +1 -2
@@ -1,4 +1,4 @@
1
- import hash8strings from "../convert/strings";
1
+ import { hash8strings } from "../convert/strings";
2
2
  class MemoryBasic {
3
3
  /**
4
4
  * @param key 用于对数据进行分类的key
@@ -134,5 +134,5 @@ class MemoryBasic {
134
134
  }
135
135
  }
136
136
  export {
137
- MemoryBasic as default
137
+ MemoryBasic
138
138
  };
@@ -1,4 +1,4 @@
1
- import MemoryBasic from "./basic";
1
+ import { MemoryBasic } from "./basic";
2
2
  class MemoryList extends MemoryBasic {
3
3
  constructor(key) {
4
4
  super(key, {
@@ -8,5 +8,5 @@ class MemoryList extends MemoryBasic {
8
8
  }
9
9
  }
10
10
  export {
11
- MemoryList as default
11
+ MemoryList
12
12
  };
@@ -1,5 +1,5 @@
1
- import deconPowersSum from "../power/decon";
2
- import MemoryBasic from "./basic";
1
+ import { deconPowersSum } from "../power/decon";
2
+ import { MemoryBasic } from "./basic";
3
3
  class MemoryPower extends MemoryBasic {
4
4
  constructor(key) {
5
5
  super(key, {
@@ -9,5 +9,5 @@ class MemoryPower extends MemoryBasic {
9
9
  }
10
10
  }
11
11
  export {
12
- MemoryPower as default
12
+ MemoryPower
13
13
  };
package/lib/once.js CHANGED
@@ -1,8 +1,8 @@
1
- var once_default = (func, thisArg) => {
1
+ const once = (func, thisArg) => {
2
2
  let local;
3
3
  let inited = false;
4
4
  return (...list) => inited ? local : (inited = true, local = func.apply(thisArg, list));
5
5
  };
6
6
  export {
7
- once_default as default
7
+ once
8
8
  };
@@ -17,7 +17,6 @@ const deconPowersSum = (sum, sort) => {
17
17
  }
18
18
  return sort === "asc" ? list.reverse() : list;
19
19
  };
20
- var decon_default = deconPowersSum;
21
20
  export {
22
- decon_default as default
21
+ deconPowersSum
23
22
  };
@@ -1,6 +1,5 @@
1
- import rotateRad from "./rad";
1
+ import { rotateRad } from "./rad";
2
2
  const rotateAngle = (from, angle, visit) => rotateRad(from, angle / 180 * Math.PI, visit);
3
- var angle_default = rotateAngle;
4
3
  export {
5
- angle_default as default
4
+ rotateAngle
6
5
  };
package/lib/rotate/rad.js CHANGED
@@ -6,7 +6,6 @@ const rotateRad = (from, rad, visit = [0, 0]) => {
6
6
  y * Math.cos(rad) - x * Math.sin(rad) + visit[1]
7
7
  ];
8
8
  };
9
- var rad_default = rotateRad;
10
9
  export {
11
- rad_default as default
10
+ rotateRad
12
11
  };
@@ -0,0 +1,26 @@
1
+ import { isString } from "lodash-es";
2
+ import { isNull } from "../is/null";
3
+ const hump = /[A-Z]/g;
4
+ const css = (...args) => {
5
+ const list = [];
6
+ for (let i = 0; i < args.length; i++) {
7
+ const data = args[i];
8
+ if (!data)
9
+ continue;
10
+ if (isString(data)) {
11
+ list.push(data);
12
+ } else if (Array.isArray(data)) {
13
+ const result = css(...data);
14
+ result && list.push(result);
15
+ } else {
16
+ for (const key in data) {
17
+ const value = data[key];
18
+ isNull(value) || list.push(`${key.replace(hump, ($0) => "-" + $0.toLocaleLowerCase())}: ${value}`);
19
+ }
20
+ }
21
+ }
22
+ return list.join(";");
23
+ };
24
+ export {
25
+ css
26
+ };
package/lib/table/flex.js CHANGED
@@ -97,5 +97,5 @@ class FlexTable {
97
97
  }
98
98
  }
99
99
  export {
100
- FlexTable as default
100
+ FlexTable
101
101
  };
package/lib/union.js CHANGED
@@ -20,5 +20,5 @@ class Union {
20
20
  }
21
21
  }
22
22
  export {
23
- Union as default
23
+ Union
24
24
  };
package/lib/url/join.js CHANGED
@@ -5,7 +5,6 @@ const joinPaths = (...list) => {
5
5
  return "";
6
6
  return length === 1 ? list[0] : list.join("/").replace(re, ($0, $1) => `${$1}/`);
7
7
  };
8
- var join_default = joinPaths;
9
8
  export {
10
- join_default as default
9
+ joinPaths
11
10
  };
package/lib/url/params.js CHANGED
@@ -19,7 +19,6 @@ const connectURLParams = (url, params, isOpenType) => {
19
19
  const caches = list.join("&");
20
20
  return url.includes("?") ? url + "&" + caches : url + "?" + caches;
21
21
  };
22
- var params_default = connectURLParams;
23
22
  export {
24
- params_default as default
23
+ connectURLParams
25
24
  };
package/lib/wait.js CHANGED
@@ -1,4 +1,4 @@
1
- var wait_default = (delay = 0) => new Promise((resolve) => setTimeout(resolve, delay));
1
+ const wait = (delay = 0) => new Promise((resolve) => setTimeout(resolve, delay));
2
2
  export {
3
- wait_default as default
3
+ wait
4
4
  };
package/package.json CHANGED
@@ -1,55 +1,56 @@
1
- {
2
- "name": "@vope/utils",
3
- "version": "1.4.4",
4
- "description": "",
5
- "type": "module",
6
- "publishConfig": {
7
- "access": "public",
8
- "registry": "https://registry.npmjs.org/"
9
- },
10
- "types": "./types/index.d.ts",
11
- "module": "./lib/index.js",
12
- "main": "./cjs/index.js",
13
- "scripts": {
14
- "postinstall": "esbuild ./pre.ts --outfile=pre.cjs --format=cjs & node ./pre.cjs",
15
- "prebuild": "npm run postinstall & esbuild ./build.ts --outfile=build.cjs --format=cjs",
16
- "build": "node ./build.cjs",
17
- "premocha": "node ./build.cjs --type=test",
18
- "mocha": "mocha __tests/**/*.js",
19
- "test": "npm run mocha",
20
- "prepublishOnly": "npm run build & npm run test"
21
- },
22
- "exports": {
23
- ".": {
24
- "import": "./lib/index.js",
25
- "require": "./cjs/index.js"
26
- }
27
- },
28
- "author": "vope",
29
- "license": "ISC",
30
- "files": [
31
- "cjs",
32
- "lib",
33
- "types"
34
- ],
35
- "devDependencies": {
36
- "@babel/parser": "^7.23.4",
37
- "@babel/traverse": "^7.23.4",
38
- "@babel/types": "^7.23.4",
39
- "@types/babel__traverse": "^7.20.4",
40
- "@types/mocha": "^10.0.6",
41
- "@types/node": "^20.4.5",
42
- "esbuild": "^0.19.4",
43
- "glob": "^10.3.10",
44
- "iconv-lite": "^0.6.3",
45
- "mocha": "^10.2.0",
46
- "rimraf": "^5.0.5",
47
- "tslib": "^2.6.1",
48
- "typescript": "^5.3.2"
49
- },
50
- "dependencies": {
51
- "@types/lodash-es": "^4.17.9",
52
- "@vope/types": "^1.0.2",
53
- "lodash-es": "^4.17.21"
54
- }
55
- }
1
+ {
2
+ "name": "@vope/utils",
3
+ "version": "1.4.6",
4
+ "description": "",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public",
8
+ "registry": "https://registry.npmjs.org/"
9
+ },
10
+ "types": "./types/index.d.ts",
11
+ "module": "./lib/index.js",
12
+ "main": "./cjs/index.js",
13
+ "scripts": {
14
+ "start": "esbuild ./pre.ts --outfile=pre.cjs --format=cjs & node ./pre.cjs",
15
+ "prebuild": "npm run start & esbuild ./build.ts --outfile=build.cjs --format=cjs",
16
+ "build": "node ./build.cjs",
17
+ "premocha": "node ./build.cjs --type=test",
18
+ "mocha": "mocha __tests/**/*.js",
19
+ "test": "npm run mocha",
20
+ "prepublishOnly": "npm run build & npm run test"
21
+ },
22
+ "exports": {
23
+ ".": {
24
+ "import": "./lib/index.js",
25
+ "require": "./cjs/index.js"
26
+ }
27
+ },
28
+ "author": "vope",
29
+ "license": "ISC",
30
+ "files": [
31
+ "cjs",
32
+ "lib",
33
+ "types"
34
+ ],
35
+ "devDependencies": {
36
+ "@babel/parser": "^7.23.4",
37
+ "@babel/traverse": "^7.23.4",
38
+ "@babel/types": "^7.23.4",
39
+ "@types/babel__traverse": "^7.20.4",
40
+ "@types/mocha": "^10.0.6",
41
+ "@types/node": "^20.4.5",
42
+ "esbuild": "^0.19.4",
43
+ "glob": "^10.3.10",
44
+ "iconv-lite": "^0.6.3",
45
+ "mocha": "^10.2.0",
46
+ "rimraf": "^5.0.5",
47
+ "tslib": "^2.6.1",
48
+ "typescript": "^5.3.2"
49
+ },
50
+ "dependencies": {
51
+ "@types/lodash-es": "^4.17.9",
52
+ "@vope/types": "^1.0.4",
53
+ "csstype": "^3.1.3",
54
+ "lodash-es": "^4.17.21"
55
+ }
56
+ }
package/types/clamp.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  /**
2
2
  * 获取中间数
3
3
  */
4
- declare const _default: (value: number, min: number, max: number) => number;
5
- export default _default;
4
+ export declare const clamp: (value: number, min: number, max: number) => number;
@@ -3,5 +3,5 @@ type Item = Base | Base[] | Record<string, boolean>;
3
3
  /**
4
4
  * 拼接多个class
5
5
  */
6
- declare const _default: (...list: Item[]) => string;
7
- export default _default;
6
+ export declare const classnames: (...list: Item[]) => string;
7
+ export {};
@@ -2,5 +2,4 @@
2
2
  * 版本号大小比较
3
3
  * @description from < to = 1,from === to = 0,from > to = -1
4
4
  */
5
- declare const compareVersion: (from: string, to: string) => 0 | 1 | -1;
6
- export default compareVersion;
5
+ export declare const compareVersion: (from: string, to: string) => 0 | 1 | -1;
@@ -1,5 +1,4 @@
1
1
  /**
2
2
  * 深度相等性比较(弱比较)
3
3
  */
4
- declare const deepWeakEqual: (from: any, to: any) => boolean;
5
- export default deepWeakEqual;
4
+ export declare const deepWeakEqual: (from: any, to: any) => boolean;
@@ -9,5 +9,4 @@
9
9
  * 'key'
10
10
  * ).a.value // 1
11
11
  */
12
- declare const hash8json: <K extends string | symbol, T extends Record<K, string | number>>(list: T[], key: K) => Record<T[K], T>;
13
- export default hash8json;
12
+ export declare const hash8json: <K extends string | symbol, T extends Record<K, string | number>>(list: T[], key: K) => Record<T[K], T>;
@@ -9,5 +9,4 @@
9
9
  * 'key'
10
10
  * ).get(Object).value // 2
11
11
  */
12
- declare const hash8object: <K extends string | symbol, T extends Record<K, unknown>>(list: T[], key: K) => Map<T[K], T>;
13
- export default hash8object;
12
+ export declare const hash8object: <K extends string | symbol, T extends Record<K, unknown>>(list: T[], key: K) => Map<T[K], T>;
@@ -3,5 +3,4 @@
3
3
  * @example
4
4
  * hash8strings(['a', 'b']).a // 0
5
5
  */
6
- declare const hash8strings: <T extends string | number>(list: T[]) => { [P in T]: number; };
7
- export default hash8strings;
6
+ export declare const hash8strings: <T extends string | number>(list: T[]) => { [P in T]: number; };
@@ -0,0 +1,40 @@
1
+ interface Rule {
2
+ /** 加密的开始(包含)和结束(包含)位置(位置信息基于明文) */
3
+ range: [number, number];
4
+ }
5
+ interface DecryptRule extends Rule {
6
+ /** 密文长度 */
7
+ modify: number;
8
+ }
9
+ interface EncryptRule extends Rule {
10
+ /** 密文 */
11
+ ciphertext: string;
12
+ }
13
+ /**
14
+ * 脱敏加密(对明文进行多个片段加密)
15
+ * @param plaintext 明文
16
+ * @param encrypt 加密方法
17
+ * @returns 解密要素
18
+ */
19
+ export declare const desensEncrypt: (plaintext: string, encrypt: (plaintext: string) => EncryptRule[]) => {
20
+ ciphertext: string;
21
+ rules: DecryptRule[];
22
+ };
23
+ /**
24
+ * 脱敏解密(对密文进行多个片段解密)
25
+ * @param plaintext 密文
26
+ * @param rules 解密要素
27
+ * @param decrypt 解密方法
28
+ */
29
+ export declare const desensDecrypt: (ciphertext: string, rules: DecryptRule | DecryptRule[], decrypt: (ciphertext: string) => string) => string;
30
+ type Replacer = string | {
31
+ [Symbol.replace](text: string, size: number): string;
32
+ };
33
+ /**
34
+ * 脱敏平替
35
+ * @param plaintext 密文
36
+ * @param rules 解密要素
37
+ * @param replacer 替换者
38
+ */
39
+ export declare const desensReplace: (ciphertext: string, rules: DecryptRule | DecryptRule[], replacer?: Replacer) => string;
40
+ export {};
@@ -3,8 +3,7 @@
3
3
  * @param uint 文件内容Uint8Array格式
4
4
  * @param limit 用于约束GBK和utf_8的判定上限
5
5
  */
6
- declare const getEncoding: (uint: Uint8Array, limit?: number) => {
6
+ export declare const getEncoding: (uint: Uint8Array, limit?: number) => {
7
7
  encoding: "utf-8" | "utf-16le" | "utf-16be" | "gbk";
8
8
  offset: number;
9
9
  };
10
- export default getEncoding;
package/types/index.d.ts CHANGED
@@ -1,24 +1,27 @@
1
- export { default as clamp } from './clamp';
2
- export { default as classnames } from './classnames';
3
- export { default as compareVersion } from './compare/version';
4
- export { default as deepWeakEqual } from './compare/weak-equal';
5
- export { default as hash8json } from './convert/json';
6
- export { default as hash8object } from './convert/object';
7
- export { default as hash8strings } from './convert/strings';
8
- export { default as getEncoding } from './encoding';
9
- export { default as inputRegex } from './input-regex';
10
- export { default as isClass } from './is/class';
11
- export { default as isEmpty } from './is/empty';
12
- export { default as isNull } from './is/null';
13
- export { default as MemoryBasic } from './memory/basic';
14
- export { default as MemoryList } from './memory/list';
15
- export { default as MemoryPower } from './memory/power';
16
- export { default as once } from './once';
17
- export { default as deconPowersSum } from './power/decon';
18
- export { default as rotateAngle } from './rotate/angle';
19
- export { default as rotateRad } from './rotate/rad';
20
- export { default as FlexTable } from './table/flex';
21
- export { default as Union } from './union';
22
- export { default as joinPaths } from './url/join';
23
- export { default as connectURLParams } from './url/params';
24
- export { default as wait } from './wait';
1
+ export { clamp } from './clamp';
2
+ export { classnames } from './classnames';
3
+ export { compareVersion } from './compare/version';
4
+ export { deepWeakEqual } from './compare/weak-equal';
5
+ export { hash8json } from './convert/json';
6
+ export { hash8object } from './convert/object';
7
+ export { hash8strings } from './convert/strings';
8
+ export { desensEncrypt, desensDecrypt, desensReplace } from './desens';
9
+ export { getEncoding } from './encoding';
10
+ export { inputRegex } from './input-regex';
11
+ export { isClass } from './is/class';
12
+ export { isEmpty } from './is/empty';
13
+ export { isNull } from './is/null';
14
+ export { loadImage } from './load/image';
15
+ export { MemoryBasic } from './memory/basic';
16
+ export { MemoryList } from './memory/list';
17
+ export { MemoryPower } from './memory/power';
18
+ export { once } from './once';
19
+ export { deconPowersSum } from './power/decon';
20
+ export { rotateAngle } from './rotate/angle';
21
+ export { rotateRad } from './rotate/rad';
22
+ export { type CSSProperties, type StyleValue, css } from './style/css';
23
+ export { FlexTable } from './table/flex';
24
+ export { Union } from './union';
25
+ export { joinPaths } from './url/join';
26
+ export { connectURLParams } from './url/params';
27
+ export { wait } from './wait';
@@ -3,11 +3,10 @@
3
3
  * @param text
4
4
  * @param flags 表示输出正则表达式
5
5
  */
6
- declare function inputRegex(text: string, flags?: string): RegExp;
6
+ export declare function inputRegex(text: string, flags?: string): RegExp;
7
7
  /**
8
8
  * 处理输入文本中的特殊字符,用于转换正则表达式
9
9
  * @param text
10
10
  * @param flags 表示输出字符串,该字符串将作为正则表达式的一部分
11
11
  */
12
- declare function inputRegex(text: string, flags: false): string;
13
- export default inputRegex;
12
+ export declare function inputRegex(text: string, flags: false): string;
@@ -1,5 +1,4 @@
1
1
  /**
2
2
  * 检测是否为class
3
3
  */
4
- declare const isClass: (value: any, strict?: boolean) => value is new (...args: any) => any;
5
- export default isClass;
4
+ export declare const isClass: (value: any, strict?: boolean) => value is new (...args: any) => any;
@@ -1,5 +1,4 @@
1
1
  /**
2
2
  * 检测是否为空(undefined/null/'')
3
3
  */
4
- declare const isEmpty: (value: any) => value is "" | null | undefined;
5
- export default isEmpty;
4
+ export declare const isEmpty: (value: any) => value is "" | null | undefined;
@@ -1,5 +1,4 @@
1
1
  /**
2
2
  * 检测是否无值(undefined/null)
3
3
  */
4
- declare const isNull: (value: any) => value is null | undefined;
5
- export default isNull;
4
+ export declare const isNull: (value: any) => value is null | undefined;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 加载图片
3
+ * @param src
4
+ */
5
+ export declare const loadImage: (src: string) => Promise<HTMLImageElement | null>;
@@ -15,7 +15,7 @@ interface Config<Reactor> {
15
15
  /**
16
16
  * 分类存储(通过继承,可用于拓展存储方式)
17
17
  */
18
- export default class MemoryBasic<V, Reactor, Type extends Memory.Type> {
18
+ export declare class MemoryBasic<V, Reactor, Type extends Memory.Type> {
19
19
  #private;
20
20
  protected key: Memory.Pitch<V, Type>;
21
21
  protected list: V[];
@@ -1,8 +1,8 @@
1
- import MemoryBasic from './basic';
1
+ import { MemoryBasic } from './basic';
2
2
  import { Memory } from './type';
3
3
  /**
4
4
  * 分类存储(基于普通的键值存储)
5
5
  */
6
- export default class MemoryList<V, Type extends Memory.Type = Memory.Type> extends MemoryBasic<V, number[], Type> {
6
+ export declare class MemoryList<V, Type extends Memory.Type = Memory.Type> extends MemoryBasic<V, number[], Type> {
7
7
  constructor(key: Memory.Pitch<V, Type>);
8
8
  }
@@ -1,8 +1,8 @@
1
- import MemoryBasic from './basic';
1
+ import { MemoryBasic } from './basic';
2
2
  import { Memory } from './type';
3
3
  /**
4
4
  * 分类存储(基于2的n次幂之和构建唯一键进行存储)
5
5
  */
6
- export default class MemoryPower<V, Type extends Memory.Type = Memory.Type> extends MemoryBasic<V, number, Type> {
6
+ export declare class MemoryPower<V, Type extends Memory.Type = Memory.Type> extends MemoryBasic<V, number, Type> {
7
7
  constructor(key: Memory.Pitch<V, Type>);
8
8
  }
package/types/once.d.ts CHANGED
@@ -3,5 +3,4 @@
3
3
  * @param callback 运行返回值的函数
4
4
  * @param thisArg 绑定到运行函数的this对象
5
5
  */
6
- declare const _default: <T extends (...args: any) => any>(func: T, thisArg?: any) => (...list: Parameters<T>) => ReturnType<T>;
7
- export default _default;
6
+ export declare const once: <T extends (...args: any) => any>(func: T, thisArg?: any) => (...list: Parameters<T>) => ReturnType<T>;
@@ -5,5 +5,5 @@ type Sort = 'asc' | 'desc';
5
5
  * @param sort 排序方式(默认降序)
6
6
  * @description sum > 2**53则会因为精度问题计算报错
7
7
  */
8
- declare const deconPowersSum: (sum: number, sort?: Sort) => number[];
9
- export default deconPowersSum;
8
+ export declare const deconPowersSum: (sum: number, sort?: Sort) => number[];
9
+ export {};
@@ -5,5 +5,4 @@ import { _Point } from './rad';
5
5
  * @param angle 旋转角度
6
6
  * @param visit 旋转原点
7
7
  */
8
- declare const rotateAngle: (from: _Point, angle: number, visit?: _Point) => _Point;
9
- export default rotateAngle;
8
+ export declare const rotateAngle: (from: _Point, angle: number, visit?: _Point) => _Point;
@@ -5,5 +5,4 @@ export type _Point = [number, number];
5
5
  * @param rad 旋转弧度
6
6
  * @param visit 旋转原点
7
7
  */
8
- declare const rotateRad: (from: _Point, rad: number, visit?: _Point) => _Point;
9
- export default rotateRad;
8
+ export declare const rotateRad: (from: _Point, rad: number, visit?: _Point) => _Point;
@@ -0,0 +1,9 @@
1
+ import { Properties, PropertiesHyphen } from 'csstype';
2
+ export interface CSSProperties extends Properties<string | number>, PropertiesHyphen<string | number> {
3
+ [v: `--${string}`]: string | number | undefined;
4
+ }
5
+ export type StyleValue = false | null | undefined | string | CSSProperties | Array<StyleValue>;
6
+ /**
7
+ * Css合并
8
+ */
9
+ export declare const css: (...args: StyleValue[]) => string;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 用一维的方式存储二维表
3
3
  */
4
- export default class FlexTable<T> {
4
+ export declare class FlexTable<T> {
5
5
  #private;
6
6
  /**
7
7
  * 行数
package/types/union.d.ts CHANGED
@@ -6,7 +6,7 @@ interface Result<Data, Option> {
6
6
  /**
7
7
  * 数据联合(用于需要对加入的数据进行智能提示)
8
8
  */
9
- export default class Union<Primary extends string, Member extends string, Origin extends {
9
+ export declare class Union<Primary extends string, Member extends string, Origin extends {
10
10
  [key in Primary]: string;
11
11
  }, Data extends unknown, Option extends unknown, Status extends Member | never = never> {
12
12
  #private;
@@ -1,5 +1,4 @@
1
1
  /**
2
2
  * 实现多个路径拼接
3
3
  */
4
- declare const joinPaths: (...list: string[]) => string;
5
- export default joinPaths;
4
+ export declare const joinPaths: (...list: string[]) => string;
@@ -7,5 +7,5 @@ type Params = Param | Param[];
7
7
  * @param isOpenType 是否开启类型处理
8
8
  * @description 开始类型处理的情况下,undefined会被转成null
9
9
  */
10
- declare const connectURLParams: (url: string, params?: Record<string, Params>, isOpenType?: boolean) => string;
11
- export default connectURLParams;
10
+ export declare const connectURLParams: (url: string, params?: Record<string, Params>, isOpenType?: boolean) => string;
11
+ export {};
package/types/wait.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  /**
2
2
  * 等待
3
3
  */
4
- declare const _default: (delay?: number) => Promise<void>;
5
- export default _default;
4
+ export declare const wait: (delay?: number) => Promise<void>;