taro-uno-ui 1.0.0 → 1.0.1
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/README.md +1 -1
- package/dist/js/index-CDFsvu80.js.map +1 -1
- package/dist/js/index-JffnTUrv.js.map +1 -1
- package/dist/utils/http/request.d.ts +1 -1
- package/package.json +2 -2
- package/src/utils/http/request.ts +1 -1
- package/dist/app.config.d.ts +0 -38
- package/dist/app.d.ts +0 -6
- package/dist/components/basic/Button/Button.d.ts +0 -6
- package/dist/components/basic/Button/Button.styles.d.ts +0 -2
- package/dist/components/basic/Button/Button.types.d.ts +0 -74
- package/dist/components/basic/Button/index.d.ts +0 -4
- package/dist/components/basic/Divider/Divider.d.ts +0 -6
- package/dist/components/basic/Divider/Divider.styles.d.ts +0 -87
- package/dist/components/basic/Divider/Divider.types.d.ts +0 -242
- package/dist/components/basic/Divider/index.d.ts +0 -6
- package/dist/components/basic/Icon/Icon.d.ts +0 -5
- package/dist/components/basic/Icon/Icon.data.d.ts +0 -29
- package/dist/components/basic/Icon/Icon.styles.d.ts +0 -61
- package/dist/components/basic/Icon/Icon.types.d.ts +0 -199
- package/dist/components/basic/Icon/IconManager.d.ts +0 -120
- package/dist/components/basic/Icon/index.d.ts +0 -6
- package/dist/components/basic/Text/Text.d.ts +0 -7
- package/dist/components/basic/Text/Text.styles.d.ts +0 -67
- package/dist/components/basic/Text/Text.types.d.ts +0 -274
- package/dist/components/basic/Text/index.d.ts +0 -5
- package/dist/components/basic/Typography/Typography.d.ts +0 -8
- package/dist/components/basic/Typography/Typography.styles.d.ts +0 -83
- package/dist/components/basic/Typography/Typography.types.d.ts +0 -245
- package/dist/components/basic/Typography/index.d.ts +0 -3
- package/dist/components/basic/Video/Video.d.ts +0 -7
- package/dist/components/basic/Video/Video.styles.d.ts +0 -212
- package/dist/components/basic/Video/Video.types.d.ts +0 -447
- package/dist/components/basic/Video/index.d.ts +0 -10
- package/dist/components/basic/index.d.ts +0 -217
- package/dist/components/common/ErrorBoundary.d.ts +0 -19
- package/dist/components/common/LazyComponent.d.ts +0 -78
- package/dist/components/common/ResponsiveContainer.d.ts +0 -23
- package/dist/components/common/ResponsiveGrid.d.ts +0 -44
- package/dist/components/common/SecurityProvider.d.ts +0 -15
- package/dist/components/common/ThemeProvider.d.ts +0 -17
- package/dist/components/common/VirtualList.d.ts +0 -89
- package/dist/components/common/index.d.ts +0 -17
- package/dist/components/display/Avatar/Avatar.d.ts +0 -3
- package/dist/components/display/Avatar/Avatar.styles.d.ts +0 -2
- package/dist/components/display/Avatar/Avatar.types.d.ts +0 -37
- package/dist/components/display/Avatar/index.d.ts +0 -3
- package/dist/components/display/Badge/Badge.d.ts +0 -3
- package/dist/components/display/Badge/Badge.types.d.ts +0 -27
- package/dist/components/display/Badge/index.d.ts +0 -2
- package/dist/components/display/Calendar/Calendar.d.ts +0 -5
- package/dist/components/display/Calendar/Calendar.styles.d.ts +0 -2
- package/dist/components/display/Calendar/Calendar.types.d.ts +0 -87
- package/dist/components/display/Calendar/index.d.ts +0 -3
- package/dist/components/display/Card/Card.d.ts +0 -3
- package/dist/components/display/Card/Card.styles.d.ts +0 -1
- package/dist/components/display/Card/Card.types.d.ts +0 -52
- package/dist/components/display/Card/index.d.ts +0 -3
- package/dist/components/display/Carousel/Carousel.d.ts +0 -5
- package/dist/components/display/Carousel/Carousel.styles.d.ts +0 -2
- package/dist/components/display/Carousel/Carousel.types.d.ts +0 -55
- package/dist/components/display/Carousel/index.d.ts +0 -3
- package/dist/components/display/List/List.d.ts +0 -4
- package/dist/components/display/List/List.styles.d.ts +0 -1
- package/dist/components/display/List/List.types.d.ts +0 -64
- package/dist/components/display/List/index.d.ts +0 -3
- package/dist/components/display/Rate/Rate.d.ts +0 -6
- package/dist/components/display/Rate/Rate.styles.d.ts +0 -100
- package/dist/components/display/Rate/Rate.types.d.ts +0 -105
- package/dist/components/display/Rate/index.d.ts +0 -17
- package/dist/components/display/Table/Table.d.ts +0 -7
- package/dist/components/display/Table/Table.styles.d.ts +0 -84
- package/dist/components/display/Table/Table.types.d.ts +0 -251
- package/dist/components/display/Table/index.d.ts +0 -4
- package/dist/components/display/Tag/Tag.d.ts +0 -5
- package/dist/components/display/Tag/Tag.styles.d.ts +0 -2
- package/dist/components/display/Tag/Tag.types.d.ts +0 -47
- package/dist/components/display/Tag/index.d.ts +0 -3
- package/dist/components/display/Timeline/Timeline.d.ts +0 -16
- package/dist/components/display/Timeline/Timeline.styles.d.ts +0 -2
- package/dist/components/display/Timeline/Timeline.types.d.ts +0 -53
- package/dist/components/display/Timeline/index.d.ts +0 -3
- package/dist/components/display/index.d.ts +0 -67
- package/dist/components/feedback/Loading/Loading.d.ts +0 -4
- package/dist/components/feedback/Loading/Loading.styles.d.ts +0 -2
- package/dist/components/feedback/Loading/Loading.types.d.ts +0 -29
- package/dist/components/feedback/Loading/index.d.ts +0 -4
- package/dist/components/feedback/Message/Message.d.ts +0 -4
- package/dist/components/feedback/Message/Message.styles.d.ts +0 -34
- package/dist/components/feedback/Message/Message.types.d.ts +0 -33
- package/dist/components/feedback/Message/index.d.ts +0 -4
- package/dist/components/feedback/Modal/Modal.d.ts +0 -8
- package/dist/components/feedback/Modal/Modal.styles.d.ts +0 -18
- package/dist/components/feedback/Modal/Modal.types.d.ts +0 -143
- package/dist/components/feedback/Modal/index.d.ts +0 -3
- package/dist/components/feedback/Notification/Notification.d.ts +0 -4
- package/dist/components/feedback/Notification/Notification.styles.d.ts +0 -88
- package/dist/components/feedback/Notification/Notification.types.d.ts +0 -279
- package/dist/components/feedback/Notification/NotificationManager.d.ts +0 -4
- package/dist/components/feedback/Notification/index.d.ts +0 -25
- package/dist/components/feedback/Progress/Progress.d.ts +0 -4
- package/dist/components/feedback/Progress/Progress.styles.d.ts +0 -261
- package/dist/components/feedback/Progress/Progress.test.simple.d.ts +0 -2
- package/dist/components/feedback/Progress/Progress.types.d.ts +0 -147
- package/dist/components/feedback/Progress/index.d.ts +0 -3
- package/dist/components/feedback/Progress/utils/animation.d.ts +0 -55
- package/dist/components/feedback/Progress/utils/index.d.ts +0 -2
- package/dist/components/feedback/Progress/utils/progress-calculator.d.ts +0 -75
- package/dist/components/feedback/Result/Result.d.ts +0 -7
- package/dist/components/feedback/Result/Result.styles.d.ts +0 -2
- package/dist/components/feedback/Result/Result.types.d.ts +0 -66
- package/dist/components/feedback/Result/index.d.ts +0 -3
- package/dist/components/feedback/Toast/Toast.d.ts +0 -7
- package/dist/components/feedback/Toast/Toast.styles.d.ts +0 -14
- package/dist/components/feedback/Toast/Toast.types.d.ts +0 -81
- package/dist/components/feedback/Toast/index.d.ts +0 -3
- package/dist/components/feedback/Tooltip/Tooltip.d.ts +0 -4
- package/dist/components/feedback/Tooltip/Tooltip.examples.d.ts +0 -6
- package/dist/components/feedback/Tooltip/Tooltip.styles.d.ts +0 -78
- package/dist/components/feedback/Tooltip/Tooltip.types.d.ts +0 -130
- package/dist/components/feedback/Tooltip/index.d.ts +0 -3
- package/dist/components/feedback/index.d.ts +0 -71
- package/dist/components/form/Cascader/Cascader.d.ts +0 -7
- package/dist/components/form/Cascader/Cascader.styles.d.ts +0 -107
- package/dist/components/form/Cascader/Cascader.types.d.ts +0 -418
- package/dist/components/form/Cascader/hooks/index.d.ts +0 -3
- package/dist/components/form/Cascader/hooks/useCascaderFieldNames.d.ts +0 -12
- package/dist/components/form/Cascader/hooks/useCascaderOptions.d.ts +0 -15
- package/dist/components/form/Cascader/hooks/useCascaderState.d.ts +0 -23
- package/dist/components/form/Cascader/index.d.ts +0 -6
- package/dist/components/form/Cascader/utils/formatDisplayValue.d.ts +0 -9
- package/dist/components/form/Cascader/utils/index.d.ts +0 -1
- package/dist/components/form/Checkbox/Checkbox.d.ts +0 -6
- package/dist/components/form/Checkbox/Checkbox.styles.d.ts +0 -111
- package/dist/components/form/Checkbox/Checkbox.types.d.ts +0 -473
- package/dist/components/form/Checkbox/CheckboxGroup.d.ts +0 -6
- package/dist/components/form/Checkbox/index.d.ts +0 -8
- package/dist/components/form/DatePicker/DatePicker.d.ts +0 -6
- package/dist/components/form/DatePicker/DatePicker.styles.d.ts +0 -99
- package/dist/components/form/DatePicker/DatePicker.types.d.ts +0 -236
- package/dist/components/form/DatePicker/index.d.ts +0 -3
- package/dist/components/form/Form/Form.d.ts +0 -8
- package/dist/components/form/Form/Form.styles.d.ts +0 -84
- package/dist/components/form/Form/Form.types.d.ts +0 -416
- package/dist/components/form/Form/index.d.ts +0 -9
- package/dist/components/form/Form/useFormLogic.d.ts +0 -22
- package/dist/components/form/Input/Input.d.ts +0 -6
- package/dist/components/form/Input/Input.styles.d.ts +0 -61
- package/dist/components/form/Input/Input.types.d.ts +0 -294
- package/dist/components/form/Input/index.d.ts +0 -8
- package/dist/components/form/Input/useInputLogic.d.ts +0 -35
- package/dist/components/form/InputNumber/InputNumber.d.ts +0 -6
- package/dist/components/form/InputNumber/InputNumber.styles.d.ts +0 -120
- package/dist/components/form/InputNumber/InputNumber.types.d.ts +0 -303
- package/dist/components/form/InputNumber/components/InputNumberClearButton.d.ts +0 -10
- package/dist/components/form/InputNumber/components/InputNumberControls.d.ts +0 -11
- package/dist/components/form/InputNumber/components/index.d.ts +0 -2
- package/dist/components/form/InputNumber/hooks/index.d.ts +0 -4
- package/dist/components/form/InputNumber/hooks/useInputNumberState.d.ts +0 -38
- package/dist/components/form/InputNumber/hooks/useInputNumberValidation.d.ts +0 -12
- package/dist/components/form/InputNumber/index.d.ts +0 -5
- package/dist/components/form/Radio/Radio.d.ts +0 -6
- package/dist/components/form/Radio/Radio.styles.d.ts +0 -80
- package/dist/components/form/Radio/Radio.types.d.ts +0 -415
- package/dist/components/form/Radio/index.d.ts +0 -8
- package/dist/components/form/Select/Select.d.ts +0 -6
- package/dist/components/form/Select/Select.styles.d.ts +0 -71
- package/dist/components/form/Select/Select.types.d.ts +0 -418
- package/dist/components/form/Select/index.d.ts +0 -8
- package/dist/components/form/Slider/Slider.d.ts +0 -7
- package/dist/components/form/Slider/Slider.styles.d.ts +0 -2
- package/dist/components/form/Slider/Slider.types.d.ts +0 -85
- package/dist/components/form/Slider/index.d.ts +0 -3
- package/dist/components/form/Switch/Switch.d.ts +0 -10
- package/dist/components/form/Switch/Switch.styles.d.ts +0 -154
- package/dist/components/form/Switch/Switch.types.d.ts +0 -351
- package/dist/components/form/Switch/index.d.ts +0 -7
- package/dist/components/form/Textarea/Textarea.d.ts +0 -6
- package/dist/components/form/Textarea/Textarea.styles.d.ts +0 -66
- package/dist/components/form/Textarea/Textarea.types.d.ts +0 -348
- package/dist/components/form/Textarea/index.d.ts +0 -7
- package/dist/components/form/TimePicker/TimePicker.d.ts +0 -6
- package/dist/components/form/TimePicker/TimePicker.styles.d.ts +0 -104
- package/dist/components/form/TimePicker/TimePicker.types.d.ts +0 -385
- package/dist/components/form/TimePicker/index.d.ts +0 -4
- package/dist/components/form/Transfer/Transfer.d.ts +0 -7
- package/dist/components/form/Transfer/Transfer.styles.d.ts +0 -106
- package/dist/components/form/Transfer/Transfer.types.d.ts +0 -384
- package/dist/components/form/Transfer/components/TransferItem.d.ts +0 -23
- package/dist/components/form/Transfer/components/TransferList.d.ts +0 -55
- package/dist/components/form/Transfer/components/TransferOperations.d.ts +0 -21
- package/dist/components/form/Transfer/components/TransferPagination.d.ts +0 -19
- package/dist/components/form/Transfer/components/TransferSearch.d.ts +0 -21
- package/dist/components/form/Transfer/components/index.d.ts +0 -6
- package/dist/components/form/Transfer/hooks/index.d.ts +0 -3
- package/dist/components/form/Transfer/hooks/useTransferData.d.ts +0 -41
- package/dist/components/form/Transfer/hooks/useTransferState.d.ts +0 -21
- package/dist/components/form/Transfer/index.d.ts +0 -9
- package/dist/components/form/Upload/Upload.d.ts +0 -7
- package/dist/components/form/Upload/Upload.styles.d.ts +0 -2
- package/dist/components/form/Upload/Upload.types.d.ts +0 -143
- package/dist/components/form/Upload/index.d.ts +0 -3
- package/dist/components/form/index.d.ts +0 -126
- package/dist/components/index.d.ts +0 -122
- package/dist/components/layout/Affix/Affix.d.ts +0 -4
- package/dist/components/layout/Affix/Affix.styles.d.ts +0 -1669
- package/dist/components/layout/Affix/Affix.types.d.ts +0 -25
- package/dist/components/layout/Affix/index.d.ts +0 -3
- package/dist/components/layout/Col/Col.d.ts +0 -6
- package/dist/components/layout/Col/Col.styles.d.ts +0 -52
- package/dist/components/layout/Col/Col.types.d.ts +0 -54
- package/dist/components/layout/Col/index.d.ts +0 -3
- package/dist/components/layout/Container/Container.d.ts +0 -6
- package/dist/components/layout/Container/Container.styles.d.ts +0 -41
- package/dist/components/layout/Container/Container.types.d.ts +0 -59
- package/dist/components/layout/Container/index.d.ts +0 -3
- package/dist/components/layout/Grid/Grid.d.ts +0 -6
- package/dist/components/layout/Grid/Grid.styles.d.ts +0 -60
- package/dist/components/layout/Grid/Grid.types.d.ts +0 -68
- package/dist/components/layout/Grid/index.d.ts +0 -3
- package/dist/components/layout/Layout/Content.d.ts +0 -4
- package/dist/components/layout/Layout/Footer.d.ts +0 -4
- package/dist/components/layout/Layout/Header.d.ts +0 -4
- package/dist/components/layout/Layout/Layout.d.ts +0 -4
- package/dist/components/layout/Layout/Layout.styles.d.ts +0 -3366
- package/dist/components/layout/Layout/Layout.types.d.ts +0 -48
- package/dist/components/layout/Layout/Sider.d.ts +0 -4
- package/dist/components/layout/Layout/index.d.ts +0 -8
- package/dist/components/layout/Row/Row.d.ts +0 -6
- package/dist/components/layout/Row/Row.styles.d.ts +0 -55
- package/dist/components/layout/Row/Row.types.d.ts +0 -51
- package/dist/components/layout/Row/index.d.ts +0 -3
- package/dist/components/layout/Space/Space.d.ts +0 -6
- package/dist/components/layout/Space/Space.styles.d.ts +0 -69
- package/dist/components/layout/Space/Space.types.d.ts +0 -84
- package/dist/components/layout/Space/index.d.ts +0 -3
- package/dist/components/layout/index.d.ts +0 -39
- package/dist/components/navigation/Menu/Menu.constants.d.ts +0 -59
- package/dist/components/navigation/Menu/Menu.d.ts +0 -10
- package/dist/components/navigation/Menu/Menu.stories.d.ts +0 -157
- package/dist/components/navigation/Menu/Menu.styles.d.ts +0 -143
- package/dist/components/navigation/Menu/Menu.types.d.ts +0 -210
- package/dist/components/navigation/Menu/Menu.utils.d.ts +0 -54
- package/dist/components/navigation/Menu/MenuItem.d.ts +0 -32
- package/dist/components/navigation/Menu/SubMenu.d.ts +0 -41
- package/dist/components/navigation/Menu/index.d.ts +0 -54
- package/dist/components/navigation/NavBar/NavBar.d.ts +0 -7
- package/dist/components/navigation/NavBar/NavBar.styles.d.ts +0 -114
- package/dist/components/navigation/NavBar/NavBar.types.d.ts +0 -50
- package/dist/components/navigation/NavBar/index.d.ts +0 -3
- package/dist/components/navigation/Pagination/Pagination.d.ts +0 -6
- package/dist/components/navigation/Pagination/Pagination.styles.d.ts +0 -55
- package/dist/components/navigation/Pagination/Pagination.types.d.ts +0 -77
- package/dist/components/navigation/Pagination/index.d.ts +0 -15
- package/dist/components/navigation/Steps/Step.d.ts +0 -4
- package/dist/components/navigation/Steps/Steps.d.ts +0 -4
- package/dist/components/navigation/Steps/Steps.styles.d.ts +0 -6716
- package/dist/components/navigation/Steps/Steps.types.d.ts +0 -41
- package/dist/components/navigation/Steps/index.d.ts +0 -3
- package/dist/components/navigation/Tabs/Tabs.d.ts +0 -6
- package/dist/components/navigation/Tabs/Tabs.styles.d.ts +0 -60
- package/dist/components/navigation/Tabs/Tabs.types.d.ts +0 -107
- package/dist/components/navigation/Tabs/index.d.ts +0 -3
- package/dist/components/navigation/index.d.ts +0 -35
- package/dist/constants/index.d.ts +0 -624
- package/dist/hooks/index.d.ts +0 -28
- package/dist/hooks/types.d.ts +0 -7
- package/dist/hooks/useAsync.d.ts +0 -17
- package/dist/hooks/useClickOutside.d.ts +0 -19
- package/dist/hooks/useCounter.d.ts +0 -36
- package/dist/hooks/useDebounce.d.ts +0 -31
- package/dist/hooks/useDeepCompareEffect.d.ts +0 -22
- package/dist/hooks/useEventHandling.d.ts +0 -81
- package/dist/hooks/useEventListener.d.ts +0 -19
- package/dist/hooks/useLifecycle.d.ts +0 -66
- package/dist/hooks/useMediaQuery.d.ts +0 -22
- package/dist/hooks/useMutation.d.ts +0 -47
- package/dist/hooks/usePerformance.d.ts +0 -73
- package/dist/hooks/usePerformanceMonitor.d.ts +0 -66
- package/dist/hooks/usePlatform.d.ts +0 -20
- package/dist/hooks/usePrevious.d.ts +0 -14
- package/dist/hooks/useRequest.d.ts +0 -32
- package/dist/hooks/useStateManagement.d.ts +0 -62
- package/dist/hooks/useStorage.d.ts +0 -27
- package/dist/hooks/useStyle.d.ts +0 -127
- package/dist/hooks/useTheme.d.ts +0 -58
- package/dist/hooks/useToggle.d.ts +0 -28
- package/dist/hooks/useVirtualScroll.d.ts +0 -42
- package/dist/index.d.ts +0 -271
- package/dist/platform/index.d.ts +0 -172
- package/dist/providers/AppProvider.d.ts +0 -34
- package/dist/providers/index.d.ts +0 -1
- package/dist/theme/ThemeProvider.d.ts +0 -34
- package/dist/theme/ThemeProvider.types.d.ts +0 -21
- package/dist/theme/animations.d.ts +0 -96
- package/dist/theme/defaults.d.ts +0 -6
- package/dist/theme/design-system.d.ts +0 -400
- package/dist/theme/design-tokens.d.ts +0 -459
- package/dist/theme/index.d.ts +0 -187
- package/dist/theme/responsive.d.ts +0 -63
- package/dist/theme/styles.d.ts +0 -65
- package/dist/theme/tokens/colors.d.ts +0 -72
- package/dist/theme/tokens/effects.d.ts +0 -122
- package/dist/theme/tokens/index.d.ts +0 -94
- package/dist/theme/tokens/spacing.d.ts +0 -65
- package/dist/theme/tokens/typography.d.ts +0 -73
- package/dist/theme/types.d.ts +0 -153
- package/dist/theme/useThemeUtils.d.ts +0 -21
- package/dist/theme/utils.d.ts +0 -255
- package/dist/theme/variables.d.ts +0 -170
- package/dist/types/accessibility.d.ts +0 -46
- package/dist/types/button.d.ts +0 -285
- package/dist/types/component-props.d.ts +0 -109
- package/dist/types/index.d.ts +0 -343
- package/dist/types/standardized-components.d.ts +0 -263
- package/dist/types/utils.d.ts +0 -190
- package/dist/utils/abort-controller.d.ts +0 -19
- package/dist/utils/cache.d.ts +0 -28
- package/dist/utils/createNamespace.d.ts +0 -9
- package/dist/utils/environment.d.ts +0 -26
- package/dist/utils/error-handler.d.ts +0 -37
- package/dist/utils/errorLogger.d.ts +0 -72
- package/dist/utils/formatUtils.d.ts +0 -93
- package/dist/utils/http/error-codes.d.ts +0 -131
- package/dist/utils/http/http-client.d.ts +0 -53
- package/dist/utils/http/request-cache.d.ts +0 -65
- package/dist/utils/http/taro-adapter.d.ts +0 -4
- package/dist/utils/http/types.d.ts +0 -351
- package/dist/utils/http/web-adapter.d.ts +0 -4
- package/dist/utils/index.d.ts +0 -46
- package/dist/utils/inputValidator.d.ts +0 -74
- package/dist/utils/performance/performance.d.ts +0 -167
- package/dist/utils/responsiveUtils.d.ts +0 -148
- package/dist/utils/rtl-support.d.ts +0 -78
- package/dist/utils/security/api-security.d.ts +0 -82
- package/dist/utils/security/xss-protection.d.ts +0 -20
- package/dist/utils/securityHeaders.d.ts +0 -74
- package/dist/utils/typeHelpers.d.ts +0 -1
- package/dist/utils/types/dataProcessing.d.ts +0 -111
- package/dist/utils/types/typeHelpers.d.ts +0 -50
- package/dist/utils/xssProtection.d.ts +0 -90
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 性能优化工具函数
|
|
3
|
-
* 包含防抖、节流、懒加载等工具
|
|
4
|
-
*/
|
|
5
|
-
export declare class PerformanceMarker {
|
|
6
|
-
private static markers;
|
|
7
|
-
static start(name: string): void;
|
|
8
|
-
static end(name: string): number;
|
|
9
|
-
static measure(name: string, callback: () => void): number;
|
|
10
|
-
}
|
|
11
|
-
export declare class MemoryManager {
|
|
12
|
-
private static weakRefs;
|
|
13
|
-
private static cleanupCallbacks;
|
|
14
|
-
static createWeakRef(obj: object): number;
|
|
15
|
-
static addCleanup(callback: () => void): void;
|
|
16
|
-
static cleanup(): void;
|
|
17
|
-
static getMemoryInfo(): {
|
|
18
|
-
used: any;
|
|
19
|
-
total: any;
|
|
20
|
-
limit: any;
|
|
21
|
-
usage: number;
|
|
22
|
-
} | null;
|
|
23
|
-
}
|
|
24
|
-
export declare function useDebounce<T extends (...args: unknown[]) => unknown>(callback: T, delay: number): T;
|
|
25
|
-
export declare function useThrottle<T extends (...args: unknown[]) => unknown>(callback: T, delay: number): T;
|
|
26
|
-
export declare function useLazyLoad<T>(loader: () => Promise<T>, deps?: any[]): {
|
|
27
|
-
data: T | null;
|
|
28
|
-
loading: boolean;
|
|
29
|
-
error: Error | null;
|
|
30
|
-
reload: () => void;
|
|
31
|
-
};
|
|
32
|
-
export declare function useIntersectionObserver(callback: (entry: IntersectionObserverEntry) => void, options?: IntersectionObserverInit): (node: Element | null) => void;
|
|
33
|
-
export declare function useResizeObserver(callback: (entry: ResizeObserverEntry) => void): (node: Element | null) => void;
|
|
34
|
-
export declare function usePerformanceMonitor({ enabled, sampleInterval, thresholds, }?: {
|
|
35
|
-
enabled?: boolean;
|
|
36
|
-
sampleInterval?: number;
|
|
37
|
-
thresholds?: {
|
|
38
|
-
fps?: number;
|
|
39
|
-
memory?: number;
|
|
40
|
-
loadTime?: number;
|
|
41
|
-
};
|
|
42
|
-
}): {
|
|
43
|
-
fps: number;
|
|
44
|
-
memory: number;
|
|
45
|
-
loadTime: number;
|
|
46
|
-
isHealthy: boolean;
|
|
47
|
-
};
|
|
48
|
-
export declare function useBatch<T>(callback: (items: T[]) => void, delay?: number): (item: T) => void;
|
|
49
|
-
export declare function useCache<T>(key: string, initialValue: T, deps?: any[]): [T, (value: T) => void];
|
|
50
|
-
export declare function useOptimizedRequest<T>(request: () => Promise<T>, options?: {
|
|
51
|
-
cacheKey?: string;
|
|
52
|
-
cacheTime?: number;
|
|
53
|
-
retryCount?: number;
|
|
54
|
-
retryDelay?: number;
|
|
55
|
-
debounceTime?: number;
|
|
56
|
-
throttleTime?: number;
|
|
57
|
-
}): {
|
|
58
|
-
data: T | null;
|
|
59
|
-
loading: boolean;
|
|
60
|
-
error: Error | null;
|
|
61
|
-
execute: () => void;
|
|
62
|
-
reset: () => void;
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* 防抖函数
|
|
66
|
-
* @param func 需要防抖的函数
|
|
67
|
-
* @param delay 延迟时间(毫秒)
|
|
68
|
-
* @param options 选项
|
|
69
|
-
* @returns 防抖后的函数
|
|
70
|
-
*/
|
|
71
|
-
export declare function debounce<T extends (...args: unknown[]) => unknown>(func: T, delay: number, options?: {
|
|
72
|
-
leading?: boolean;
|
|
73
|
-
trailing?: boolean;
|
|
74
|
-
maxWait?: number;
|
|
75
|
-
}): (...args: Parameters<T>) => void;
|
|
76
|
-
/**
|
|
77
|
-
* 节流函数
|
|
78
|
-
* @param func 需要节流的函数
|
|
79
|
-
* @param limit 时间限制(毫秒)
|
|
80
|
-
* @param options 选项
|
|
81
|
-
* @returns 节流后的函数
|
|
82
|
-
*/
|
|
83
|
-
export declare function throttle<T extends (...args: unknown[]) => unknown>(func: T, limit: number, options?: {
|
|
84
|
-
leading?: boolean;
|
|
85
|
-
trailing?: boolean;
|
|
86
|
-
}): (...args: Parameters<T>) => void;
|
|
87
|
-
/**
|
|
88
|
-
* RAF 节流函数
|
|
89
|
-
* 使用 requestAnimationFrame 实现节流
|
|
90
|
-
* @param func 需要节流的函数
|
|
91
|
-
* @returns 节流后的函数
|
|
92
|
-
*/
|
|
93
|
-
export declare function rafThrottle<T extends (...args: unknown[]) => unknown>(func: T): (...args: Parameters<T>) => void;
|
|
94
|
-
/**
|
|
95
|
-
* 懒加载函数
|
|
96
|
-
* @param loader 加载函数
|
|
97
|
-
* @param options 选项
|
|
98
|
-
* @returns 懒加载的 Promise
|
|
99
|
-
*/
|
|
100
|
-
export declare function lazyLoad<T>(loader: () => Promise<T>, options?: {
|
|
101
|
-
timeout?: number;
|
|
102
|
-
retryCount?: number;
|
|
103
|
-
retryDelay?: number;
|
|
104
|
-
}): Promise<T>;
|
|
105
|
-
/**
|
|
106
|
-
* 图片懒加载
|
|
107
|
-
* @param element 图片元素
|
|
108
|
-
* @param src 图片地址
|
|
109
|
-
* @param options 选项
|
|
110
|
-
*/
|
|
111
|
-
export declare function lazyLoadImage(element: HTMLImageElement, src: string, options?: {
|
|
112
|
-
threshold?: number;
|
|
113
|
-
rootMargin?: string;
|
|
114
|
-
placeholder?: string;
|
|
115
|
-
onLoad?: () => void;
|
|
116
|
-
onError?: () => void;
|
|
117
|
-
}): void;
|
|
118
|
-
/**
|
|
119
|
-
* 批处理函数
|
|
120
|
-
* @param func 需要批处理的函数
|
|
121
|
-
* @param wait 等待时间(毫秒)
|
|
122
|
-
* @returns 批处理后的函数
|
|
123
|
-
*/
|
|
124
|
-
export declare function batch<T extends (...args: any[]) => any>(func: (items: Parameters<T>[]) => void, wait: number): (...args: Parameters<T>) => void;
|
|
125
|
-
/**
|
|
126
|
-
* 记忆化函数
|
|
127
|
-
* @param func 需要记忆化的函数
|
|
128
|
-
* @param keyGenerator 键生成器
|
|
129
|
-
* @returns 记忆化后的函数
|
|
130
|
-
*/
|
|
131
|
-
export declare function memoize<T extends (...args: unknown[]) => unknown>(func: T, keyGenerator?: (...args: Parameters<T>) => string): T;
|
|
132
|
-
/**
|
|
133
|
-
* 性能监控装饰器
|
|
134
|
-
* @param options 选项
|
|
135
|
-
*/
|
|
136
|
-
export declare function performanceMonitor(options?: {
|
|
137
|
-
name?: string;
|
|
138
|
-
threshold?: number;
|
|
139
|
-
logLevel?: 'warn' | 'error' | 'info';
|
|
140
|
-
}): (_target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
141
|
-
/**
|
|
142
|
-
* 请求动画帧优化
|
|
143
|
-
* @param callback 回调函数
|
|
144
|
-
* @returns 取消函数
|
|
145
|
-
*/
|
|
146
|
-
export declare function raf(callback: () => void): () => void;
|
|
147
|
-
/**
|
|
148
|
-
* 空闲时间执行
|
|
149
|
-
* @param callback 回调函数
|
|
150
|
-
* @param options 选项
|
|
151
|
-
*/
|
|
152
|
-
export declare function idleCallback(callback: () => void, options?: {
|
|
153
|
-
timeout?: number;
|
|
154
|
-
}): () => void;
|
|
155
|
-
declare const _default: {
|
|
156
|
-
debounce: typeof debounce;
|
|
157
|
-
throttle: typeof throttle;
|
|
158
|
-
rafThrottle: typeof rafThrottle;
|
|
159
|
-
lazyLoad: typeof lazyLoad;
|
|
160
|
-
lazyLoadImage: typeof lazyLoadImage;
|
|
161
|
-
batch: typeof batch;
|
|
162
|
-
memoize: typeof memoize;
|
|
163
|
-
performanceMonitor: typeof performanceMonitor;
|
|
164
|
-
raf: typeof raf;
|
|
165
|
-
idleCallback: typeof idleCallback;
|
|
166
|
-
};
|
|
167
|
-
export default _default;
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 响应式工具
|
|
3
|
-
* 提供屏幕尺寸检测、断点管理、响应式样式生成等功能,适配Taro.js多平台环境
|
|
4
|
-
*/
|
|
5
|
-
interface BreakpointConfig {
|
|
6
|
-
xs: number;
|
|
7
|
-
sm: number;
|
|
8
|
-
md: number;
|
|
9
|
-
lg: number;
|
|
10
|
-
xl: number;
|
|
11
|
-
'2xl': number;
|
|
12
|
-
}
|
|
13
|
-
type ScreenSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
14
|
-
type ResponsiveValue<T> = T | Partial<Record<ScreenSize, T>>;
|
|
15
|
-
interface ResponsiveStyle {
|
|
16
|
-
[key: string]: ResponsiveValue<string | number>;
|
|
17
|
-
}
|
|
18
|
-
type Platform = 'web' | 'weapp' | 'swan' | 'alipay' | 'tt' | 'qq' | 'h5' | 'rn';
|
|
19
|
-
declare class ResponsiveUtils {
|
|
20
|
-
private breakpoints;
|
|
21
|
-
private platform;
|
|
22
|
-
constructor(breakpoints?: Partial<BreakpointConfig>);
|
|
23
|
-
/**
|
|
24
|
-
* 获取当前屏幕尺寸
|
|
25
|
-
* @param width 屏幕宽度
|
|
26
|
-
* @returns 屏幕尺寸类型
|
|
27
|
-
*/
|
|
28
|
-
getScreenSize(width: number): ScreenSize;
|
|
29
|
-
/**
|
|
30
|
-
* 检查是否匹配指定屏幕尺寸
|
|
31
|
-
* @param size 屏幕尺寸
|
|
32
|
-
* @param currentWidth 当前屏幕宽度
|
|
33
|
-
* @returns 是否匹配
|
|
34
|
-
*/
|
|
35
|
-
matchScreenSize(size: ScreenSize, currentWidth: number): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* 获取响应式值
|
|
38
|
-
* @param value 响应式值
|
|
39
|
-
* @param currentWidth 当前屏幕宽度
|
|
40
|
-
* @returns 匹配的值
|
|
41
|
-
*/
|
|
42
|
-
getResponsiveValue<T>(value: ResponsiveValue<T>, currentWidth: number): T;
|
|
43
|
-
/**
|
|
44
|
-
* 生成响应式样式
|
|
45
|
-
* @param styles 响应式样式对象
|
|
46
|
-
* @param currentWidth 当前屏幕宽度
|
|
47
|
-
* @returns 样式对象
|
|
48
|
-
*/
|
|
49
|
-
generateResponsiveStyles(styles: ResponsiveStyle, currentWidth: number): Record<string, string | number>;
|
|
50
|
-
/**
|
|
51
|
-
* 获取平台特定的样式
|
|
52
|
-
* @param webStyles Web平台样式
|
|
53
|
-
* @param weappStyles 小程序平台样式
|
|
54
|
-
* @param otherStyles 其他平台样式
|
|
55
|
-
* @returns 当前平台的样式
|
|
56
|
-
*/
|
|
57
|
-
getPlatformStyles<T>(webStyles: T, weappStyles: T, otherStyles?: Partial<Record<Platform, T>>): T;
|
|
58
|
-
/**
|
|
59
|
-
* 获取当前平台
|
|
60
|
-
* @returns 平台类型
|
|
61
|
-
*/
|
|
62
|
-
getPlatform(): Platform;
|
|
63
|
-
/**
|
|
64
|
-
* 检查是否为移动设备
|
|
65
|
-
* @param width 屏幕宽度
|
|
66
|
-
* @returns 是否为移动设备
|
|
67
|
-
*/
|
|
68
|
-
isMobile(width: number): boolean;
|
|
69
|
-
/**
|
|
70
|
-
* 检查是否为平板设备
|
|
71
|
-
* @param width 屏幕宽度
|
|
72
|
-
* @returns 是否为平板设备
|
|
73
|
-
*/
|
|
74
|
-
isTablet(width: number): boolean;
|
|
75
|
-
/**
|
|
76
|
-
* 检查是否为桌面设备
|
|
77
|
-
* @param width 屏幕宽度
|
|
78
|
-
* @returns 是否为桌面设备
|
|
79
|
-
*/
|
|
80
|
-
isDesktop(width: number): boolean;
|
|
81
|
-
/**
|
|
82
|
-
* 获取安全区域(适配刘海屏)
|
|
83
|
-
* @returns 安全区域配置
|
|
84
|
-
*/
|
|
85
|
-
getSafeArea(): {
|
|
86
|
-
top: number;
|
|
87
|
-
bottom: number;
|
|
88
|
-
left: number;
|
|
89
|
-
right: number;
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* 获取状态栏高度
|
|
93
|
-
* @returns 状态栏高度
|
|
94
|
-
*/
|
|
95
|
-
getStatusBarHeight(): number;
|
|
96
|
-
/**
|
|
97
|
-
* 获取导航栏高度
|
|
98
|
-
* @returns 导航栏高度
|
|
99
|
-
*/
|
|
100
|
-
getNavigationBarHeight(): number;
|
|
101
|
-
/**
|
|
102
|
-
* 获取胶囊按钮信息(仅小程序)
|
|
103
|
-
* @returns 胶囊按钮信息
|
|
104
|
-
*/
|
|
105
|
-
getMenuButtonBoundingClientRect(): any;
|
|
106
|
-
}
|
|
107
|
-
declare const responsiveUtils: ResponsiveUtils;
|
|
108
|
-
export declare const useResponsive: () => {
|
|
109
|
-
windowWidth: number;
|
|
110
|
-
windowHeight: number;
|
|
111
|
-
screenSize: ScreenSize;
|
|
112
|
-
isMobile: boolean;
|
|
113
|
-
isTablet: boolean;
|
|
114
|
-
isDesktop: boolean;
|
|
115
|
-
platform: Platform;
|
|
116
|
-
safeArea: {
|
|
117
|
-
top: number;
|
|
118
|
-
bottom: number;
|
|
119
|
-
left: number;
|
|
120
|
-
right: number;
|
|
121
|
-
};
|
|
122
|
-
statusBarHeight: number;
|
|
123
|
-
navigationBarHeight: number;
|
|
124
|
-
getResponsiveValue: <T>(value: ResponsiveValue<T>) => T;
|
|
125
|
-
generateResponsiveStyles: (styles: ResponsiveStyle) => Record<string, string | number>;
|
|
126
|
-
getPlatformStyles: <T>(webStyles: T, weappStyles: T, otherStyles?: Partial<Record<Platform, T>>) => T;
|
|
127
|
-
matchScreenSize: (size: ScreenSize) => boolean;
|
|
128
|
-
};
|
|
129
|
-
export declare const getScreenSize: (width: number) => ScreenSize;
|
|
130
|
-
export declare const matchScreenSize: (size: ScreenSize, width: number) => boolean;
|
|
131
|
-
export declare const getResponsiveValue: <T>(value: ResponsiveValue<T>, width: number) => T;
|
|
132
|
-
export declare const generateResponsiveStyles: (styles: ResponsiveStyle, width: number) => Record<string, string | number>;
|
|
133
|
-
export declare const getPlatformStyles: <T>(webStyles: T, weappStyles: T, otherStyles?: Partial<Record<Platform, T>>) => T;
|
|
134
|
-
export declare const getPlatform: () => Platform;
|
|
135
|
-
export declare const isMobile: (width: number) => boolean;
|
|
136
|
-
export declare const isTablet: (width: number) => boolean;
|
|
137
|
-
export declare const isDesktop: (width: number) => boolean;
|
|
138
|
-
export declare const getSafeArea: () => {
|
|
139
|
-
top: number;
|
|
140
|
-
bottom: number;
|
|
141
|
-
left: number;
|
|
142
|
-
right: number;
|
|
143
|
-
};
|
|
144
|
-
export declare const getStatusBarHeight: () => number;
|
|
145
|
-
export declare const getNavigationBarHeight: () => number;
|
|
146
|
-
export declare const getMenuButtonBoundingClientRect: () => any;
|
|
147
|
-
export type { BreakpointConfig, ScreenSize, ResponsiveValue, ResponsiveStyle, Platform };
|
|
148
|
-
export default responsiveUtils;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RTL语言支持工具
|
|
3
|
-
* 提供RTL检测、样式切换和布局调整功能
|
|
4
|
-
*/
|
|
5
|
-
type SupportedLanguage = 'ar-SA' | 'he-IL' | 'fa-IR' | 'ur-PK' | string;
|
|
6
|
-
export declare const RTL_LANGUAGES: SupportedLanguage[];
|
|
7
|
-
export interface RTLConfig {
|
|
8
|
-
language: SupportedLanguage;
|
|
9
|
-
name: string;
|
|
10
|
-
rtl: boolean;
|
|
11
|
-
fontFamily: string;
|
|
12
|
-
textAlign: 'right' | 'left';
|
|
13
|
-
direction: 'rtl' | 'ltr';
|
|
14
|
-
flipProperties: boolean;
|
|
15
|
-
flipIcons: boolean;
|
|
16
|
-
adjustSpacing: boolean;
|
|
17
|
-
adjustAlignment: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare const RTL_CONFIGS: Record<string, RTLConfig>;
|
|
20
|
-
export declare const isRTL: (language: string) => boolean;
|
|
21
|
-
export declare const applyRTLStyles: (language: string) => void;
|
|
22
|
-
export declare const getRTLConfig: (language: string) => RTLConfig | null;
|
|
23
|
-
export declare const generateRTLVariables: (language: string) => string;
|
|
24
|
-
export declare const generateRTLClasses: () => string;
|
|
25
|
-
export declare const useRTLDetection: (language: string) => {
|
|
26
|
-
isRTL: boolean;
|
|
27
|
-
};
|
|
28
|
-
export declare const toggleRTL: (language: string) => string;
|
|
29
|
-
export declare const getDirectionalStyles: (language: string) => {
|
|
30
|
-
direction: string;
|
|
31
|
-
textAlign: string;
|
|
32
|
-
marginStart: string;
|
|
33
|
-
marginEnd: string;
|
|
34
|
-
paddingStart: string;
|
|
35
|
-
paddingEnd: string;
|
|
36
|
-
borderStart: string;
|
|
37
|
-
borderEnd: string;
|
|
38
|
-
borderRadiusStart: string;
|
|
39
|
-
borderRadiusEnd: string;
|
|
40
|
-
floatStart: string;
|
|
41
|
-
floatEnd: string;
|
|
42
|
-
positionStart: string;
|
|
43
|
-
positionEnd: string;
|
|
44
|
-
};
|
|
45
|
-
export declare const getRTLValue: (_property: string, language: string, ltrValue: string, rtlValue?: string) => string;
|
|
46
|
-
export declare const applyRTLClasses: (element: HTMLElement, language: string) => void;
|
|
47
|
-
export declare const createRTLCSS: (css: string, language: string) => string;
|
|
48
|
-
declare const _default: {
|
|
49
|
-
isRTL: (language: string) => boolean;
|
|
50
|
-
applyRTLStyles: (language: string) => void;
|
|
51
|
-
getRTLConfig: (language: string) => RTLConfig | null;
|
|
52
|
-
generateRTLVariables: (language: string) => string;
|
|
53
|
-
generateRTLClasses: () => string;
|
|
54
|
-
useRTLDetection: (language: string) => {
|
|
55
|
-
isRTL: boolean;
|
|
56
|
-
};
|
|
57
|
-
toggleRTL: (language: string) => string;
|
|
58
|
-
getDirectionalStyles: (language: string) => {
|
|
59
|
-
direction: string;
|
|
60
|
-
textAlign: string;
|
|
61
|
-
marginStart: string;
|
|
62
|
-
marginEnd: string;
|
|
63
|
-
paddingStart: string;
|
|
64
|
-
paddingEnd: string;
|
|
65
|
-
borderStart: string;
|
|
66
|
-
borderEnd: string;
|
|
67
|
-
borderRadiusStart: string;
|
|
68
|
-
borderRadiusEnd: string;
|
|
69
|
-
floatStart: string;
|
|
70
|
-
floatEnd: string;
|
|
71
|
-
positionStart: string;
|
|
72
|
-
positionEnd: string;
|
|
73
|
-
};
|
|
74
|
-
getRTLValue: (_property: string, language: string, ltrValue: string, rtlValue?: string) => string;
|
|
75
|
-
applyRTLClasses: (element: HTMLElement, language: string) => void;
|
|
76
|
-
createRTLCSS: (css: string, language: string) => string;
|
|
77
|
-
};
|
|
78
|
-
export default _default;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API安全工具函数
|
|
3
|
-
* 提供请求拦截、签名机制和敏感数据脱敏功能
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 生成请求签名
|
|
7
|
-
*/
|
|
8
|
-
export declare const generateSignature: (method: string, url: string, data: any, timestamp: number) => string;
|
|
9
|
-
/**
|
|
10
|
-
* 验证请求签名
|
|
11
|
-
*/
|
|
12
|
-
export declare const verifySignature: (method: string, url: string, data: any, timestamp: number, signature: string) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* 检查请求是否过期
|
|
15
|
-
*/
|
|
16
|
-
export declare const isRequestExpired: (timestamp: number, maxAge?: number) => boolean;
|
|
17
|
-
/**
|
|
18
|
-
* 敏感数据脱敏
|
|
19
|
-
*/
|
|
20
|
-
export declare const maskSensitiveData: (data: any, customMaskFields?: string[]) => any;
|
|
21
|
-
/**
|
|
22
|
-
* 安全的请求头构建
|
|
23
|
-
*/
|
|
24
|
-
export declare const buildSecureHeaders: (method: string, url: string, data?: any) => Record<string, string>;
|
|
25
|
-
/**
|
|
26
|
-
* 验证请求头安全性
|
|
27
|
-
*/
|
|
28
|
-
export declare const validateHeaders: (headers: Record<string, string>) => {
|
|
29
|
-
valid: boolean;
|
|
30
|
-
errors: string[];
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* API请求拦截器
|
|
34
|
-
*/
|
|
35
|
-
export declare const createApiInterceptor: () => {
|
|
36
|
-
request: {
|
|
37
|
-
use: (interceptor: (config: any) => any) => void;
|
|
38
|
-
execute: (config: any) => any;
|
|
39
|
-
};
|
|
40
|
-
response: {
|
|
41
|
-
use: (interceptor: (response: any) => any) => void;
|
|
42
|
-
execute: (response: any) => any;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* 检查URL安全性
|
|
47
|
-
*/
|
|
48
|
-
export declare const isSecureUrl: (url: string) => boolean;
|
|
49
|
-
/**
|
|
50
|
-
* 安全的请求重试机制
|
|
51
|
-
*/
|
|
52
|
-
export declare const secureRetry: <T>(fn: () => Promise<T>, maxRetries?: number, delay?: number) => Promise<T>;
|
|
53
|
-
declare const _default: {
|
|
54
|
-
generateSignature: (method: string, url: string, data: any, timestamp: number) => string;
|
|
55
|
-
verifySignature: (method: string, url: string, data: any, timestamp: number, signature: string) => boolean;
|
|
56
|
-
maskSensitiveData: (data: any, customMaskFields?: string[]) => any;
|
|
57
|
-
buildSecureHeaders: (method: string, url: string, data?: any) => Record<string, string>;
|
|
58
|
-
validateHeaders: (headers: Record<string, string>) => {
|
|
59
|
-
valid: boolean;
|
|
60
|
-
errors: string[];
|
|
61
|
-
};
|
|
62
|
-
createApiInterceptor: () => {
|
|
63
|
-
request: {
|
|
64
|
-
use: (interceptor: (config: any) => any) => void;
|
|
65
|
-
execute: (config: any) => any;
|
|
66
|
-
};
|
|
67
|
-
response: {
|
|
68
|
-
use: (interceptor: (response: any) => any) => void;
|
|
69
|
-
execute: (response: any) => any;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
isSecureUrl: (url: string) => boolean;
|
|
73
|
-
secureRetry: <T>(fn: () => Promise<T>, maxRetries?: number, delay?: number) => Promise<T>;
|
|
74
|
-
MASK_CONFIG: {
|
|
75
|
-
email: (email: string) => string;
|
|
76
|
-
phone: (phone: string) => string;
|
|
77
|
-
idCard: (idCard: string) => string;
|
|
78
|
-
creditCard: (cardNumber: string) => string;
|
|
79
|
-
default: (str: string, visibleStart?: number, visibleEnd?: number) => string;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
export default _default;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* XSS防护工具函数
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* 转义HTML特殊字符
|
|
6
|
-
*/
|
|
7
|
-
export declare function escapeHtml(text: string): string;
|
|
8
|
-
export declare function sanitizeText(text: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* 净化HTML内容
|
|
11
|
-
*/
|
|
12
|
-
export declare function sanitizeHtml(html: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* 验证URL安全性
|
|
15
|
-
*/
|
|
16
|
-
export declare function isSafeUrl(url: string): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* CSP头生成器
|
|
19
|
-
*/
|
|
20
|
-
export declare function generateCSPHeader(): string;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 安全头部设置工具
|
|
3
|
-
* 提供HTTP安全头部设置功能,增强应用安全性
|
|
4
|
-
*/
|
|
5
|
-
interface SecurityHeadersConfig {
|
|
6
|
-
contentSecurityPolicy?: boolean | string;
|
|
7
|
-
strictTransportSecurity?: boolean | string;
|
|
8
|
-
xContentTypeOptions?: boolean;
|
|
9
|
-
xFrameOptions?: boolean | string;
|
|
10
|
-
xXSSProtection?: boolean | string;
|
|
11
|
-
referrerPolicy?: boolean | string;
|
|
12
|
-
permissionsPolicy?: boolean | string;
|
|
13
|
-
expectCT?: boolean | string;
|
|
14
|
-
}
|
|
15
|
-
interface SecurityHeadersResult {
|
|
16
|
-
headers: Record<string, string>;
|
|
17
|
-
cspNonce?: string | undefined;
|
|
18
|
-
}
|
|
19
|
-
declare class SecurityHeaders {
|
|
20
|
-
private defaultConfig;
|
|
21
|
-
/**
|
|
22
|
-
* 生成安全头部
|
|
23
|
-
* @param config 配置选项
|
|
24
|
-
* @returns 安全头部对象
|
|
25
|
-
*/
|
|
26
|
-
generateHeaders(config?: SecurityHeadersConfig): SecurityHeadersResult;
|
|
27
|
-
/**
|
|
28
|
-
* 生成内容安全策略
|
|
29
|
-
* @returns CSP字符串
|
|
30
|
-
*/
|
|
31
|
-
private generateCSP;
|
|
32
|
-
/**
|
|
33
|
-
* 生成权限策略
|
|
34
|
-
* @returns 权限策略字符串
|
|
35
|
-
*/
|
|
36
|
-
private generatePermissionsPolicy;
|
|
37
|
-
/**
|
|
38
|
-
* 生成随机nonce值
|
|
39
|
-
* @returns nonce字符串
|
|
40
|
-
*/
|
|
41
|
-
private generateNonce;
|
|
42
|
-
/**
|
|
43
|
-
* 为API请求添加安全头部
|
|
44
|
-
* @param originalHeaders 原始头部对象
|
|
45
|
-
* @param config 配置选项
|
|
46
|
-
* @returns 增强后的头部对象
|
|
47
|
-
*/
|
|
48
|
-
addSecurityHeadersToRequest(originalHeaders?: Record<string, string>, config?: SecurityHeadersConfig): Record<string, string>;
|
|
49
|
-
/**
|
|
50
|
-
* 为响应添加安全头部
|
|
51
|
-
* @param originalHeaders 原始头部对象
|
|
52
|
-
* @param config 配置选项
|
|
53
|
-
* @returns 增强后的头部对象
|
|
54
|
-
*/
|
|
55
|
-
addSecurityHeadersToResponse(originalHeaders?: Record<string, string>, config?: SecurityHeadersConfig): Record<string, string>;
|
|
56
|
-
/**
|
|
57
|
-
* 验证CSP合规性
|
|
58
|
-
* @param csp CSP字符串
|
|
59
|
-
* @returns 验证结果
|
|
60
|
-
*/
|
|
61
|
-
validateCSP(csp: string): {
|
|
62
|
-
isValid: boolean;
|
|
63
|
-
errors: string[];
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
declare const securityHeaders: SecurityHeaders;
|
|
67
|
-
export declare const generateSecurityHeaders: (config?: SecurityHeadersConfig) => SecurityHeadersResult;
|
|
68
|
-
export declare const addSecurityHeadersToRequest: (headers?: Record<string, string>, config?: SecurityHeadersConfig) => Record<string, string>;
|
|
69
|
-
export declare const addSecurityHeadersToResponse: (headers?: Record<string, string>, config?: SecurityHeadersConfig) => Record<string, string>;
|
|
70
|
-
export declare const validateCSP: (csp: string) => {
|
|
71
|
-
isValid: boolean;
|
|
72
|
-
errors: string[];
|
|
73
|
-
};
|
|
74
|
-
export default securityHeaders;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function deepEqual(a: any, b: any): boolean;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 数据处理工具函数库
|
|
3
|
-
* 提供通用的数据处理逻辑,包括数据转换、过滤、排序、聚合等
|
|
4
|
-
*/
|
|
5
|
-
/** 数据转换工具类 */
|
|
6
|
-
export declare class DataTransformUtils {
|
|
7
|
-
/** 深度克隆对象 */
|
|
8
|
-
static deepClone<T>(obj: T): T;
|
|
9
|
-
/** 对象转数组 */
|
|
10
|
-
static objectToArray<T extends Record<string, any>>(obj: T, keyField?: string, valueField?: string): Array<{
|
|
11
|
-
[K in typeof keyField | typeof valueField]: any;
|
|
12
|
-
}>;
|
|
13
|
-
/** 数组转对象 */
|
|
14
|
-
static arrayToObject<T extends Record<string, any>, K extends keyof T>(array: T[], keyField: K): Record<string, T>;
|
|
15
|
-
/** 扁平化嵌套对象 */
|
|
16
|
-
static flattenObject(obj: Record<string, any>, prefix?: string): Record<string, any>;
|
|
17
|
-
/** 反扁平化对象 */
|
|
18
|
-
static unflattenObject(obj: Record<string, any>): Record<string, any>;
|
|
19
|
-
/** 格式化数字 */
|
|
20
|
-
static formatNumber(num: number, options?: {
|
|
21
|
-
minimumFractionDigits?: number;
|
|
22
|
-
maximumFractionDigits?: number;
|
|
23
|
-
useGrouping?: boolean;
|
|
24
|
-
currency?: string;
|
|
25
|
-
style?: 'decimal' | 'currency' | 'percent';
|
|
26
|
-
}): string;
|
|
27
|
-
/** 格式化字节大小 */
|
|
28
|
-
static formatBytes(bytes: number, decimals?: number): string;
|
|
29
|
-
/** 格式化时长 */
|
|
30
|
-
static formatDuration(seconds: number): string;
|
|
31
|
-
}
|
|
32
|
-
/** 数据过滤工具类 */
|
|
33
|
-
export declare class DataFilterUtils {
|
|
34
|
-
/** 过滤空值 */
|
|
35
|
-
static filterEmpty<T>(array: T[]): T[];
|
|
36
|
-
/** 过滤重复值 */
|
|
37
|
-
static filterDuplicates<T>(array: T[], key?: keyof T): T[];
|
|
38
|
-
/** 过滤范围 */
|
|
39
|
-
static filterRange<T>(array: T[], key: keyof T, min: number, max: number): T[];
|
|
40
|
-
/** 模糊搜索 */
|
|
41
|
-
static fuzzySearch<T>(array: T[], searchTerm: string, searchFields: (keyof T)[]): T[];
|
|
42
|
-
/** 高级搜索 */
|
|
43
|
-
static advancedSearch<T>(array: T[], conditions: Array<{
|
|
44
|
-
field: keyof T;
|
|
45
|
-
operator: 'equals' | 'contains' | 'startsWith' | 'endsWith' | 'greater' | 'less' | 'between';
|
|
46
|
-
value: any;
|
|
47
|
-
value2?: any;
|
|
48
|
-
}>): T[];
|
|
49
|
-
}
|
|
50
|
-
interface SortOptions<T> {
|
|
51
|
-
key?: keyof T;
|
|
52
|
-
direction?: 'asc' | 'desc';
|
|
53
|
-
customSort?: (a: T, b: T) => number;
|
|
54
|
-
}
|
|
55
|
-
/** 数据排序工具类 */
|
|
56
|
-
export declare class DataSortUtils {
|
|
57
|
-
/** 基础排序 */
|
|
58
|
-
static sort<T>(array: T[], options?: SortOptions<T>): T[];
|
|
59
|
-
/** 多字段排序 */
|
|
60
|
-
static multiSort<T>(array: T[], sortFields: Array<keyof T & string>): T[];
|
|
61
|
-
/** 自然排序 */
|
|
62
|
-
static naturalSort<T>(array: T[], key?: keyof T): T[];
|
|
63
|
-
/** 随机排序 */
|
|
64
|
-
static shuffle<T>(array: T[]): T[];
|
|
65
|
-
}
|
|
66
|
-
/** 数据聚合工具类 */
|
|
67
|
-
export declare class DataAggregateUtils {
|
|
68
|
-
/** 分组 */
|
|
69
|
-
static groupBy<T, K extends keyof T>(array: T[], key: K): Record<string, T[]>;
|
|
70
|
-
/** 多字段分组 */
|
|
71
|
-
static groupByMultiple<T, K extends keyof T>(array: T[], keys: K[]): Record<string, T[]>;
|
|
72
|
-
/** 统计 */
|
|
73
|
-
static aggregate<T, K extends keyof T>(array: T[], groupKey: K, aggregateField: keyof T, aggregateType?: 'sum' | 'avg' | 'count' | 'min' | 'max'): Record<string, number>;
|
|
74
|
-
/** 分页 */
|
|
75
|
-
static paginate<T>(array: T[], page: number, pageSize: number): {
|
|
76
|
-
data: T[];
|
|
77
|
-
total: number;
|
|
78
|
-
totalPages: number;
|
|
79
|
-
page: number;
|
|
80
|
-
pageSize: number;
|
|
81
|
-
};
|
|
82
|
-
/** 透视表 */
|
|
83
|
-
static pivot<T>(data: T[], rowField: keyof T, columnField: keyof T, valueField: keyof T, aggregateType?: 'sum' | 'avg' | 'count'): Record<string, Record<string, number>>;
|
|
84
|
-
}
|
|
85
|
-
/** 数据验证工具类 */
|
|
86
|
-
export declare class DataValidationUtils {
|
|
87
|
-
/** 验证邮箱 */
|
|
88
|
-
static isValidEmail(email: string): boolean;
|
|
89
|
-
/** 验证手机号 */
|
|
90
|
-
static isValidPhone(phone: string): boolean;
|
|
91
|
-
/** 验证身份证号 */
|
|
92
|
-
static isValidIdCard(idCard: string): boolean;
|
|
93
|
-
/** 验证URL */
|
|
94
|
-
static isValidUrl(url: string): boolean;
|
|
95
|
-
/** 验证数据完整性 */
|
|
96
|
-
static validateDataIntegrity<T>(data: T, requiredFields: (keyof T)[]): {
|
|
97
|
-
isValid: boolean;
|
|
98
|
-
missingFields: (keyof T)[];
|
|
99
|
-
};
|
|
100
|
-
/** 验证数据类型 */
|
|
101
|
-
static validateDataTypes<T>(data: T, typeRules: Partial<Record<keyof T, 'string' | 'number' | 'boolean' | 'array' | 'object'>>): {
|
|
102
|
-
isValid: boolean;
|
|
103
|
-
typeErrors: Record<string, string>;
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
export declare const dataTransform: typeof DataTransformUtils;
|
|
107
|
-
export declare const dataFilter: typeof DataFilterUtils;
|
|
108
|
-
export declare const dataSort: typeof DataSortUtils;
|
|
109
|
-
export declare const dataAggregate: typeof DataAggregateUtils;
|
|
110
|
-
export declare const dataValidate: typeof DataValidationUtils;
|
|
111
|
-
export {};
|