a2bei4-utils 1.0.9 → 1.0.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.
- package/dist/a2bei4.utils.cjs.js +193 -2
- package/dist/a2bei4.utils.cjs.js.map +1 -1
- package/dist/a2bei4.utils.cjs.min.js +1 -1
- package/dist/a2bei4.utils.cjs.min.js.map +1 -1
- package/dist/a2bei4.utils.esm.js +191 -2
- package/dist/a2bei4.utils.esm.js.map +1 -1
- package/dist/a2bei4.utils.esm.min.js +1 -1
- package/dist/a2bei4.utils.esm.min.js.map +1 -1
- package/dist/a2bei4.utils.umd.js +193 -2
- package/dist/a2bei4.utils.umd.js.map +1 -1
- package/dist/a2bei4.utils.umd.min.js +1 -1
- package/dist/a2bei4.utils.umd.min.js.map +1 -1
- package/dist/arr.cjs.map +1 -1
- package/dist/arr.js.map +1 -1
- package/dist/audio.cjs.map +1 -1
- package/dist/audio.js.map +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/common.cjs.map +1 -1
- package/dist/common.js.map +1 -1
- package/dist/date.cjs.map +1 -1
- package/dist/date.js.map +1 -1
- package/dist/download.cjs.map +1 -1
- package/dist/download.js.map +1 -1
- package/dist/evt.cjs.map +1 -1
- package/dist/evt.js.map +1 -1
- package/dist/id.cjs.map +1 -1
- package/dist/id.js.map +1 -1
- package/dist/menu.cjs.map +1 -1
- package/dist/menu.js.map +1 -1
- package/dist/timer.cjs +14 -0
- package/dist/timer.cjs.map +1 -1
- package/dist/timer.js +14 -0
- package/dist/timer.js.map +1 -1
- package/dist/tree.cjs +177 -0
- package/dist/tree.cjs.map +1 -1
- package/dist/tree.js +176 -1
- package/dist/tree.js.map +1 -1
- package/dist/webSocket.cjs.map +1 -1
- package/dist/webSocket.js.map +1 -1
- package/package.json +5 -5
- package/types/index.d.ts +186 -2
- package/types/timer.d.ts +4 -0
- package/types/tree.d.ts +182 -1
package/types/index.d.ts
CHANGED
|
@@ -74,6 +74,10 @@ declare class IntervalTimer {
|
|
|
74
74
|
_fn: () => void;
|
|
75
75
|
_ms: number;
|
|
76
76
|
_timerId: number | null;
|
|
77
|
+
/**
|
|
78
|
+
* @type {symbol | null}
|
|
79
|
+
*/
|
|
80
|
+
_loopId: symbol | null;
|
|
77
81
|
/**
|
|
78
82
|
* 启动定时器;若已启动则先停止再重新启动。
|
|
79
83
|
* 首次执行会立即触发。
|
|
@@ -356,7 +360,7 @@ type ViewportDimensions = {
|
|
|
356
360
|
* @param {*} obj 待检测的值
|
|
357
361
|
* @returns {keyof globalThis|"blob"|"file"|"formdata"|string} 小写类型名
|
|
358
362
|
*/
|
|
359
|
-
declare function getDataType(obj: any): ("undefined" | "ArrayBuffer" | "SharedArrayBuffer" | "length" | "toString" | "globalThis" | "eval" | "parseInt" | "parseFloat" | "isNaN" | "isFinite" | "decodeURI" | "decodeURIComponent" | "encodeURI" | "encodeURIComponent" | "escape" | "unescape" | "NaN" | "Infinity" | "Symbol" | "Object" | "Function" | "String" | "Boolean" | "Number" | "Math" | "Date" | "RegExp" | "Error" | "EvalError" | "RangeError" | "ReferenceError" | "SyntaxError" | "TypeError" | "URIError" | "JSON" | "Array" | "Promise" | "DataView" | "Int8Array" | "Uint8Array" | "Uint8ClampedArray" | "Int16Array" | "Uint16Array" | "Int32Array" | "Uint32Array" | "Float32Array" | "Float64Array" | "Intl" | "alert" | "blur" | "cancelIdleCallback" | "captureEvents" | "close" | "confirm" | "focus" | "getComputedStyle" | "getSelection" | "matchMedia" | "moveBy" | "moveTo" | "open" | "postMessage" | "print" | "prompt" | "releaseEvents" | "requestIdleCallback" | "resizeBy" | "resizeTo" | "scroll" | "scrollBy" | "scrollTo" | "stop" | "dispatchEvent" | "cancelAnimationFrame" | "requestAnimationFrame" | "atob" | "btoa" | "clearInterval" | "clearTimeout" | "createImageBitmap" | "fetch" | "queueMicrotask" | "reportError" | "setInterval" | "setTimeout" | "structuredClone" | "addEventListener" | "removeEventListener" | "NodeFilter" | "AbortController" | "AbortSignal" | "AbstractRange" | "AnalyserNode" | "Animation" | "AnimationEffect" | "AnimationEvent" | "AnimationPlaybackEvent" | "AnimationTimeline" | "Attr" | "AudioBuffer" | "AudioBufferSourceNode" | "AudioContext" | "AudioData" | "AudioDecoder" | "AudioDestinationNode" | "AudioEncoder" | "AudioListener" | "AudioNode" | "AudioParam" | "AudioParamMap" | "AudioProcessingEvent" | "AudioScheduledSourceNode" | "AudioWorklet" | "AudioWorkletNode" | "AuthenticatorAssertionResponse" | "AuthenticatorAttestationResponse" | "AuthenticatorResponse" | "BarProp" | "BaseAudioContext" | "BeforeUnloadEvent" | "BiquadFilterNode" | "Blob" | "BlobEvent" | "BroadcastChannel" | "ByteLengthQueuingStrategy" | "CDATASection" | "CSPViolationReportBody" | "CSSAnimation" | "CSSConditionRule" | "CSSContainerRule" | "CSSCounterStyleRule" | "CSSFontFaceRule" | "CSSFontFeatureValuesRule" | "CSSFontPaletteValuesRule" | "CSSGroupingRule" | "CSSImageValue" | "CSSImportRule" | "CSSKeyframeRule" | "CSSKeyframesRule" | "CSSKeywordValue" | "CSSLayerBlockRule" | "CSSLayerStatementRule" | "CSSMathClamp" | "CSSMathInvert" | "CSSMathMax" | "CSSMathMin" | "CSSMathNegate" | "CSSMathProduct" | "CSSMathSum" | "CSSMathValue" | "CSSMatrixComponent" | "CSSMediaRule" | "CSSNamespaceRule" | "CSSNestedDeclarations" | "CSSNumericArray" | "CSSNumericValue" | "CSSPageRule" | "CSSPerspective" | "CSSPropertyRule" | "CSSRotate" | "CSSRule" | "CSSRuleList" | "CSSScale" | "CSSScopeRule" | "CSSSkew" | "CSSSkewX" | "CSSSkewY" | "CSSStartingStyleRule" | "CSSStyleDeclaration" | "CSSStyleRule" | "CSSStyleSheet" | "CSSStyleValue" | "CSSSupportsRule" | "CSSTransformComponent" | "CSSTransformValue" | "CSSTransition" | "CSSTranslate" | "CSSUnitValue" | "CSSUnparsedValue" | "CSSVariableReferenceValue" | "CSSViewTransitionRule" | "Cache" | "CacheStorage" | "CanvasCaptureMediaStreamTrack" | "CanvasGradient" | "CanvasPattern" | "CanvasRenderingContext2D" | "CaretPosition" | "ChannelMergerNode" | "ChannelSplitterNode" | "CharacterData" | "Clipboard" | "ClipboardEvent" | "ClipboardItem" | "CloseEvent" | "Comment" | "CompositionEvent" | "CompressionStream" | "ConstantSourceNode" | "ContentVisibilityAutoStateChangeEvent" | "ConvolverNode" | "CookieChangeEvent" | "CookieStore" | "CookieStoreManager" | "CountQueuingStrategy" | "Credential" | "CredentialsContainer" | "Crypto" | "CryptoKey" | "CustomElementRegistry" | "CustomEvent" | "CustomStateSet" | "DOMException" | "DOMImplementation" | "DOMMatrix" | "SVGMatrix" | "WebKitCSSMatrix" | "DOMMatrixReadOnly" | "DOMParser" | "DOMPoint" | "SVGPoint" | "DOMPointReadOnly" | "DOMQuad" | "DOMRect" | "SVGRect" | "DOMRectList" | "DOMRectReadOnly" | "DOMStringList" | "DOMStringMap" | "DOMTokenList" | "DataTransfer" | "DataTransferItem" | "DataTransferItemList" | "DecompressionStream" | "DelayNode" | "DeviceMotionEvent" | "DeviceOrientationEvent" | "Document" | "DocumentFragment" | "DocumentTimeline" | "DocumentType" | "DragEvent" | "DynamicsCompressorNode" | "Element" | "ElementInternals" | "EncodedAudioChunk" | "EncodedVideoChunk" | "ErrorEvent" | "Event" | "EventCounts" | "EventSource" | "EventTarget" | "External" | "File" | "FileList" | "FileReader" | "FileSystem" | "FileSystemDirectoryEntry" | "FileSystemDirectoryHandle" | "FileSystemDirectoryReader" | "FileSystemEntry" | "FileSystemFileEntry" | "FileSystemFileHandle" | "FileSystemHandle" | "FileSystemWritableFileStream" | "FocusEvent" | "FontFace" | "FontFaceSet" | "FontFaceSetLoadEvent" | "FormData" | "FormDataEvent" | "FragmentDirective" | "GainNode" | "Gamepad" | "GamepadButton" | "GamepadEvent" | "GamepadHapticActuator" | "Geolocation" | "GeolocationCoordinates" | "GeolocationPosition" | "GeolocationPositionError" | "HTMLAllCollection" | "HTMLAnchorElement" | "HTMLAreaElement" | "HTMLAudioElement" | "HTMLBRElement" | "HTMLBaseElement" | "HTMLBodyElement" | "HTMLButtonElement" | "HTMLCanvasElement" | "HTMLCollection" | "HTMLDListElement" | "HTMLDataElement" | "HTMLDataListElement" | "HTMLDetailsElement" | "HTMLDialogElement" | "HTMLDirectoryElement" | "HTMLDivElement" | "HTMLDocument" | "HTMLElement" | "HTMLEmbedElement" | "HTMLFieldSetElement" | "HTMLFontElement" | "HTMLFormControlsCollection" | "HTMLFormElement" | "HTMLFrameElement" | "HTMLFrameSetElement" | "HTMLHRElement" | "HTMLHeadElement" | "HTMLHeadingElement" | "HTMLHtmlElement" | "HTMLIFrameElement" | "HTMLImageElement" | "HTMLInputElement" | "HTMLLIElement" | "HTMLLabelElement" | "HTMLLegendElement" | "HTMLLinkElement" | "HTMLMapElement" | "HTMLMarqueeElement" | "HTMLMediaElement" | "HTMLMenuElement" | "HTMLMetaElement" | "HTMLMeterElement" | "HTMLModElement" | "HTMLOListElement" | "HTMLObjectElement" | "HTMLOptGroupElement" | "HTMLOptionElement" | "HTMLOptionsCollection" | "HTMLOutputElement" | "HTMLParagraphElement" | "HTMLParamElement" | "HTMLPictureElement" | "HTMLPreElement" | "HTMLProgressElement" | "HTMLQuoteElement" | "HTMLScriptElement" | "HTMLSelectElement" | "HTMLSlotElement" | "HTMLSourceElement" | "HTMLSpanElement" | "HTMLStyleElement" | "HTMLTableCaptionElement" | "HTMLTableCellElement" | "HTMLTableColElement" | "HTMLTableElement" | "HTMLTableRowElement" | "HTMLTableSectionElement" | "HTMLTemplateElement" | "HTMLTextAreaElement" | "HTMLTimeElement" | "HTMLTitleElement" | "HTMLTrackElement" | "HTMLUListElement" | "HTMLUnknownElement" | "HTMLVideoElement" | "HashChangeEvent" | "Headers" | "Highlight" | "HighlightRegistry" | "History" | "IDBCursor" | "IDBCursorWithValue" | "IDBDatabase" | "IDBFactory" | "IDBIndex" | "IDBKeyRange" | "IDBObjectStore" | "IDBOpenDBRequest" | "IDBRequest" | "IDBTransaction" | "IDBVersionChangeEvent" | "IIRFilterNode" | "IdleDeadline" | "ImageBitmap" | "ImageBitmapRenderingContext" | "ImageCapture" | "ImageData" | "ImageDecoder" | "ImageTrack" | "ImageTrackList" | "InputDeviceInfo" | "InputEvent" | "IntersectionObserver" | "IntersectionObserverEntry" | "KeyboardEvent" | "KeyframeEffect" | "LargestContentfulPaint" | "Location" | "Lock" | "LockManager" | "MIDIAccess" | "MIDIConnectionEvent" | "MIDIInput" | "MIDIInputMap" | "MIDIMessageEvent" | "MIDIOutput" | "MIDIOutputMap" | "MIDIPort" | "MathMLElement" | "MediaCapabilities" | "MediaDeviceInfo" | "MediaDevices" | "MediaElementAudioSourceNode" | "MediaEncryptedEvent" | "MediaError" | "MediaKeyMessageEvent" | "MediaKeySession" | "MediaKeyStatusMap" | "MediaKeySystemAccess" | "MediaKeys" | "MediaList" | "MediaMetadata" | "MediaQueryList" | "MediaQueryListEvent" | "MediaRecorder" | "MediaSession" | "MediaSource" | "MediaSourceHandle" | "MediaStream" | "MediaStreamAudioDestinationNode" | "MediaStreamAudioSourceNode" | "MediaStreamTrack" | "MediaStreamTrackEvent" | "MessageChannel" | "MessageEvent" | "MessagePort" | "MimeType" | "MimeTypeArray" | "MouseEvent" | "MutationObserver" | "MutationRecord" | "NamedNodeMap" | "NavigationActivation" | "NavigationHistoryEntry" | "NavigationPreloadManager" | "Navigator" | "NavigatorLogin" | "Node" | "NodeIterator" | "NodeList" | "Notification" | "OfflineAudioCompletionEvent" | "OfflineAudioContext" | "OffscreenCanvas" | "OffscreenCanvasRenderingContext2D" | "OscillatorNode" | "OverconstrainedError" | "PageRevealEvent" | "PageSwapEvent" | "PageTransitionEvent" | "PannerNode" | "Path2D" | "PaymentAddress" | "PaymentMethodChangeEvent" | "PaymentRequest" | "PaymentRequestUpdateEvent" | "PaymentResponse" | "Performance" | "PerformanceEntry" | "PerformanceEventTiming" | "PerformanceMark" | "PerformanceMeasure" | "PerformanceNavigation" | "PerformanceNavigationTiming" | "PerformanceObserver" | "PerformanceObserverEntryList" | "PerformancePaintTiming" | "PerformanceResourceTiming" | "PerformanceServerTiming" | "PerformanceTiming" | "PeriodicWave" | "PermissionStatus" | "Permissions" | "PictureInPictureEvent" | "PictureInPictureWindow" | "Plugin" | "PluginArray" | "PointerEvent" | "PopStateEvent" | "ProcessingInstruction" | "ProgressEvent" | "PromiseRejectionEvent" | "PublicKeyCredential" | "PushManager" | "PushSubscription" | "PushSubscriptionOptions" | "RTCCertificate" | "RTCDTMFSender" | "RTCDTMFToneChangeEvent" | "RTCDataChannel" | "RTCDataChannelEvent" | "RTCDtlsTransport" | "RTCEncodedAudioFrame" | "RTCEncodedVideoFrame" | "RTCError" | "RTCErrorEvent" | "RTCIceCandidate" | "RTCIceTransport" | "RTCPeerConnection" | "RTCPeerConnectionIceErrorEvent" | "RTCPeerConnectionIceEvent" | "RTCRtpReceiver" | "RTCRtpScriptTransform" | "RTCRtpSender" | "RTCRtpTransceiver" | "RTCSctpTransport" | "RTCSessionDescription" | "RTCStatsReport" | "RTCTrackEvent" | "RadioNodeList" | "Range" | "ReadableByteStreamController" | "ReadableStream" | "ReadableStreamBYOBReader" | "ReadableStreamBYOBRequest" | "ReadableStreamDefaultController" | "ReadableStreamDefaultReader" | "RemotePlayback" | "Report" | "ReportBody" | "ReportingObserver" | "Request" | "ResizeObserver" | "ResizeObserverEntry" | "ResizeObserverSize" | "Response" | "SVGAElement" | "SVGAngle" | "SVGAnimateElement" | "SVGAnimateMotionElement" | "SVGAnimateTransformElement" | "SVGAnimatedAngle" | "SVGAnimatedBoolean" | "SVGAnimatedEnumeration" | "SVGAnimatedInteger" | "SVGAnimatedLength" | "SVGAnimatedLengthList" | "SVGAnimatedNumber" | "SVGAnimatedNumberList" | "SVGAnimatedPreserveAspectRatio" | "SVGAnimatedRect" | "SVGAnimatedString" | "SVGAnimatedTransformList" | "SVGAnimationElement" | "SVGCircleElement" | "SVGClipPathElement" | "SVGComponentTransferFunctionElement" | "SVGDefsElement" | "SVGDescElement" | "SVGElement" | "SVGEllipseElement" | "SVGFEBlendElement" | "SVGFEColorMatrixElement" | "SVGFEComponentTransferElement" | "SVGFECompositeElement" | "SVGFEConvolveMatrixElement" | "SVGFEDiffuseLightingElement" | "SVGFEDisplacementMapElement" | "SVGFEDistantLightElement" | "SVGFEDropShadowElement" | "SVGFEFloodElement" | "SVGFEFuncAElement" | "SVGFEFuncBElement" | "SVGFEFuncGElement" | "SVGFEFuncRElement" | "SVGFEGaussianBlurElement" | "SVGFEImageElement" | "SVGFEMergeElement" | "SVGFEMergeNodeElement" | "SVGFEMorphologyElement" | "SVGFEOffsetElement" | "SVGFEPointLightElement" | "SVGFESpecularLightingElement" | "SVGFESpotLightElement" | "SVGFETileElement" | "SVGFETurbulenceElement" | "SVGFilterElement" | "SVGForeignObjectElement" | "SVGGElement" | "SVGGeometryElement" | "SVGGradientElement" | "SVGGraphicsElement" | "SVGImageElement" | "SVGLength" | "SVGLengthList" | "SVGLineElement" | "SVGLinearGradientElement" | "SVGMPathElement" | "SVGMarkerElement" | "SVGMaskElement" | "SVGMetadataElement" | "SVGNumber" | "SVGNumberList" | "SVGPathElement" | "SVGPatternElement" | "SVGPointList" | "SVGPolygonElement" | "SVGPolylineElement" | "SVGPreserveAspectRatio" | "SVGRadialGradientElement" | "SVGRectElement" | "SVGSVGElement" | "SVGScriptElement" | "SVGSetElement" | "SVGStopElement" | "SVGStringList" | "SVGStyleElement" | "SVGSwitchElement" | "SVGSymbolElement" | "SVGTSpanElement" | "SVGTextContentElement" | "SVGTextElement" | "SVGTextPathElement" | "SVGTextPositioningElement" | "SVGTitleElement" | "SVGTransform" | "SVGTransformList" | "SVGUnitTypes" | "SVGUseElement" | "SVGViewElement" | "Screen" | "ScreenOrientation" | "ScriptProcessorNode" | "SecurityPolicyViolationEvent" | "Selection" | "ServiceWorker" | "ServiceWorkerContainer" | "ServiceWorkerRegistration" | "ShadowRoot" | "SharedWorker" | "SourceBuffer" | "SourceBufferList" | "SpeechRecognitionAlternative" | "SpeechRecognitionResult" | "SpeechRecognitionResultList" | "SpeechSynthesis" | "SpeechSynthesisErrorEvent" | "SpeechSynthesisEvent" | "SpeechSynthesisUtterance" | "SpeechSynthesisVoice" | "StaticRange" | "StereoPannerNode" | "Storage" | "StorageEvent" | "StorageManager" | "StylePropertyMap" | "StylePropertyMapReadOnly" | "StyleSheet" | "StyleSheetList" | "SubmitEvent" | "SubtleCrypto" | "Text" | "TextDecoder" | "TextDecoderStream" | "TextEncoder" | "TextEncoderStream" | "TextEvent" | "TextMetrics" | "TextTrack" | "TextTrackCue" | "TextTrackCueList" | "TextTrackList" | "TimeRanges" | "ToggleEvent" | "Touch" | "TouchEvent" | "TouchList" | "TrackEvent" | "TransformStream" | "TransformStreamDefaultController" | "TransitionEvent" | "TreeWalker" | "UIEvent" | "URL" | "webkitURL" | "URLSearchParams" | "UserActivation" | "VTTCue" | "VTTRegion" | "ValidityState" | "VideoColorSpace" | "VideoDecoder" | "VideoEncoder" | "VideoFrame" | "VideoPlaybackQuality" | "ViewTransition" | "ViewTransitionTypeSet" | "VisualViewport" | "WakeLock" | "WakeLockSentinel" | "WaveShaperNode" | "WebGL2RenderingContext" | "WebGLActiveInfo" | "WebGLBuffer" | "WebGLContextEvent" | "WebGLFramebuffer" | "WebGLProgram" | "WebGLQuery" | "WebGLRenderbuffer" | "WebGLRenderingContext" | "WebGLSampler" | "WebGLShader" | "WebGLShaderPrecisionFormat" | "WebGLSync" | "WebGLTexture" | "WebGLTransformFeedback" | "WebGLUniformLocation" | "WebGLVertexArrayObject" | "WebSocket" | "WebTransport" | "WebTransportBidirectionalStream" | "WebTransportDatagramDuplexStream" | "WebTransportError" | "WheelEvent" | "Window" | "Worker" | "Worklet" | "WritableStream" | "WritableStreamDefaultController" | "WritableStreamDefaultWriter" | "XMLDocument" | "XMLHttpRequest" | "XMLHttpRequestEventTarget" | "XMLHttpRequestUpload" | "XMLSerializer" | "XPathEvaluator" | "XPathExpression" | "XPathResult" | "XSLTProcessor" | "CSS" | "WebAssembly" | "console" | "Audio" | "Image" | "Option" | "clientInformation" | "closed" | "cookieStore" | "customElements" | "devicePixelRatio" | "document" | "event" | "external" | "frameElement" | "frames" | "history" | "innerHeight" | "innerWidth" | "location" | "locationbar" | "menubar" | "navigator" | "ondevicemotion" | "ondeviceorientation" | "ondeviceorientationabsolute" | "onorientationchange" | "opener" | "orientation" | "originAgentCluster" | "outerHeight" | "outerWidth" | "pageXOffset" | "pageYOffset" | "parent" | "personalbar" | "screen" | "screenLeft" | "screenTop" | "screenX" | "screenY" | "scrollX" | "scrollY" | "scrollbars" | "self" | "speechSynthesis" | "status" | "statusbar" | "toolbar" | "top" | "visualViewport" | "window" | "onabort" | "onanimationcancel" | "onanimationend" | "onanimationiteration" | "onanimationstart" | "onauxclick" | "onbeforeinput" | "onbeforematch" | "onbeforetoggle" | "onblur" | "oncancel" | "oncanplay" | "oncanplaythrough" | "onchange" | "onclick" | "onclose" | "oncontextlost" | "oncontextmenu" | "oncontextrestored" | "oncopy" | "oncuechange" | "oncut" | "ondblclick" | "ondrag" | "ondragend" | "ondragenter" | "ondragleave" | "ondragover" | "ondragstart" | "ondrop" | "ondurationchange" | "onemptied" | "onended" | "onerror" | "onfocus" | "onformdata" | "ongotpointercapture" | "oninput" | "oninvalid" | "onkeydown" | "onkeypress" | "onkeyup" | "onload" | "onloadeddata" | "onloadedmetadata" | "onloadstart" | "onlostpointercapture" | "onmousedown" | "onmouseenter" | "onmouseleave" | "onmousemove" | "onmouseout" | "onmouseover" | "onmouseup" | "onpaste" | "onpause" | "onplay" | "onplaying" | "onpointercancel" | "onpointerdown" | "onpointerenter" | "onpointerleave" | "onpointermove" | "onpointerout" | "onpointerover" | "onpointerrawupdate" | "onpointerup" | "onprogress" | "onratechange" | "onreset" | "onresize" | "onscroll" | "onscrollend" | "onsecuritypolicyviolation" | "onseeked" | "onseeking" | "onselect" | "onselectionchange" | "onselectstart" | "onslotchange" | "onstalled" | "onsubmit" | "onsuspend" | "ontimeupdate" | "ontoggle" | "ontouchcancel" | "ontouchend" | "ontouchmove" | "ontouchstart" | "ontransitioncancel" | "ontransitionend" | "ontransitionrun" | "ontransitionstart" | "onvolumechange" | "onwaiting" | "onwebkitanimationend" | "onwebkitanimationiteration" | "onwebkitanimationstart" | "onwebkittransitionend" | "onwheel" | "onafterprint" | "onbeforeprint" | "onbeforeunload" | "ongamepadconnected" | "ongamepaddisconnected" | "onhashchange" | "onlanguagechange" | "onmessage" | "onmessageerror" | "onoffline" | "ononline" | "onpagehide" | "onpagereveal" | "onpageshow" | "onpageswap" | "onpopstate" | "onrejectionhandled" | "onstorage" | "onunhandledrejection" | "onunload" | "localStorage" | "caches" | "crossOriginIsolated" | "crypto" | "indexedDB" | "isSecureContext" | "origin" | "performance" | "sessionStorage" | "importScripts" | "ActiveXObject" | "WScript" | "WSH" | "Enumerator" | "VBArray" | "Map" | "WeakMap" | "Set" | "WeakSet" | "Iterator" | "Proxy" | "Reflect" | "Atomics" | "BigInt" | "BigInt64Array" | "BigUint64Array" | "AggregateError" | "WeakRef" | "FinalizationRegistry" | "SuppressedError" | "DisposableStack" | "AsyncDisposableStack" | "Float16Array") | "blob" | "file" | "formdata" | string;
|
|
363
|
+
declare function getDataType(obj: any): ("undefined" | "length" | "toString" | "globalThis" | "eval" | "parseInt" | "parseFloat" | "isNaN" | "isFinite" | "decodeURI" | "decodeURIComponent" | "encodeURI" | "encodeURIComponent" | "escape" | "unescape" | "NaN" | "Infinity" | "Symbol" | "Object" | "Function" | "String" | "Boolean" | "Number" | "Math" | "Date" | "RegExp" | "Error" | "EvalError" | "RangeError" | "ReferenceError" | "SyntaxError" | "TypeError" | "URIError" | "JSON" | "Array" | "Promise" | "ArrayBuffer" | "DataView" | "Int8Array" | "Uint8Array" | "Uint8ClampedArray" | "Int16Array" | "Uint16Array" | "Int32Array" | "Uint32Array" | "Float32Array" | "Float64Array" | "Intl" | "alert" | "blur" | "cancelIdleCallback" | "captureEvents" | "close" | "confirm" | "focus" | "getComputedStyle" | "getSelection" | "matchMedia" | "moveBy" | "moveTo" | "open" | "postMessage" | "print" | "prompt" | "releaseEvents" | "requestIdleCallback" | "resizeBy" | "resizeTo" | "scroll" | "scrollBy" | "scrollTo" | "stop" | "dispatchEvent" | "cancelAnimationFrame" | "requestAnimationFrame" | "atob" | "btoa" | "clearInterval" | "clearTimeout" | "createImageBitmap" | "fetch" | "queueMicrotask" | "reportError" | "setInterval" | "setTimeout" | "structuredClone" | "addEventListener" | "removeEventListener" | "NodeFilter" | "AbortController" | "AbortSignal" | "AbstractRange" | "AnalyserNode" | "Animation" | "AnimationEffect" | "AnimationEvent" | "AnimationPlaybackEvent" | "AnimationTimeline" | "Attr" | "AudioBuffer" | "AudioBufferSourceNode" | "AudioContext" | "AudioData" | "AudioDecoder" | "AudioDestinationNode" | "AudioEncoder" | "AudioListener" | "AudioNode" | "AudioParam" | "AudioParamMap" | "AudioProcessingEvent" | "AudioScheduledSourceNode" | "AudioWorklet" | "AudioWorkletNode" | "AuthenticatorAssertionResponse" | "AuthenticatorAttestationResponse" | "AuthenticatorResponse" | "BarProp" | "BaseAudioContext" | "BeforeUnloadEvent" | "BiquadFilterNode" | "Blob" | "BlobEvent" | "BroadcastChannel" | "ByteLengthQueuingStrategy" | "CDATASection" | "CSPViolationReportBody" | "CSSAnimation" | "CSSConditionRule" | "CSSContainerRule" | "CSSCounterStyleRule" | "CSSFontFaceRule" | "CSSFontFeatureValuesRule" | "CSSFontPaletteValuesRule" | "CSSGroupingRule" | "CSSImageValue" | "CSSImportRule" | "CSSKeyframeRule" | "CSSKeyframesRule" | "CSSKeywordValue" | "CSSLayerBlockRule" | "CSSLayerStatementRule" | "CSSMathClamp" | "CSSMathInvert" | "CSSMathMax" | "CSSMathMin" | "CSSMathNegate" | "CSSMathProduct" | "CSSMathSum" | "CSSMathValue" | "CSSMatrixComponent" | "CSSMediaRule" | "CSSNamespaceRule" | "CSSNestedDeclarations" | "CSSNumericArray" | "CSSNumericValue" | "CSSPageRule" | "CSSPerspective" | "CSSPropertyRule" | "CSSRotate" | "CSSRule" | "CSSRuleList" | "CSSScale" | "CSSScopeRule" | "CSSSkew" | "CSSSkewX" | "CSSSkewY" | "CSSStartingStyleRule" | "CSSStyleDeclaration" | "CSSStyleRule" | "CSSStyleSheet" | "CSSStyleValue" | "CSSSupportsRule" | "CSSTransformComponent" | "CSSTransformValue" | "CSSTransition" | "CSSTranslate" | "CSSUnitValue" | "CSSUnparsedValue" | "CSSVariableReferenceValue" | "CSSViewTransitionRule" | "Cache" | "CacheStorage" | "CanvasCaptureMediaStreamTrack" | "CanvasGradient" | "CanvasPattern" | "CanvasRenderingContext2D" | "CaretPosition" | "ChannelMergerNode" | "ChannelSplitterNode" | "CharacterData" | "Clipboard" | "ClipboardEvent" | "ClipboardItem" | "CloseEvent" | "Comment" | "CompositionEvent" | "CompressionStream" | "ConstantSourceNode" | "ContentVisibilityAutoStateChangeEvent" | "ConvolverNode" | "CookieChangeEvent" | "CookieStore" | "CookieStoreManager" | "CountQueuingStrategy" | "Credential" | "CredentialsContainer" | "Crypto" | "CryptoKey" | "CustomElementRegistry" | "CustomEvent" | "CustomStateSet" | "DOMException" | "DOMImplementation" | "DOMMatrix" | "SVGMatrix" | "WebKitCSSMatrix" | "DOMMatrixReadOnly" | "DOMParser" | "DOMPoint" | "SVGPoint" | "DOMPointReadOnly" | "DOMQuad" | "DOMRect" | "SVGRect" | "DOMRectList" | "DOMRectReadOnly" | "DOMStringList" | "DOMStringMap" | "DOMTokenList" | "DataTransfer" | "DataTransferItem" | "DataTransferItemList" | "DecompressionStream" | "DelayNode" | "DeviceMotionEvent" | "DeviceOrientationEvent" | "Document" | "DocumentFragment" | "DocumentTimeline" | "DocumentType" | "DragEvent" | "DynamicsCompressorNode" | "Element" | "ElementInternals" | "EncodedAudioChunk" | "EncodedVideoChunk" | "ErrorEvent" | "Event" | "EventCounts" | "EventSource" | "EventTarget" | "External" | "File" | "FileList" | "FileReader" | "FileSystem" | "FileSystemDirectoryEntry" | "FileSystemDirectoryHandle" | "FileSystemDirectoryReader" | "FileSystemEntry" | "FileSystemFileEntry" | "FileSystemFileHandle" | "FileSystemHandle" | "FileSystemWritableFileStream" | "FocusEvent" | "FontFace" | "FontFaceSet" | "FontFaceSetLoadEvent" | "FormData" | "FormDataEvent" | "FragmentDirective" | "GainNode" | "Gamepad" | "GamepadButton" | "GamepadEvent" | "GamepadHapticActuator" | "Geolocation" | "GeolocationCoordinates" | "GeolocationPosition" | "GeolocationPositionError" | "HTMLAllCollection" | "HTMLAnchorElement" | "HTMLAreaElement" | "HTMLAudioElement" | "HTMLBRElement" | "HTMLBaseElement" | "HTMLBodyElement" | "HTMLButtonElement" | "HTMLCanvasElement" | "HTMLCollection" | "HTMLDListElement" | "HTMLDataElement" | "HTMLDataListElement" | "HTMLDetailsElement" | "HTMLDialogElement" | "HTMLDirectoryElement" | "HTMLDivElement" | "HTMLDocument" | "HTMLElement" | "HTMLEmbedElement" | "HTMLFieldSetElement" | "HTMLFontElement" | "HTMLFormControlsCollection" | "HTMLFormElement" | "HTMLFrameElement" | "HTMLFrameSetElement" | "HTMLHRElement" | "HTMLHeadElement" | "HTMLHeadingElement" | "HTMLHtmlElement" | "HTMLIFrameElement" | "HTMLImageElement" | "HTMLInputElement" | "HTMLLIElement" | "HTMLLabelElement" | "HTMLLegendElement" | "HTMLLinkElement" | "HTMLMapElement" | "HTMLMarqueeElement" | "HTMLMediaElement" | "HTMLMenuElement" | "HTMLMetaElement" | "HTMLMeterElement" | "HTMLModElement" | "HTMLOListElement" | "HTMLObjectElement" | "HTMLOptGroupElement" | "HTMLOptionElement" | "HTMLOptionsCollection" | "HTMLOutputElement" | "HTMLParagraphElement" | "HTMLParamElement" | "HTMLPictureElement" | "HTMLPreElement" | "HTMLProgressElement" | "HTMLQuoteElement" | "HTMLScriptElement" | "HTMLSelectElement" | "HTMLSlotElement" | "HTMLSourceElement" | "HTMLSpanElement" | "HTMLStyleElement" | "HTMLTableCaptionElement" | "HTMLTableCellElement" | "HTMLTableColElement" | "HTMLTableElement" | "HTMLTableRowElement" | "HTMLTableSectionElement" | "HTMLTemplateElement" | "HTMLTextAreaElement" | "HTMLTimeElement" | "HTMLTitleElement" | "HTMLTrackElement" | "HTMLUListElement" | "HTMLUnknownElement" | "HTMLVideoElement" | "HashChangeEvent" | "Headers" | "Highlight" | "HighlightRegistry" | "History" | "IDBCursor" | "IDBCursorWithValue" | "IDBDatabase" | "IDBFactory" | "IDBIndex" | "IDBKeyRange" | "IDBObjectStore" | "IDBOpenDBRequest" | "IDBRequest" | "IDBTransaction" | "IDBVersionChangeEvent" | "IIRFilterNode" | "IdleDeadline" | "ImageBitmap" | "ImageBitmapRenderingContext" | "ImageCapture" | "ImageData" | "ImageDecoder" | "ImageTrack" | "ImageTrackList" | "InputDeviceInfo" | "InputEvent" | "IntersectionObserver" | "IntersectionObserverEntry" | "KeyboardEvent" | "KeyframeEffect" | "LargestContentfulPaint" | "Location" | "Lock" | "LockManager" | "MIDIAccess" | "MIDIConnectionEvent" | "MIDIInput" | "MIDIInputMap" | "MIDIMessageEvent" | "MIDIOutput" | "MIDIOutputMap" | "MIDIPort" | "MathMLElement" | "MediaCapabilities" | "MediaDeviceInfo" | "MediaDevices" | "MediaElementAudioSourceNode" | "MediaEncryptedEvent" | "MediaError" | "MediaKeyMessageEvent" | "MediaKeySession" | "MediaKeyStatusMap" | "MediaKeySystemAccess" | "MediaKeys" | "MediaList" | "MediaMetadata" | "MediaQueryList" | "MediaQueryListEvent" | "MediaRecorder" | "MediaSession" | "MediaSource" | "MediaSourceHandle" | "MediaStream" | "MediaStreamAudioDestinationNode" | "MediaStreamAudioSourceNode" | "MediaStreamTrack" | "MediaStreamTrackEvent" | "MessageChannel" | "MessageEvent" | "MessagePort" | "MimeType" | "MimeTypeArray" | "MouseEvent" | "MutationObserver" | "MutationRecord" | "NamedNodeMap" | "NavigationActivation" | "NavigationHistoryEntry" | "NavigationPreloadManager" | "Navigator" | "NavigatorLogin" | "Node" | "NodeIterator" | "NodeList" | "Notification" | "OfflineAudioCompletionEvent" | "OfflineAudioContext" | "OffscreenCanvas" | "OffscreenCanvasRenderingContext2D" | "OscillatorNode" | "OverconstrainedError" | "PageRevealEvent" | "PageSwapEvent" | "PageTransitionEvent" | "PannerNode" | "Path2D" | "PaymentAddress" | "PaymentMethodChangeEvent" | "PaymentRequest" | "PaymentRequestUpdateEvent" | "PaymentResponse" | "Performance" | "PerformanceEntry" | "PerformanceEventTiming" | "PerformanceMark" | "PerformanceMeasure" | "PerformanceNavigation" | "PerformanceNavigationTiming" | "PerformanceObserver" | "PerformanceObserverEntryList" | "PerformancePaintTiming" | "PerformanceResourceTiming" | "PerformanceServerTiming" | "PerformanceTiming" | "PeriodicWave" | "PermissionStatus" | "Permissions" | "PictureInPictureEvent" | "PictureInPictureWindow" | "Plugin" | "PluginArray" | "PointerEvent" | "PopStateEvent" | "ProcessingInstruction" | "ProgressEvent" | "PromiseRejectionEvent" | "PublicKeyCredential" | "PushManager" | "PushSubscription" | "PushSubscriptionOptions" | "RTCCertificate" | "RTCDTMFSender" | "RTCDTMFToneChangeEvent" | "RTCDataChannel" | "RTCDataChannelEvent" | "RTCDtlsTransport" | "RTCEncodedAudioFrame" | "RTCEncodedVideoFrame" | "RTCError" | "RTCErrorEvent" | "RTCIceCandidate" | "RTCIceTransport" | "RTCPeerConnection" | "RTCPeerConnectionIceErrorEvent" | "RTCPeerConnectionIceEvent" | "RTCRtpReceiver" | "RTCRtpScriptTransform" | "RTCRtpSender" | "RTCRtpTransceiver" | "RTCSctpTransport" | "RTCSessionDescription" | "RTCStatsReport" | "RTCTrackEvent" | "RadioNodeList" | "Range" | "ReadableByteStreamController" | "ReadableStream" | "ReadableStreamBYOBReader" | "ReadableStreamBYOBRequest" | "ReadableStreamDefaultController" | "ReadableStreamDefaultReader" | "RemotePlayback" | "Report" | "ReportBody" | "ReportingObserver" | "Request" | "ResizeObserver" | "ResizeObserverEntry" | "ResizeObserverSize" | "Response" | "SVGAElement" | "SVGAngle" | "SVGAnimateElement" | "SVGAnimateMotionElement" | "SVGAnimateTransformElement" | "SVGAnimatedAngle" | "SVGAnimatedBoolean" | "SVGAnimatedEnumeration" | "SVGAnimatedInteger" | "SVGAnimatedLength" | "SVGAnimatedLengthList" | "SVGAnimatedNumber" | "SVGAnimatedNumberList" | "SVGAnimatedPreserveAspectRatio" | "SVGAnimatedRect" | "SVGAnimatedString" | "SVGAnimatedTransformList" | "SVGAnimationElement" | "SVGCircleElement" | "SVGClipPathElement" | "SVGComponentTransferFunctionElement" | "SVGDefsElement" | "SVGDescElement" | "SVGElement" | "SVGEllipseElement" | "SVGFEBlendElement" | "SVGFEColorMatrixElement" | "SVGFEComponentTransferElement" | "SVGFECompositeElement" | "SVGFEConvolveMatrixElement" | "SVGFEDiffuseLightingElement" | "SVGFEDisplacementMapElement" | "SVGFEDistantLightElement" | "SVGFEDropShadowElement" | "SVGFEFloodElement" | "SVGFEFuncAElement" | "SVGFEFuncBElement" | "SVGFEFuncGElement" | "SVGFEFuncRElement" | "SVGFEGaussianBlurElement" | "SVGFEImageElement" | "SVGFEMergeElement" | "SVGFEMergeNodeElement" | "SVGFEMorphologyElement" | "SVGFEOffsetElement" | "SVGFEPointLightElement" | "SVGFESpecularLightingElement" | "SVGFESpotLightElement" | "SVGFETileElement" | "SVGFETurbulenceElement" | "SVGFilterElement" | "SVGForeignObjectElement" | "SVGGElement" | "SVGGeometryElement" | "SVGGradientElement" | "SVGGraphicsElement" | "SVGImageElement" | "SVGLength" | "SVGLengthList" | "SVGLineElement" | "SVGLinearGradientElement" | "SVGMPathElement" | "SVGMarkerElement" | "SVGMaskElement" | "SVGMetadataElement" | "SVGNumber" | "SVGNumberList" | "SVGPathElement" | "SVGPatternElement" | "SVGPointList" | "SVGPolygonElement" | "SVGPolylineElement" | "SVGPreserveAspectRatio" | "SVGRadialGradientElement" | "SVGRectElement" | "SVGSVGElement" | "SVGScriptElement" | "SVGSetElement" | "SVGStopElement" | "SVGStringList" | "SVGStyleElement" | "SVGSwitchElement" | "SVGSymbolElement" | "SVGTSpanElement" | "SVGTextContentElement" | "SVGTextElement" | "SVGTextPathElement" | "SVGTextPositioningElement" | "SVGTitleElement" | "SVGTransform" | "SVGTransformList" | "SVGUnitTypes" | "SVGUseElement" | "SVGViewElement" | "Screen" | "ScreenOrientation" | "ScriptProcessorNode" | "SecurityPolicyViolationEvent" | "Selection" | "ServiceWorker" | "ServiceWorkerContainer" | "ServiceWorkerRegistration" | "ShadowRoot" | "SharedWorker" | "SourceBuffer" | "SourceBufferList" | "SpeechRecognitionAlternative" | "SpeechRecognitionResult" | "SpeechRecognitionResultList" | "SpeechSynthesis" | "SpeechSynthesisErrorEvent" | "SpeechSynthesisEvent" | "SpeechSynthesisUtterance" | "SpeechSynthesisVoice" | "StaticRange" | "StereoPannerNode" | "Storage" | "StorageEvent" | "StorageManager" | "StylePropertyMap" | "StylePropertyMapReadOnly" | "StyleSheet" | "StyleSheetList" | "SubmitEvent" | "SubtleCrypto" | "Text" | "TextDecoder" | "TextDecoderStream" | "TextEncoder" | "TextEncoderStream" | "TextEvent" | "TextMetrics" | "TextTrack" | "TextTrackCue" | "TextTrackCueList" | "TextTrackList" | "TimeRanges" | "ToggleEvent" | "Touch" | "TouchEvent" | "TouchList" | "TrackEvent" | "TransformStream" | "TransformStreamDefaultController" | "TransitionEvent" | "TreeWalker" | "UIEvent" | "URL" | "webkitURL" | "URLSearchParams" | "UserActivation" | "VTTCue" | "VTTRegion" | "ValidityState" | "VideoColorSpace" | "VideoDecoder" | "VideoEncoder" | "VideoFrame" | "VideoPlaybackQuality" | "ViewTransition" | "ViewTransitionTypeSet" | "VisualViewport" | "WakeLock" | "WakeLockSentinel" | "WaveShaperNode" | "WebGL2RenderingContext" | "WebGLActiveInfo" | "WebGLBuffer" | "WebGLContextEvent" | "WebGLFramebuffer" | "WebGLProgram" | "WebGLQuery" | "WebGLRenderbuffer" | "WebGLRenderingContext" | "WebGLSampler" | "WebGLShader" | "WebGLShaderPrecisionFormat" | "WebGLSync" | "WebGLTexture" | "WebGLTransformFeedback" | "WebGLUniformLocation" | "WebGLVertexArrayObject" | "WebSocket" | "WebTransport" | "WebTransportBidirectionalStream" | "WebTransportDatagramDuplexStream" | "WebTransportError" | "WheelEvent" | "Window" | "Worker" | "Worklet" | "WritableStream" | "WritableStreamDefaultController" | "WritableStreamDefaultWriter" | "XMLDocument" | "XMLHttpRequest" | "XMLHttpRequestEventTarget" | "XMLHttpRequestUpload" | "XMLSerializer" | "XPathEvaluator" | "XPathExpression" | "XPathResult" | "XSLTProcessor" | "CSS" | "WebAssembly" | "console" | "Audio" | "Image" | "Option" | "clientInformation" | "closed" | "cookieStore" | "customElements" | "devicePixelRatio" | "document" | "event" | "external" | "frameElement" | "frames" | "history" | "innerHeight" | "innerWidth" | "location" | "locationbar" | "menubar" | "navigator" | "ondevicemotion" | "ondeviceorientation" | "ondeviceorientationabsolute" | "onorientationchange" | "opener" | "orientation" | "originAgentCluster" | "outerHeight" | "outerWidth" | "pageXOffset" | "pageYOffset" | "parent" | "personalbar" | "screen" | "screenLeft" | "screenTop" | "screenX" | "screenY" | "scrollX" | "scrollY" | "scrollbars" | "self" | "speechSynthesis" | "status" | "statusbar" | "toolbar" | "top" | "visualViewport" | "window" | "onabort" | "onanimationcancel" | "onanimationend" | "onanimationiteration" | "onanimationstart" | "onauxclick" | "onbeforeinput" | "onbeforematch" | "onbeforetoggle" | "onblur" | "oncancel" | "oncanplay" | "oncanplaythrough" | "onchange" | "onclick" | "onclose" | "oncontextlost" | "oncontextmenu" | "oncontextrestored" | "oncopy" | "oncuechange" | "oncut" | "ondblclick" | "ondrag" | "ondragend" | "ondragenter" | "ondragleave" | "ondragover" | "ondragstart" | "ondrop" | "ondurationchange" | "onemptied" | "onended" | "onerror" | "onfocus" | "onformdata" | "ongotpointercapture" | "oninput" | "oninvalid" | "onkeydown" | "onkeypress" | "onkeyup" | "onload" | "onloadeddata" | "onloadedmetadata" | "onloadstart" | "onlostpointercapture" | "onmousedown" | "onmouseenter" | "onmouseleave" | "onmousemove" | "onmouseout" | "onmouseover" | "onmouseup" | "onpaste" | "onpause" | "onplay" | "onplaying" | "onpointercancel" | "onpointerdown" | "onpointerenter" | "onpointerleave" | "onpointermove" | "onpointerout" | "onpointerover" | "onpointerrawupdate" | "onpointerup" | "onprogress" | "onratechange" | "onreset" | "onresize" | "onscroll" | "onscrollend" | "onsecuritypolicyviolation" | "onseeked" | "onseeking" | "onselect" | "onselectionchange" | "onselectstart" | "onslotchange" | "onstalled" | "onsubmit" | "onsuspend" | "ontimeupdate" | "ontoggle" | "ontouchcancel" | "ontouchend" | "ontouchmove" | "ontouchstart" | "ontransitioncancel" | "ontransitionend" | "ontransitionrun" | "ontransitionstart" | "onvolumechange" | "onwaiting" | "onwebkitanimationend" | "onwebkitanimationiteration" | "onwebkitanimationstart" | "onwebkittransitionend" | "onwheel" | "onafterprint" | "onbeforeprint" | "onbeforeunload" | "ongamepadconnected" | "ongamepaddisconnected" | "onhashchange" | "onlanguagechange" | "onmessage" | "onmessageerror" | "onoffline" | "ononline" | "onpagehide" | "onpagereveal" | "onpageshow" | "onpageswap" | "onpopstate" | "onrejectionhandled" | "onstorage" | "onunhandledrejection" | "onunload" | "localStorage" | "caches" | "crossOriginIsolated" | "crypto" | "indexedDB" | "isSecureContext" | "origin" | "performance" | "sessionStorage" | "importScripts" | "ActiveXObject" | "WScript" | "WSH" | "Enumerator" | "VBArray" | "Map" | "WeakMap" | "Set" | "WeakSet" | "Iterator" | "Proxy" | "Reflect" | "SharedArrayBuffer" | "Atomics" | "BigInt" | "BigInt64Array" | "BigUint64Array" | "AggregateError" | "WeakRef" | "FinalizationRegistry" | "SuppressedError" | "DisposableStack" | "AsyncDisposableStack" | "Float16Array") | "blob" | "file" | "formdata" | string;
|
|
360
364
|
/**
|
|
361
365
|
* 判断值是否为原生 Blob(含 File)。
|
|
362
366
|
*
|
|
@@ -1018,5 +1022,185 @@ declare function extractFullyCheckedKeys(treeData: any[], selectedKeys: any[], i
|
|
|
1018
1022
|
* findTreeNodePath(tree, 3); // [{id:1, ...}, {id:2, ...}, {id:3, ...}]
|
|
1019
1023
|
*/
|
|
1020
1024
|
declare function findTreeNodePath<T>(nodes: T[], targetValue: any, key?: string, parentKey?: string, childrenKey?: string): T[];
|
|
1025
|
+
/**
|
|
1026
|
+
* 处理函数的返回值类型,用于控制节点是否添加。
|
|
1027
|
+
* @typedef {Object} TransformTreeDataWithExtra_HandlerResult
|
|
1028
|
+
* @property {boolean} [isAdd] - 是否将该节点添加到树中。如果为 false,则过滤掉该节点。
|
|
1029
|
+
*/
|
|
1030
|
+
/**
|
|
1031
|
+
* 最终输出的树形结构的字段配置。
|
|
1032
|
+
* @typedef {Object} TransformTreeDataWithExtra_TreeDataOption
|
|
1033
|
+
* @property {string} [idKey="key"] - 最终树节点的唯一标识字段名。
|
|
1034
|
+
* @property {string} [titleKey="title"] - 最终树节点的标题显示字段名。
|
|
1035
|
+
* @property {string} [childrenKey="children"] - 最终树节点的子节点列表字段名。
|
|
1036
|
+
*/
|
|
1037
|
+
/**
|
|
1038
|
+
* 主数据(父节点)的相关配置选项。
|
|
1039
|
+
* @typedef {Object} TransformTreeDataWithExtra_NodeOption
|
|
1040
|
+
* @property {string} [idPrefix] - 节点 ID 的前缀。
|
|
1041
|
+
* @property {string} [idKey="id"] - 原始数据中作为唯一标识的字段名。
|
|
1042
|
+
* @property {string} [titleKey="name"] - 原始数据中作为标题的字段名。
|
|
1043
|
+
* @property {string} [childrenKey="children"] - 原始数据中子节点列表的字段名。
|
|
1044
|
+
* @property {Record<string, any>} [assignData] - 需要额外合并到每个树节点上的静态属性。
|
|
1045
|
+
* @property {string} [rawDataKey] - 如果提供,会将原始节点数据对象挂载到树节点的此字段下。
|
|
1046
|
+
* @property {Object<string, any>} [nodeDataId2Obj] - (副作用) 引用传递的对象,用于建立 id -> 原始数据的映射。
|
|
1047
|
+
* @property {function(object, object): TransformTreeDataWithExtra_HandlerResult | void} [nodeDataHandler] - 对每个主节点进行处理的回调函数。
|
|
1048
|
+
*/
|
|
1049
|
+
/**
|
|
1050
|
+
* 额外数据(子节点)的相关配置选项。
|
|
1051
|
+
* @typedef {Object} TransformTreeDataWithExtra_ExtraOption
|
|
1052
|
+
* @property {string} [idPrefix] - 额外节点 ID 的前缀。
|
|
1053
|
+
* @property {string} [idKey="id"] - 额外数据中作为唯一标识的字段名。
|
|
1054
|
+
* @property {string} [titleKey="name"] - 额外数据中作为标题的字段名。
|
|
1055
|
+
* @property {string} [childrenKey="extraChildren"] - 在主节点上查找额外数据列表的字段名。
|
|
1056
|
+
* @property {Record<string, any>} [assignData] - 需要额外合并到每个额外树节点上的静态属性。
|
|
1057
|
+
* @property {string} [rawDataKey] - 如果提供,会将原始额外数据对象挂载到树节点的此字段下。
|
|
1058
|
+
* @property {Object<string, any>} [extraDataId2Obj] - (副作用) 引用传递的对象,用于建立 id -> 额外数据的映射。
|
|
1059
|
+
* @property {function(object, object, object): TransformTreeDataWithExtra_HandlerResult | void} [extraDataHandler] - 对每个额外节点进行处理的回调函数。
|
|
1060
|
+
*/
|
|
1061
|
+
/**
|
|
1062
|
+
* 将平铺或嵌套的原始数据转换为标准树形结构。
|
|
1063
|
+
* 支持将外部“额外数据”节点作为子节点插入到主节点层级中。
|
|
1064
|
+
* 支持自定义字段映射、ID 前缀、数据挂载以及通过回调函数过滤节点。
|
|
1065
|
+
*
|
|
1066
|
+
* @template T
|
|
1067
|
+
* @param {Array<T>} data - 原始数据数组。
|
|
1068
|
+
* @param {TransformTreeDataWithExtra_ExtraOption} [extraOption] - 额外数据(子节点)的相关配置选项。
|
|
1069
|
+
* @param {TransformTreeDataWithExtra_NodeOption} [nodeOption] - 主数据(父节点)的相关配置选项。
|
|
1070
|
+
* @param {TransformTreeDataWithExtra_TreeDataOption} [treeDataOption] - 最终输出的树形结构的字段配置选项。
|
|
1071
|
+
* @returns {Array<object>} 转换后的树形数据数组。
|
|
1072
|
+
*/
|
|
1073
|
+
declare function transformTreeDataWithExtra<T>(data: Array<T>, extraOption?: TransformTreeDataWithExtra_ExtraOption, nodeOption?: TransformTreeDataWithExtra_NodeOption, treeDataOption?: TransformTreeDataWithExtra_TreeDataOption): Array<object>;
|
|
1074
|
+
/**
|
|
1075
|
+
* 自定义过滤函数的类型定义。
|
|
1076
|
+
* @callback FilterTreeData_FilterFn
|
|
1077
|
+
* @param {object} node - 当前遍历到的树节点对象。
|
|
1078
|
+
* @param {string | number} filterValue - 当前用于过滤的值。
|
|
1079
|
+
* @param {Array<object>} [children] - 当前节点的子节点数组(原始数据)。
|
|
1080
|
+
* @returns {boolean} 返回 true 表示保留该节点,false 表示过滤掉。
|
|
1081
|
+
*/
|
|
1082
|
+
/**
|
|
1083
|
+
* 递归过滤树形数据。
|
|
1084
|
+
*
|
|
1085
|
+
* 该函数会保留符合条件的节点。特别地,**即使当前节点本身不匹配条件,只要其子孙节点中有匹配项,该节点也会被保留**,
|
|
1086
|
+
* 从而保证过滤后的树结构能展示出匹配节点的完整路径。
|
|
1087
|
+
*
|
|
1088
|
+
* @template T
|
|
1089
|
+
* @param {Array<T>} treeData - 源树形数据数组。
|
|
1090
|
+
* @param {string | number} filterValue - 用于过滤的关键字。
|
|
1091
|
+
* @param {string} [filterKey="name"] - 节点对象中用于匹配的字段名。默认为 "name"。如果提供了 filterFn 则此项无效。
|
|
1092
|
+
* @param {string} [childrenKey="children"] - 节点对象中存储子数组的字段名。默认为 "children"。
|
|
1093
|
+
* @param {FilterTreeData_FilterFn} [filterFn] - 自定义过滤函数。如果提供,将忽略 filterKey,使用此函数的返回值判断是否匹配。
|
|
1094
|
+
* @returns {Array<T>} 过滤后的新树形数据数组。注意:返回的是节点对象的浅拷贝。
|
|
1095
|
+
*/
|
|
1096
|
+
declare function filterTreeData<T>(treeData: Array<T>, filterValue: string | number, filterKey?: string, childrenKey?: string, filterFn?: FilterTreeData_FilterFn): Array<T>;
|
|
1097
|
+
/**
|
|
1098
|
+
* 处理函数的返回值类型,用于控制节点是否添加。
|
|
1099
|
+
*/
|
|
1100
|
+
type TransformTreeDataWithExtra_HandlerResult = {
|
|
1101
|
+
/**
|
|
1102
|
+
* - 是否将该节点添加到树中。如果为 false,则过滤掉该节点。
|
|
1103
|
+
*/
|
|
1104
|
+
isAdd?: boolean | undefined;
|
|
1105
|
+
};
|
|
1106
|
+
/**
|
|
1107
|
+
* 最终输出的树形结构的字段配置。
|
|
1108
|
+
*/
|
|
1109
|
+
type TransformTreeDataWithExtra_TreeDataOption = {
|
|
1110
|
+
/**
|
|
1111
|
+
* - 最终树节点的唯一标识字段名。
|
|
1112
|
+
*/
|
|
1113
|
+
idKey?: string | undefined;
|
|
1114
|
+
/**
|
|
1115
|
+
* - 最终树节点的标题显示字段名。
|
|
1116
|
+
*/
|
|
1117
|
+
titleKey?: string | undefined;
|
|
1118
|
+
/**
|
|
1119
|
+
* - 最终树节点的子节点列表字段名。
|
|
1120
|
+
*/
|
|
1121
|
+
childrenKey?: string | undefined;
|
|
1122
|
+
};
|
|
1123
|
+
/**
|
|
1124
|
+
* 主数据(父节点)的相关配置选项。
|
|
1125
|
+
*/
|
|
1126
|
+
type TransformTreeDataWithExtra_NodeOption = {
|
|
1127
|
+
/**
|
|
1128
|
+
* - 节点 ID 的前缀。
|
|
1129
|
+
*/
|
|
1130
|
+
idPrefix?: string | undefined;
|
|
1131
|
+
/**
|
|
1132
|
+
* - 原始数据中作为唯一标识的字段名。
|
|
1133
|
+
*/
|
|
1134
|
+
idKey?: string | undefined;
|
|
1135
|
+
/**
|
|
1136
|
+
* - 原始数据中作为标题的字段名。
|
|
1137
|
+
*/
|
|
1138
|
+
titleKey?: string | undefined;
|
|
1139
|
+
/**
|
|
1140
|
+
* - 原始数据中子节点列表的字段名。
|
|
1141
|
+
*/
|
|
1142
|
+
childrenKey?: string | undefined;
|
|
1143
|
+
/**
|
|
1144
|
+
* - 需要额外合并到每个树节点上的静态属性。
|
|
1145
|
+
*/
|
|
1146
|
+
assignData?: Record<string, any> | undefined;
|
|
1147
|
+
/**
|
|
1148
|
+
* - 如果提供,会将原始节点数据对象挂载到树节点的此字段下。
|
|
1149
|
+
*/
|
|
1150
|
+
rawDataKey?: string | undefined;
|
|
1151
|
+
/**
|
|
1152
|
+
* - (副作用) 引用传递的对象,用于建立 id -> 原始数据的映射。
|
|
1153
|
+
*/
|
|
1154
|
+
nodeDataId2Obj?: {
|
|
1155
|
+
[x: string]: any;
|
|
1156
|
+
} | undefined;
|
|
1157
|
+
/**
|
|
1158
|
+
* - 对每个主节点进行处理的回调函数。
|
|
1159
|
+
*/
|
|
1160
|
+
nodeDataHandler?: ((arg0: object, arg1: object) => TransformTreeDataWithExtra_HandlerResult | void) | undefined;
|
|
1161
|
+
};
|
|
1162
|
+
/**
|
|
1163
|
+
* 额外数据(子节点)的相关配置选项。
|
|
1164
|
+
*/
|
|
1165
|
+
type TransformTreeDataWithExtra_ExtraOption = {
|
|
1166
|
+
/**
|
|
1167
|
+
* - 额外节点 ID 的前缀。
|
|
1168
|
+
*/
|
|
1169
|
+
idPrefix?: string | undefined;
|
|
1170
|
+
/**
|
|
1171
|
+
* - 额外数据中作为唯一标识的字段名。
|
|
1172
|
+
*/
|
|
1173
|
+
idKey?: string | undefined;
|
|
1174
|
+
/**
|
|
1175
|
+
* - 额外数据中作为标题的字段名。
|
|
1176
|
+
*/
|
|
1177
|
+
titleKey?: string | undefined;
|
|
1178
|
+
/**
|
|
1179
|
+
* - 在主节点上查找额外数据列表的字段名。
|
|
1180
|
+
*/
|
|
1181
|
+
childrenKey?: string | undefined;
|
|
1182
|
+
/**
|
|
1183
|
+
* - 需要额外合并到每个额外树节点上的静态属性。
|
|
1184
|
+
*/
|
|
1185
|
+
assignData?: Record<string, any> | undefined;
|
|
1186
|
+
/**
|
|
1187
|
+
* - 如果提供,会将原始额外数据对象挂载到树节点的此字段下。
|
|
1188
|
+
*/
|
|
1189
|
+
rawDataKey?: string | undefined;
|
|
1190
|
+
/**
|
|
1191
|
+
* - (副作用) 引用传递的对象,用于建立 id -> 额外数据的映射。
|
|
1192
|
+
*/
|
|
1193
|
+
extraDataId2Obj?: {
|
|
1194
|
+
[x: string]: any;
|
|
1195
|
+
} | undefined;
|
|
1196
|
+
/**
|
|
1197
|
+
* - 对每个额外节点进行处理的回调函数。
|
|
1198
|
+
*/
|
|
1199
|
+
extraDataHandler?: ((arg0: object, arg1: object, arg2: object) => TransformTreeDataWithExtra_HandlerResult | void) | undefined;
|
|
1200
|
+
};
|
|
1201
|
+
/**
|
|
1202
|
+
* 自定义过滤函数的类型定义。
|
|
1203
|
+
*/
|
|
1204
|
+
type FilterTreeData_FilterFn = (node: object, filterValue: string | number, children?: object[] | undefined) => boolean;
|
|
1021
1205
|
|
|
1022
|
-
export { AudioStreamResampler, IntervalTimer, MyEvent, MyEvent_CrossPagePlugin, MyId, WebSocketManager, assignExisting, copyTextToClipboard, debounce, deepCloneByJSON, downloadByBlob, downloadByData, downloadByUrl, downloadExcel, downloadJSON, extractFullyCheckedKeys, fetchOrDownloadByUrl, findObjAttrValueById, findTreeNodeById, findTreeNodePath, flatCompleteTree2NestedTree, formatTimeForLocale, fullscreenHelper, getAllSearchParams, getDataType, getFunctionArgNames, getGUID, getSearchParam, getTimePeriodName, getViewportSize, handleDbMenuItems, isBlob, isDate, isFunction, isNonEmptyString, isPlainObject, isPromise, millisecond2Duration, millisecond2DurationMaxDay, millisecond2DurationMaxHour, moveItem, nestedTree2IdMap, pcmToWavBlob, randomDateInRange, randomEnLetter, randomHan, randomHanOrEn, randomIntInRange, readBlobAsText, second2Duration, second2DurationMaxDay, second2DurationMaxHour, shuffle, throttle, toDate };
|
|
1206
|
+
export { AudioStreamResampler, IntervalTimer, MyEvent, MyEvent_CrossPagePlugin, MyId, WebSocketManager, assignExisting, copyTextToClipboard, debounce, deepCloneByJSON, downloadByBlob, downloadByData, downloadByUrl, downloadExcel, downloadJSON, extractFullyCheckedKeys, fetchOrDownloadByUrl, filterTreeData, findObjAttrValueById, findTreeNodeById, findTreeNodePath, flatCompleteTree2NestedTree, formatTimeForLocale, fullscreenHelper, getAllSearchParams, getDataType, getFunctionArgNames, getGUID, getSearchParam, getTimePeriodName, getViewportSize, handleDbMenuItems, isBlob, isDate, isFunction, isNonEmptyString, isPlainObject, isPromise, millisecond2Duration, millisecond2DurationMaxDay, millisecond2DurationMaxHour, moveItem, nestedTree2IdMap, pcmToWavBlob, randomDateInRange, randomEnLetter, randomHan, randomHanOrEn, randomIntInRange, readBlobAsText, second2Duration, second2DurationMaxDay, second2DurationMaxHour, shuffle, throttle, toDate, transformTreeDataWithExtra };
|
package/types/timer.d.ts
CHANGED
package/types/tree.d.ts
CHANGED
|
@@ -86,5 +86,186 @@ declare function extractFullyCheckedKeys(treeData: any[], selectedKeys: any[], i
|
|
|
86
86
|
* findTreeNodePath(tree, 3); // [{id:1, ...}, {id:2, ...}, {id:3, ...}]
|
|
87
87
|
*/
|
|
88
88
|
declare function findTreeNodePath<T>(nodes: T[], targetValue: any, key?: string, parentKey?: string, childrenKey?: string): T[];
|
|
89
|
+
/**
|
|
90
|
+
* 处理函数的返回值类型,用于控制节点是否添加。
|
|
91
|
+
* @typedef {Object} TransformTreeDataWithExtra_HandlerResult
|
|
92
|
+
* @property {boolean} [isAdd] - 是否将该节点添加到树中。如果为 false,则过滤掉该节点。
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* 最终输出的树形结构的字段配置。
|
|
96
|
+
* @typedef {Object} TransformTreeDataWithExtra_TreeDataOption
|
|
97
|
+
* @property {string} [idKey="key"] - 最终树节点的唯一标识字段名。
|
|
98
|
+
* @property {string} [titleKey="title"] - 最终树节点的标题显示字段名。
|
|
99
|
+
* @property {string} [childrenKey="children"] - 最终树节点的子节点列表字段名。
|
|
100
|
+
*/
|
|
101
|
+
/**
|
|
102
|
+
* 主数据(父节点)的相关配置选项。
|
|
103
|
+
* @typedef {Object} TransformTreeDataWithExtra_NodeOption
|
|
104
|
+
* @property {string} [idPrefix] - 节点 ID 的前缀。
|
|
105
|
+
* @property {string} [idKey="id"] - 原始数据中作为唯一标识的字段名。
|
|
106
|
+
* @property {string} [titleKey="name"] - 原始数据中作为标题的字段名。
|
|
107
|
+
* @property {string} [childrenKey="children"] - 原始数据中子节点列表的字段名。
|
|
108
|
+
* @property {Record<string, any>} [assignData] - 需要额外合并到每个树节点上的静态属性。
|
|
109
|
+
* @property {string} [rawDataKey] - 如果提供,会将原始节点数据对象挂载到树节点的此字段下。
|
|
110
|
+
* @property {Object<string, any>} [nodeDataId2Obj] - (副作用) 引用传递的对象,用于建立 id -> 原始数据的映射。
|
|
111
|
+
* @property {function(object, object): TransformTreeDataWithExtra_HandlerResult | void} [nodeDataHandler] - 对每个主节点进行处理的回调函数。
|
|
112
|
+
*/
|
|
113
|
+
/**
|
|
114
|
+
* 额外数据(子节点)的相关配置选项。
|
|
115
|
+
* @typedef {Object} TransformTreeDataWithExtra_ExtraOption
|
|
116
|
+
* @property {string} [idPrefix] - 额外节点 ID 的前缀。
|
|
117
|
+
* @property {string} [idKey="id"] - 额外数据中作为唯一标识的字段名。
|
|
118
|
+
* @property {string} [titleKey="name"] - 额外数据中作为标题的字段名。
|
|
119
|
+
* @property {string} [childrenKey="extraChildren"] - 在主节点上查找额外数据列表的字段名。
|
|
120
|
+
* @property {Record<string, any>} [assignData] - 需要额外合并到每个额外树节点上的静态属性。
|
|
121
|
+
* @property {string} [rawDataKey] - 如果提供,会将原始额外数据对象挂载到树节点的此字段下。
|
|
122
|
+
* @property {Object<string, any>} [extraDataId2Obj] - (副作用) 引用传递的对象,用于建立 id -> 额外数据的映射。
|
|
123
|
+
* @property {function(object, object, object): TransformTreeDataWithExtra_HandlerResult | void} [extraDataHandler] - 对每个额外节点进行处理的回调函数。
|
|
124
|
+
*/
|
|
125
|
+
/**
|
|
126
|
+
* 将平铺或嵌套的原始数据转换为标准树形结构。
|
|
127
|
+
* 支持将外部“额外数据”节点作为子节点插入到主节点层级中。
|
|
128
|
+
* 支持自定义字段映射、ID 前缀、数据挂载以及通过回调函数过滤节点。
|
|
129
|
+
*
|
|
130
|
+
* @template T
|
|
131
|
+
* @param {Array<T>} data - 原始数据数组。
|
|
132
|
+
* @param {TransformTreeDataWithExtra_ExtraOption} [extraOption] - 额外数据(子节点)的相关配置选项。
|
|
133
|
+
* @param {TransformTreeDataWithExtra_NodeOption} [nodeOption] - 主数据(父节点)的相关配置选项。
|
|
134
|
+
* @param {TransformTreeDataWithExtra_TreeDataOption} [treeDataOption] - 最终输出的树形结构的字段配置选项。
|
|
135
|
+
* @returns {Array<object>} 转换后的树形数据数组。
|
|
136
|
+
*/
|
|
137
|
+
declare function transformTreeDataWithExtra<T>(data: Array<T>, extraOption?: TransformTreeDataWithExtra_ExtraOption, nodeOption?: TransformTreeDataWithExtra_NodeOption, treeDataOption?: TransformTreeDataWithExtra_TreeDataOption): Array<object>;
|
|
138
|
+
/**
|
|
139
|
+
* 自定义过滤函数的类型定义。
|
|
140
|
+
* @callback FilterTreeData_FilterFn
|
|
141
|
+
* @param {object} node - 当前遍历到的树节点对象。
|
|
142
|
+
* @param {string | number} filterValue - 当前用于过滤的值。
|
|
143
|
+
* @param {Array<object>} [children] - 当前节点的子节点数组(原始数据)。
|
|
144
|
+
* @returns {boolean} 返回 true 表示保留该节点,false 表示过滤掉。
|
|
145
|
+
*/
|
|
146
|
+
/**
|
|
147
|
+
* 递归过滤树形数据。
|
|
148
|
+
*
|
|
149
|
+
* 该函数会保留符合条件的节点。特别地,**即使当前节点本身不匹配条件,只要其子孙节点中有匹配项,该节点也会被保留**,
|
|
150
|
+
* 从而保证过滤后的树结构能展示出匹配节点的完整路径。
|
|
151
|
+
*
|
|
152
|
+
* @template T
|
|
153
|
+
* @param {Array<T>} treeData - 源树形数据数组。
|
|
154
|
+
* @param {string | number} filterValue - 用于过滤的关键字。
|
|
155
|
+
* @param {string} [filterKey="name"] - 节点对象中用于匹配的字段名。默认为 "name"。如果提供了 filterFn 则此项无效。
|
|
156
|
+
* @param {string} [childrenKey="children"] - 节点对象中存储子数组的字段名。默认为 "children"。
|
|
157
|
+
* @param {FilterTreeData_FilterFn} [filterFn] - 自定义过滤函数。如果提供,将忽略 filterKey,使用此函数的返回值判断是否匹配。
|
|
158
|
+
* @returns {Array<T>} 过滤后的新树形数据数组。注意:返回的是节点对象的浅拷贝。
|
|
159
|
+
*/
|
|
160
|
+
declare function filterTreeData<T>(treeData: Array<T>, filterValue: string | number, filterKey?: string, childrenKey?: string, filterFn?: FilterTreeData_FilterFn): Array<T>;
|
|
161
|
+
/**
|
|
162
|
+
* 处理函数的返回值类型,用于控制节点是否添加。
|
|
163
|
+
*/
|
|
164
|
+
type TransformTreeDataWithExtra_HandlerResult = {
|
|
165
|
+
/**
|
|
166
|
+
* - 是否将该节点添加到树中。如果为 false,则过滤掉该节点。
|
|
167
|
+
*/
|
|
168
|
+
isAdd?: boolean | undefined;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* 最终输出的树形结构的字段配置。
|
|
172
|
+
*/
|
|
173
|
+
type TransformTreeDataWithExtra_TreeDataOption = {
|
|
174
|
+
/**
|
|
175
|
+
* - 最终树节点的唯一标识字段名。
|
|
176
|
+
*/
|
|
177
|
+
idKey?: string | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* - 最终树节点的标题显示字段名。
|
|
180
|
+
*/
|
|
181
|
+
titleKey?: string | undefined;
|
|
182
|
+
/**
|
|
183
|
+
* - 最终树节点的子节点列表字段名。
|
|
184
|
+
*/
|
|
185
|
+
childrenKey?: string | undefined;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* 主数据(父节点)的相关配置选项。
|
|
189
|
+
*/
|
|
190
|
+
type TransformTreeDataWithExtra_NodeOption = {
|
|
191
|
+
/**
|
|
192
|
+
* - 节点 ID 的前缀。
|
|
193
|
+
*/
|
|
194
|
+
idPrefix?: string | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* - 原始数据中作为唯一标识的字段名。
|
|
197
|
+
*/
|
|
198
|
+
idKey?: string | undefined;
|
|
199
|
+
/**
|
|
200
|
+
* - 原始数据中作为标题的字段名。
|
|
201
|
+
*/
|
|
202
|
+
titleKey?: string | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* - 原始数据中子节点列表的字段名。
|
|
205
|
+
*/
|
|
206
|
+
childrenKey?: string | undefined;
|
|
207
|
+
/**
|
|
208
|
+
* - 需要额外合并到每个树节点上的静态属性。
|
|
209
|
+
*/
|
|
210
|
+
assignData?: Record<string, any> | undefined;
|
|
211
|
+
/**
|
|
212
|
+
* - 如果提供,会将原始节点数据对象挂载到树节点的此字段下。
|
|
213
|
+
*/
|
|
214
|
+
rawDataKey?: string | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* - (副作用) 引用传递的对象,用于建立 id -> 原始数据的映射。
|
|
217
|
+
*/
|
|
218
|
+
nodeDataId2Obj?: {
|
|
219
|
+
[x: string]: any;
|
|
220
|
+
} | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* - 对每个主节点进行处理的回调函数。
|
|
223
|
+
*/
|
|
224
|
+
nodeDataHandler?: ((arg0: object, arg1: object) => TransformTreeDataWithExtra_HandlerResult | void) | undefined;
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* 额外数据(子节点)的相关配置选项。
|
|
228
|
+
*/
|
|
229
|
+
type TransformTreeDataWithExtra_ExtraOption = {
|
|
230
|
+
/**
|
|
231
|
+
* - 额外节点 ID 的前缀。
|
|
232
|
+
*/
|
|
233
|
+
idPrefix?: string | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* - 额外数据中作为唯一标识的字段名。
|
|
236
|
+
*/
|
|
237
|
+
idKey?: string | undefined;
|
|
238
|
+
/**
|
|
239
|
+
* - 额外数据中作为标题的字段名。
|
|
240
|
+
*/
|
|
241
|
+
titleKey?: string | undefined;
|
|
242
|
+
/**
|
|
243
|
+
* - 在主节点上查找额外数据列表的字段名。
|
|
244
|
+
*/
|
|
245
|
+
childrenKey?: string | undefined;
|
|
246
|
+
/**
|
|
247
|
+
* - 需要额外合并到每个额外树节点上的静态属性。
|
|
248
|
+
*/
|
|
249
|
+
assignData?: Record<string, any> | undefined;
|
|
250
|
+
/**
|
|
251
|
+
* - 如果提供,会将原始额外数据对象挂载到树节点的此字段下。
|
|
252
|
+
*/
|
|
253
|
+
rawDataKey?: string | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* - (副作用) 引用传递的对象,用于建立 id -> 额外数据的映射。
|
|
256
|
+
*/
|
|
257
|
+
extraDataId2Obj?: {
|
|
258
|
+
[x: string]: any;
|
|
259
|
+
} | undefined;
|
|
260
|
+
/**
|
|
261
|
+
* - 对每个额外节点进行处理的回调函数。
|
|
262
|
+
*/
|
|
263
|
+
extraDataHandler?: ((arg0: object, arg1: object, arg2: object) => TransformTreeDataWithExtra_HandlerResult | void) | undefined;
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* 自定义过滤函数的类型定义。
|
|
267
|
+
*/
|
|
268
|
+
type FilterTreeData_FilterFn = (node: object, filterValue: string | number, children?: object[] | undefined) => boolean;
|
|
89
269
|
|
|
90
|
-
export { extractFullyCheckedKeys, findObjAttrValueById, findTreeNodeById, findTreeNodePath, flatCompleteTree2NestedTree, nestedTree2IdMap };
|
|
270
|
+
export { extractFullyCheckedKeys, filterTreeData, findObjAttrValueById, findTreeNodeById, findTreeNodePath, flatCompleteTree2NestedTree, nestedTree2IdMap, transformTreeDataWithExtra };
|
|
271
|
+
export type { FilterTreeData_FilterFn, TransformTreeDataWithExtra_ExtraOption, TransformTreeDataWithExtra_HandlerResult, TransformTreeDataWithExtra_NodeOption, TransformTreeDataWithExtra_TreeDataOption };
|