ranuts 0.1.0-alpha.11 → 0.1.0-alpha.13
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/index.d.ts +5 -3
- package/dist/index.js +25 -16
- package/dist/{mimeType-Clvz2Teb.js → mimeType-eRf1TlBb.js} +4 -9
- package/dist/{reactify-C4cesbXi.js → reactify-Z-V9Vblb.js} +3 -8
- package/dist/{ml.js → src/ml/index.js} +19 -24
- package/dist/src/node/body.d.ts +0 -1
- package/dist/src/node/command.d.ts +0 -1
- package/dist/src/node/ctx2req.d.ts +0 -1
- package/dist/src/node/fs.d.ts +0 -2
- package/dist/src/node/index.d.ts +3 -2
- package/dist/src/node/index.js +54 -0
- package/dist/src/node/paresUrl.d.ts +0 -1
- package/dist/src/node/readFile.d.ts +0 -1
- package/dist/src/node/server.d.ts +0 -1
- package/dist/src/node/stream.d.ts +0 -1
- package/dist/src/node/traverse.d.ts +0 -1
- package/dist/src/node/watchFile.d.ts +1 -1
- package/dist/src/node/websocket.d.ts +2 -6
- package/dist/src/node/ws.d.ts +0 -1
- package/dist/src/optimize/index.d.ts +3 -3
- package/dist/src/react/index.js +4 -0
- package/dist/src/utils/behavior.d.ts +1 -1
- package/dist/src/utils/bom.d.ts +7 -7
- package/dist/src/utils/device.d.ts +9 -3
- package/dist/src/utils/dom.d.ts +87 -2
- package/dist/src/utils/img.d.ts +1 -1
- package/dist/src/utils/index.d.ts +8 -4
- package/dist/src/utils/index.js +4021 -0
- package/dist/src/utils/number.d.ts +1 -1
- package/dist/src/utils/obj.d.ts +10 -3
- package/dist/src/utils/storage.d.ts +2 -0
- package/dist/src/utils/subscribe.d.ts +34 -4
- package/dist/src/utils/totp/sha/common.d.ts +151 -0
- package/dist/src/utils/totp/sha/converters.d.ts +88 -0
- package/dist/src/utils/totp/sha/custom_types.d.ts +60 -0
- package/dist/src/utils/totp/sha/primitives_32.d.ts +98 -0
- package/dist/src/utils/totp/sha/primitives_64.d.ts +116 -0
- package/dist/src/utils/totp/sha/sha.d.ts +103 -0
- package/dist/src/utils/totp/sha/sha1.d.ts +18 -0
- package/dist/src/utils/totp/sha/sha256.d.ts +20 -0
- package/dist/src/utils/totp/sha/sha3.d.ts +53 -0
- package/dist/src/utils/totp/sha/sha512.d.ts +21 -0
- package/dist/src/utils/totp/totp.d.ts +23 -0
- package/dist/src/utils/visual/application.d.ts +10 -0
- package/dist/src/utils/visual/demo/index.d.ts +1 -0
- package/dist/src/utils/visual/demo/sankey.d.ts +2 -0
- package/dist/src/utils/visual/enums.d.ts +21 -0
- package/dist/src/utils/visual/event/boundary.d.ts +22 -0
- package/dist/src/utils/visual/event/event.d.ts +14 -0
- package/dist/src/utils/visual/event/index.d.ts +3 -0
- package/dist/src/utils/visual/event/types.d.ts +32 -0
- package/dist/src/utils/visual/graphics/graphics.d.ts +19 -0
- package/dist/src/utils/visual/graphics/graphicsData.d.ts +10 -0
- package/dist/src/utils/visual/graphics/graphicsGeometry.d.ts +10 -0
- package/dist/src/utils/visual/graphics/index.d.ts +3 -0
- package/dist/src/utils/visual/index.d.ts +4 -0
- package/dist/src/utils/visual/math/bezier.d.ts +2 -0
- package/dist/src/utils/visual/math/enums.d.ts +2 -0
- package/dist/src/utils/visual/math/index.d.ts +4 -0
- package/dist/src/utils/visual/math/matrix.d.ts +32 -0
- package/dist/src/utils/visual/math/transform.d.ts +27 -0
- package/dist/src/utils/visual/render/canvasRenderer.d.ts +9 -0
- package/dist/src/utils/visual/render/index.d.ts +3 -0
- package/dist/src/utils/visual/render/render.d.ts +10 -0
- package/dist/src/utils/visual/render/webGlRenderer.d.ts +7 -0
- package/dist/src/utils/visual/shape/circle.d.ts +11 -0
- package/dist/src/utils/visual/shape/ellipse.d.ts +12 -0
- package/dist/src/utils/visual/shape/index.d.ts +5 -0
- package/dist/src/utils/visual/shape/polygon.d.ts +10 -0
- package/dist/src/utils/visual/shape/rectangle.d.ts +12 -0
- package/dist/src/utils/visual/shape/shape.d.ts +7 -0
- package/dist/src/utils/visual/style/fill.d.ts +8 -0
- package/dist/src/utils/visual/style/index.d.ts +2 -0
- package/dist/src/utils/visual/style/line.d.ts +9 -0
- package/dist/src/utils/visual/types.d.ts +6 -0
- package/dist/src/utils/visual/vertex/application.d.ts +13 -0
- package/dist/src/utils/visual/vertex/container.d.ts +38 -0
- package/dist/src/utils/visual/vertex/index.d.ts +4 -0
- package/dist/src/utils/visual/vertex/point.d.ts +18 -0
- package/dist/src/utils/visual/vertex/vertex.d.ts +36 -0
- package/dist/src/vnode/chainDom.d.ts +47 -0
- package/dist/{wasm.js → src/wasm/index.js} +4 -8
- package/dist/test/writeFile.test.d.ts +1 -0
- package/dist/tsconfig.json +1 -0
- package/dist/umd/index.umd.cjs +1 -1
- package/dist/umd/ml/ml.umd.cjs +1 -1
- package/dist/umd/node/node.umd.cjs +1 -1
- package/dist/umd/react/react.umd.cjs +1 -1
- package/dist/umd/utils/utils.umd.cjs +1 -1
- package/dist/{ws-DoSbcWWZ.js → ws-CQA-0Bzm.js} +31 -53
- package/package.json +18 -16
- package/readme.md +6 -2
- package/typings.d.ts +4 -10
- package/dist/node.js +0 -27
- package/dist/react.js +0 -4
- package/dist/utils.js +0 -2092
- /package/dist/test/{server/encodeUrl.test.d.ts → encodeUrl.test.d.ts} +0 -0
- /package/dist/test/{server/escapeHtml.test.d.ts → escapeHtml.test.d.ts} +0 -0
- /package/dist/test/{server/mimeType.test.d.ts → mimeType.test.d.ts} +0 -0
- /package/dist/test/{server/server.test.d.ts → server.test.d.ts} +0 -0
- /package/dist/test/{server/status.test.d.ts → status.test.d.ts} +0 -0
- /package/dist/test/{file/writeFile.test.d.ts → totp.test.d.ts} +0 -0
- /package/dist/test/{server/websocket.test.d.ts → websocket.test.d.ts} +0 -0
package/dist/src/utils/dom.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @description: 给指定的元素添加指定的class
|
|
2
|
+
* @description: 给指定的元素添加指定的 class
|
|
3
3
|
* @param {Element} element
|
|
4
4
|
* @param {string} addClass
|
|
5
5
|
*/
|
|
6
6
|
export declare const addClassToElement: (element: Element, addClass: string) => void;
|
|
7
7
|
/**
|
|
8
|
-
* @description: 给指定的元素移除指定的class
|
|
8
|
+
* @description: 给指定的元素移除指定的 class
|
|
9
9
|
* @param {Element} element
|
|
10
10
|
* @param {string} removeClass
|
|
11
11
|
*/
|
|
@@ -17,3 +17,88 @@ export declare const removeClassToElement: (element: Element, removeClass: strin
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const createDocumentFragment: (list: Element[]) => DocumentFragment | undefined;
|
|
19
19
|
export declare function escapeHtml(string?: string | number | null): string;
|
|
20
|
+
/**
|
|
21
|
+
* @description: 根据 UI 稿宽度设置 rem
|
|
22
|
+
* @param {*} void
|
|
23
|
+
* @return {*}
|
|
24
|
+
*/
|
|
25
|
+
export declare const setFontSize2html: (designWidth?: number) => void;
|
|
26
|
+
/**
|
|
27
|
+
* @description: 链式调用的 dom 操作
|
|
28
|
+
* (tag) (key value) (children)
|
|
29
|
+
* @return {HTMLElement}
|
|
30
|
+
*/
|
|
31
|
+
export declare class Chain {
|
|
32
|
+
listener: Map<string, Map<string, EventListener>>;
|
|
33
|
+
element: HTMLElement;
|
|
34
|
+
constructor(tagName: string, options?: ElementCreationOptions);
|
|
35
|
+
/**
|
|
36
|
+
* @description: 创建元素
|
|
37
|
+
* @param {string} tagName
|
|
38
|
+
* @param {ElementCreationOptions} options
|
|
39
|
+
* @return {Chain}
|
|
40
|
+
*/
|
|
41
|
+
create: (tagName: string, options?: ElementCreationOptions) => HTMLElement;
|
|
42
|
+
/**
|
|
43
|
+
* @description: 设置当前元素的属性
|
|
44
|
+
* @param {string} name
|
|
45
|
+
* @param {string} value
|
|
46
|
+
* @return {Chain}
|
|
47
|
+
*/
|
|
48
|
+
setAttribute: (name: string, value: string) => Chain;
|
|
49
|
+
/**
|
|
50
|
+
* @description: 移除当前元素的属性
|
|
51
|
+
* @param {string} name
|
|
52
|
+
* @return {Chain}
|
|
53
|
+
*/
|
|
54
|
+
removeAttribute: (name: string) => Chain;
|
|
55
|
+
/**
|
|
56
|
+
* @description: 当前元素添加子元素
|
|
57
|
+
* @param {HTMLElement} child
|
|
58
|
+
* @return {ChainElement}
|
|
59
|
+
*/
|
|
60
|
+
append: (child: HTMLElement) => Chain;
|
|
61
|
+
/**
|
|
62
|
+
* @description: 当前元素移除子元素
|
|
63
|
+
* @param {HTMLElement} child
|
|
64
|
+
* @return {Chain}
|
|
65
|
+
*/
|
|
66
|
+
remove: (child: HTMLElement) => Chain;
|
|
67
|
+
/**
|
|
68
|
+
* @description: 给当前元素设置文本内容
|
|
69
|
+
* @param {string} text
|
|
70
|
+
* @return {Chain}
|
|
71
|
+
*/
|
|
72
|
+
setTextContent: (text: string) => Chain;
|
|
73
|
+
/**
|
|
74
|
+
* @description: 给当前元素设置样式
|
|
75
|
+
* @param {string} name
|
|
76
|
+
* @param {string} value
|
|
77
|
+
* @return {Chain}
|
|
78
|
+
*/
|
|
79
|
+
setStyle: (name: string, value: string) => Chain;
|
|
80
|
+
/**
|
|
81
|
+
* @description: 给当前元素添加子元素
|
|
82
|
+
* @return {Chain}
|
|
83
|
+
*/
|
|
84
|
+
addChild: (child: Chain | Chain[]) => Chain;
|
|
85
|
+
/**
|
|
86
|
+
* @description: 给当前元素添加事件监听
|
|
87
|
+
* @param {string} type
|
|
88
|
+
* @param {EventListener} listener
|
|
89
|
+
* @return {Chain}
|
|
90
|
+
*/
|
|
91
|
+
listen: <K extends keyof HTMLElementEventMap>(type: K, listener: EventListener, options?: boolean | AddEventListenerOptions) => Chain;
|
|
92
|
+
/**
|
|
93
|
+
* @description: 移除当前元素的事件监听
|
|
94
|
+
* @param {string} type
|
|
95
|
+
* @return {Chain}
|
|
96
|
+
*/
|
|
97
|
+
clearListener: <K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions) => Chain;
|
|
98
|
+
/**
|
|
99
|
+
* @description: 移除当前元素的所有事件监听
|
|
100
|
+
* @return {Chain}
|
|
101
|
+
*/
|
|
102
|
+
clearAllListener: () => Chain;
|
|
103
|
+
}
|
|
104
|
+
export declare const create: (tagName: string, options?: ElementCreationOptions) => Chain;
|
package/dist/src/utils/img.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { AudioRecorder } from '@/utils/audioRecorder';
|
|
2
2
|
import { audioVendor, canvasVendor, webglVendor } from '@/utils/behavior';
|
|
3
|
+
import { TOTP } from '@/utils/totp/totp';
|
|
4
|
+
import { localStorageGetItem, localStorageSetItem } from '@/utils/storage';
|
|
3
5
|
import { appendUrl, connection, createObjectURL, durationHandler, encodeUrl, getAllQueryString, getCookie, getCookieByName, getFrame, getHost, getPixelRatio, getWindow, imageRequest, networkSpeed, removeGhosting, requestUrlToBuffer, retain } from '@/utils/bom';
|
|
4
6
|
import { Color, ColorScheme, FMT, Hsl, Hsla, Rgb, Rgba, componentToHex, hexToRgb, hsbToRgb, hslToRgb, hsvToHsl, hsvToRgb, hue2rgb, randomColor, rgbToHex, rgbToHsb, rgbToHsl } from '@/utils/color';
|
|
5
7
|
import { compose } from '@/utils/compose';
|
|
6
8
|
import { handleConsole } from '@/utils/console';
|
|
7
9
|
import { debounce } from '@/utils/debounce';
|
|
8
|
-
import { currentDevice, isClient, isMobile, isWeiXin } from '@/utils/device';
|
|
9
|
-
import {
|
|
10
|
+
import { currentDevice, isBangDevice, isClient, isMobile, isWeiXin } from '@/utils/device';
|
|
11
|
+
import type { CurrentDevice } from '@/utils/device';
|
|
12
|
+
import { Chain, addClassToElement, create, createDocumentFragment, escapeHtml, removeClassToElement, setFontSize2html } from '@/utils/dom';
|
|
10
13
|
import { handleError } from '@/utils/error';
|
|
11
14
|
import { convertImageToBase64, isImageSize } from '@/utils/img';
|
|
12
15
|
import { memoize } from '@/utils/memoize';
|
|
@@ -15,7 +18,7 @@ import { Monitor } from '@/utils/monitor';
|
|
|
15
18
|
import { getStatus, status } from '@/utils/network';
|
|
16
19
|
import { noop } from '@/utils/noop';
|
|
17
20
|
import { Mathjs, mathjs, perToNum, range } from '@/utils/number';
|
|
18
|
-
import { filterObj, formatJson, merge, mergeExports, querystring, replaceOld } from '@/utils/obj';
|
|
21
|
+
import { filterObj, formatJson, merge, mergeExports, querystring, replaceOld, setAttributeByGlobal } from '@/utils/obj';
|
|
19
22
|
import { getPerformance } from '@/utils/performance';
|
|
20
23
|
import { QuestQueue } from '@/utils/queue';
|
|
21
24
|
import { createData, report } from '@/utils/report';
|
|
@@ -25,4 +28,5 @@ import { changeHumpToLowerCase, clearBr, clearStr, isString, randomString, str2X
|
|
|
25
28
|
import { SyncHook } from '@/utils/subscribe';
|
|
26
29
|
import { generateThrottle, requestAnimation, throttle } from '@/utils/throttle';
|
|
27
30
|
import { performanceTime, timeFormat, timestampToTime } from '@/utils/time';
|
|
28
|
-
export { performanceTime, timeFormat, timestampToTime, generateThrottle, requestAnimation, throttle, SyncHook, changeHumpToLowerCase, clearBr, clearStr, isString, randomString, str2Xml, strParse, scriptOnLoad, handleFetchHook, createData, report, QuestQueue, noop, getPerformance, querystring, formatJson, filterObj, merge, replaceOld, mergeExports, perToNum, range, Mathjs, mathjs, getStatus, status, Monitor, MimeType, setMime, getMime, memoize, isImageSize, convertImageToBase64, handleError, addClassToElement, removeClassToElement, createDocumentFragment, escapeHtml, isClient, isWeiXin, isMobile, debounce, currentDevice, handleConsole, compose, Color, FMT, Hsl, Hsla, Rgb, Rgba, randomColor, hexToRgb, componentToHex, rgbToHex, rgbToHsl, hue2rgb, hslToRgb, rgbToHsb, hsbToRgb, hsvToRgb, hsvToHsl, ColorScheme, AudioRecorder, webglVendor, canvasVendor, audioVendor, retain, getCookie, requestUrlToBuffer, getPixelRatio, createObjectURL, getFrame, getHost, getAllQueryString, appendUrl, removeGhosting, getCookieByName, getWindow, connection, encodeUrl, imageRequest, durationHandler, networkSpeed, };
|
|
31
|
+
export { performanceTime, timeFormat, timestampToTime, generateThrottle, requestAnimation, throttle, SyncHook, changeHumpToLowerCase, clearBr, clearStr, isString, randomString, str2Xml, strParse, scriptOnLoad, handleFetchHook, createData, report, QuestQueue, noop, getPerformance, querystring, formatJson, filterObj, merge, replaceOld, mergeExports, perToNum, range, Mathjs, mathjs, getStatus, status, Monitor, MimeType, setMime, getMime, memoize, isImageSize, convertImageToBase64, handleError, addClassToElement, removeClassToElement, createDocumentFragment, escapeHtml, isClient, isWeiXin, isMobile, debounce, currentDevice, handleConsole, compose, Color, FMT, Hsl, Hsla, Rgb, Rgba, randomColor, hexToRgb, componentToHex, rgbToHex, rgbToHsl, hue2rgb, hslToRgb, rgbToHsb, hsbToRgb, hsvToRgb, hsvToHsl, ColorScheme, AudioRecorder, webglVendor, canvasVendor, audioVendor, retain, getCookie, requestUrlToBuffer, getPixelRatio, createObjectURL, getFrame, getHost, getAllQueryString, appendUrl, removeGhosting, getCookieByName, getWindow, connection, encodeUrl, imageRequest, durationHandler, networkSpeed, TOTP, isBangDevice, localStorageGetItem, localStorageSetItem, setAttributeByGlobal, setFontSize2html, Chain, create, };
|
|
32
|
+
export type { CurrentDevice };
|