@zero-library/common 2.2.2 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +270 -98
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +14 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +82 -37
- package/dist/index.d.ts +82 -37
- package/dist/index.esm.js +254 -85
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -19,7 +19,20 @@ interface AudioPlayerProps {
|
|
|
19
19
|
* 提供基本的音频播放功能
|
|
20
20
|
* @param props - 组件属性
|
|
21
21
|
*/
|
|
22
|
-
declare const _default$
|
|
22
|
+
declare const _default$p: ({ fileUrl }: AudioPlayerProps) => react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
/** Docx文档预览组件的属性接口 */
|
|
25
|
+
interface DocxPreviewProps {
|
|
26
|
+
/** 文档文件的URL地址 */
|
|
27
|
+
fileUrl: string;
|
|
28
|
+
/** 缩放比例,默认为1 */
|
|
29
|
+
scale?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Docx文档预览组件
|
|
33
|
+
* @param props - 组件属性
|
|
34
|
+
*/
|
|
35
|
+
declare const _default$o: ({ fileUrl, scale }: DocxPreviewProps) => react_jsx_runtime.JSX.Element;
|
|
23
36
|
|
|
24
37
|
/**
|
|
25
38
|
* 文件图标组件属性接口
|
|
@@ -45,7 +58,7 @@ interface FileIconProps {
|
|
|
45
58
|
* @param props - 组件属性
|
|
46
59
|
* @returns 对应文件类型的图标
|
|
47
60
|
*/
|
|
48
|
-
declare const _default$
|
|
61
|
+
declare const _default$n: ({ suffix, fontSize }: FileIconProps) => react_jsx_runtime.JSX.Element;
|
|
49
62
|
|
|
50
63
|
/**
|
|
51
64
|
* 文件预览组件属性接口
|
|
@@ -55,7 +68,7 @@ interface FilePreviewProps {
|
|
|
55
68
|
fileUrl: string;
|
|
56
69
|
/** 文件后缀名 */
|
|
57
70
|
suffix?: string;
|
|
58
|
-
/**
|
|
71
|
+
/** 文件密码 */
|
|
59
72
|
password?: string;
|
|
60
73
|
/** 搜索关键字 */
|
|
61
74
|
searchValue?: string;
|
|
@@ -80,39 +93,18 @@ interface FilePreviewProps {
|
|
|
80
93
|
* 支持图片、PDF、视频、音频、Markdown等文件格式的预览
|
|
81
94
|
* @param props - 组件属性
|
|
82
95
|
*/
|
|
83
|
-
declare const _default$
|
|
96
|
+
declare const _default$m: ({ suffix, fileUrl, pdfParams, password, searchValue }: FilePreviewProps) => react_jsx_runtime.JSX.Element;
|
|
84
97
|
|
|
85
98
|
/**
|
|
86
99
|
* 文件预览抽屉组件属性接口
|
|
87
100
|
*/
|
|
88
|
-
interface FilePreviewDrawerProps {
|
|
101
|
+
interface FilePreviewDrawerProps extends FilePreviewProps {
|
|
89
102
|
/** 是否打开抽屉 */
|
|
90
103
|
open: boolean;
|
|
91
104
|
/** 关闭抽屉的回调函数 */
|
|
92
105
|
onClose: () => void;
|
|
93
106
|
/** 抽屉标题,默认为'文件预览' */
|
|
94
107
|
title?: string;
|
|
95
|
-
/** 文件URL地址 */
|
|
96
|
-
fileUrl: string;
|
|
97
|
-
/** 文件后缀名 */
|
|
98
|
-
suffix?: string;
|
|
99
|
-
/** PDF文件密码 */
|
|
100
|
-
password?: string;
|
|
101
|
-
/** 文件参数 */
|
|
102
|
-
fileParams?: ObjectType<string>;
|
|
103
|
-
/** PDF预览参数 */
|
|
104
|
-
pdfParams?: {
|
|
105
|
-
/** 当前页码 */
|
|
106
|
-
pageNo?: number;
|
|
107
|
-
/** 缩放比例 */
|
|
108
|
-
scale?: number;
|
|
109
|
-
/** 是否显示缩略图 */
|
|
110
|
-
isHasThumbnails?: boolean;
|
|
111
|
-
/** 页码变化回调 */
|
|
112
|
-
onSetPageNo?: (pageNo: number) => void;
|
|
113
|
-
};
|
|
114
|
-
/** 密码设置成功回调 */
|
|
115
|
-
onSetPassSuccess?: () => void;
|
|
116
108
|
}
|
|
117
109
|
/**
|
|
118
110
|
* 文件预览抽屉组件
|
|
@@ -131,7 +123,7 @@ interface FilePreviewDrawerProps {
|
|
|
131
123
|
* @param props - 组件属性
|
|
132
124
|
* @returns 文件预览抽屉组件
|
|
133
125
|
*/
|
|
134
|
-
declare const _default$
|
|
126
|
+
declare const _default$l: ({ open, title, onClose, ...props }: FilePreviewDrawerProps) => react_jsx_runtime.JSX.Element;
|
|
135
127
|
|
|
136
128
|
/**
|
|
137
129
|
* Markdown预览组件属性接口
|
|
@@ -147,7 +139,7 @@ interface MarkdownPreviewProps {
|
|
|
147
139
|
* 从指定URL获取Markdown内容并渲染显示
|
|
148
140
|
* @param props - 组件属性
|
|
149
141
|
*/
|
|
150
|
-
declare const _default$
|
|
142
|
+
declare const _default$k: ({ fileUrl, searchValue }: MarkdownPreviewProps) => react_jsx_runtime.JSX.Element;
|
|
151
143
|
|
|
152
144
|
/**
|
|
153
145
|
* PDF预览组件属性接口
|
|
@@ -174,7 +166,7 @@ interface PdfPreviewProps {
|
|
|
174
166
|
* 支持密码保护、缩略图、缩放、页面导航等功能
|
|
175
167
|
* @param props - 组件属性
|
|
176
168
|
*/
|
|
177
|
-
declare const _default$
|
|
169
|
+
declare const _default$j: ({ password, fileUrl, pageNo, scale, isHasThumbnails, onSetPassword, onSetPageNo }: PdfPreviewProps) => react_jsx_runtime.JSX.Element;
|
|
178
170
|
|
|
179
171
|
/**
|
|
180
172
|
* 视频播放器组件属性接口
|
|
@@ -188,7 +180,7 @@ interface VideoPlayerProps {
|
|
|
188
180
|
* 提供基本的视频播放功能
|
|
189
181
|
* @param props - 组件属性
|
|
190
182
|
*/
|
|
191
|
-
declare const _default$
|
|
183
|
+
declare const _default$i: ({ fileUrl }: VideoPlayerProps) => react_jsx_runtime.JSX.Element;
|
|
192
184
|
|
|
193
185
|
/**
|
|
194
186
|
* Iframe组件属性接口
|
|
@@ -210,7 +202,7 @@ interface IframeProps {
|
|
|
210
202
|
* 支持加载状态、URL参数处理、防缓存等功能
|
|
211
203
|
* @param props - 组件属性
|
|
212
204
|
*/
|
|
213
|
-
declare const _default$
|
|
205
|
+
declare const _default$h: react.ForwardRefExoticComponent<IframeProps & react.RefAttributes<HTMLIFrameElement>>;
|
|
214
206
|
|
|
215
207
|
/**
|
|
216
208
|
* 组件映射类型,用于延时加载
|
|
@@ -235,7 +227,7 @@ interface LazyComponentProps {
|
|
|
235
227
|
* 使用示例:<LazyComponent type="renderMarkdown" data={{}} loading={true} />
|
|
236
228
|
* @param props - 组件属性
|
|
237
229
|
*/
|
|
238
|
-
declare const _default$
|
|
230
|
+
declare const _default$g: ({ type, customComponents, ...rest }: LazyComponentProps) => react_jsx_runtime.JSX.Element;
|
|
239
231
|
|
|
240
232
|
/**
|
|
241
233
|
* Markdown编辑器组件属性接口
|
|
@@ -266,7 +258,7 @@ interface MarkdownEditorProps {
|
|
|
266
258
|
* 提供丰富的编辑功能:格式化、链接、图片、表格、高亮等
|
|
267
259
|
* @param props - 组件属性
|
|
268
260
|
*/
|
|
269
|
-
declare const _default$
|
|
261
|
+
declare const _default$f: ({ value, onChange, onScrollPage, searchValue, disabled, extraNav, showToolbar, onQuote, onDownloadFile }: MarkdownEditorProps) => react_jsx_runtime.JSX.Element;
|
|
270
262
|
|
|
271
263
|
/**
|
|
272
264
|
* Markdown渲染组件属性接口
|
|
@@ -287,7 +279,7 @@ interface RenderMarkdownProps {
|
|
|
287
279
|
* 支持自定义组件、搜索高亮等功能
|
|
288
280
|
* @param RenderMarkdownProps - 组件属性
|
|
289
281
|
*/
|
|
290
|
-
declare const _default$
|
|
282
|
+
declare const _default$e: ({ content, searchValue, customComponents, ...rest }: RenderMarkdownProps) => react_jsx_runtime.JSX.Element;
|
|
291
283
|
|
|
292
284
|
/**
|
|
293
285
|
* 渲染控制对象类型
|
|
@@ -339,7 +331,7 @@ interface RenderWrapperProps<C, P> {
|
|
|
339
331
|
* @param props - 组件属性
|
|
340
332
|
* @returns 渲染的组件或null
|
|
341
333
|
*/
|
|
342
|
-
declare const _default$
|
|
334
|
+
declare const _default$d: react.ForwardRefExoticComponent<RenderWrapperProps<unknown, unknown> & react.RefAttributes<unknown>>;
|
|
343
335
|
|
|
344
336
|
/**
|
|
345
337
|
* 判断是否应该渲染组件
|
|
@@ -359,6 +351,44 @@ declare function propsMerge(control?: RenderControl<any, any> | null, props?: Ob
|
|
|
359
351
|
props: any;
|
|
360
352
|
};
|
|
361
353
|
|
|
354
|
+
type SpeechPermission = 'granted' | 'denied' | 'prompt' | 'unsupported';
|
|
355
|
+
type SpeechProps = {
|
|
356
|
+
/**
|
|
357
|
+
* 识别结果回调函数
|
|
358
|
+
*/
|
|
359
|
+
onResult: (text: string) => void;
|
|
360
|
+
/**
|
|
361
|
+
* 语言,默认为中文
|
|
362
|
+
*/
|
|
363
|
+
lang?: string;
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* 语音识别 Hook
|
|
367
|
+
* @param onResult 识别结果回调函数
|
|
368
|
+
* @param lang 语言,默认为中文
|
|
369
|
+
* @returns 返回权限状态、录音状态和控制方法
|
|
370
|
+
*/
|
|
371
|
+
declare const _default$c: ({ onResult, lang }: SpeechProps) => {
|
|
372
|
+
/**
|
|
373
|
+
* 权限状态
|
|
374
|
+
*/
|
|
375
|
+
permission: SpeechPermission;
|
|
376
|
+
/**
|
|
377
|
+
* 录音状态
|
|
378
|
+
*/
|
|
379
|
+
isRecording: boolean;
|
|
380
|
+
/** 开始语音识别 */
|
|
381
|
+
start: () => void;
|
|
382
|
+
/** 停止语音识别 */
|
|
383
|
+
stop: () => void;
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* 语音按钮
|
|
388
|
+
* @param SpeechProps
|
|
389
|
+
*/
|
|
390
|
+
declare const _default$b: (props: SpeechProps) => react_jsx_runtime.JSX.Element;
|
|
391
|
+
|
|
362
392
|
/**
|
|
363
393
|
* 用户头像组件属性接口
|
|
364
394
|
*/
|
|
@@ -700,6 +730,22 @@ declare const objToOptions: (obj: Record<string, string> | string[], filter?: (k
|
|
|
700
730
|
declare const arrToObj: <T>(arr: T[], key: string) => {
|
|
701
731
|
[key: string]: T;
|
|
702
732
|
};
|
|
733
|
+
/**
|
|
734
|
+
* setInterval函数返回的控制对象类型接口
|
|
735
|
+
* 提供对定时器运行状态的检查和取消操作
|
|
736
|
+
*/
|
|
737
|
+
interface SetIntervalType {
|
|
738
|
+
/**
|
|
739
|
+
* 检查定时器是否正在运行
|
|
740
|
+
* @returns boolean - true表示正在运行,false表示已停止
|
|
741
|
+
*/
|
|
742
|
+
isRun: () => boolean;
|
|
743
|
+
/**
|
|
744
|
+
* 取消定时器
|
|
745
|
+
* 调用后将停止后续的函数执行并清理资源
|
|
746
|
+
*/
|
|
747
|
+
cancel: () => void;
|
|
748
|
+
}
|
|
703
749
|
/**
|
|
704
750
|
* 使用 setTimeout 模拟 setInterval,避免堆积
|
|
705
751
|
*
|
|
@@ -1082,7 +1128,6 @@ declare function aesEncrypt<T = any>(data: T, key: string): string;
|
|
|
1082
1128
|
* @returns 解密后的数据,解密失败时返回null
|
|
1083
1129
|
*/
|
|
1084
1130
|
declare function aesDecrypt<T = any>(data: string, key: string): T | null;
|
|
1085
|
-
declare const formatKB: (kbNum?: number) => string;
|
|
1086
1131
|
type SizeUnit = 'B' | 'KB' | 'MB' | 'GB' | 'TB' | 'PB';
|
|
1087
1132
|
interface FormatSizeOptions {
|
|
1088
1133
|
/** 起始单位,默认 KB */
|
|
@@ -2212,4 +2257,4 @@ declare function createTokenManager({ key, storage }: TokenManagerProps): {
|
|
|
2212
2257
|
clear: () => void;
|
|
2213
2258
|
};
|
|
2214
2259
|
|
|
2215
|
-
export { _default$
|
|
2260
|
+
export { _default$p as AudioPlayer, type AudioPlayerProps, BusinessCode, type CacheMessage, type ComponentMapType, DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, DEFAULT_YEAR_MONTH_DAY_FORMAT, DEFAULT_YEAR_MONTH_FORMAT, _default$o as DocxPreview, type DocxPreviewProps, _default$n as FileIcon, type FileIconProps, _default$m as FilePreview, _default$l as FilePreviewDrawer, type FilePreviewDrawerProps, type FilePreviewProps, type FormatSizeOptions, HttpStatus, _default$h as Iframe, type IframeProps, _default$g as LazyComponent, type LazyComponentProps, _default$f as MarkdownEditor, type MarkdownEditorProps, _default$k as MarkdownPreview, type MarkdownPreviewProps, MultiEmailValidator, _default$j as PdfPreview, type PdfPreviewProps, PhoneOrMobileValidator, RegBankCardNo, RegDetailAddress, RegEmail, RegFixedTelePhone, RegIdentityCardNo, RegMobile, RegNumNo, RegPassword, RegSmsCode, RegTaxNo, RegTelePhone, type RenderControl, _default$e as RenderMarkdown, type RenderMarkdownProps, _default$d as RenderWrapper, type RenderWrapperProps, type RequestConfig, type SecureManagerProps, type SetIntervalType, type SizeUnit, _default$b as SpeechButton, type SpeechPermission, type SpeechProps, ThanNumLengthValidator, ThanNumValidator, type TokenManagerProps, _default$a as UserAvatar, type UserAvatarProps, _default$i as VideoPlayer, type VideoPlayerProps, type WebSocketProps, type WebSocketType, absVal, addUrlLastSlash, aesDecrypt, aesEncrypt, arrToObj, buildUrlParams, cachedMessage, calculate, compareNum, convertCurrency, convertNewlineToBr, copyText, createRequest, createSecureManager, createTokenManager, decimalPlaces, deepCopy, deepEqual, deepMerge, dividedBy, downloadFile, emit, emitToChild, executeScript, formatDate, formatNumberWithCommas, formatSize, genNonDuplicateID, generateRandomNumbers, getAllUrlParams, getDeviceId, getEndOfTimestamp, getFileName, getFileSuffixName, getRowSpanCount, getStartOfTimestamp, getTimestamp, getWebSocketUrl, importThirdPartyFile, is, isArray, isBlob, isBoolean, isDate, isDef, isElement, isEmpty, isEmptyObj, isExpire, isExternal, isFunction, isInteger, isJson, isLocalhost, isMap, isNegative, isNull, isNullOrUnDef, isNumber, isNumberNoNaN, isObject, isPromise, isReferenceType, isRegExp, isScriptSafe, isSet, isString, isUnDef, isWindow, minus, objToOptions, plus, precision, processItemList, propsMerge, setInterval, setUrlMainSource, shouldRender, times, toFixed, transform, transforms, _default$8 as useAutoRefresh, _default$7 as useCountDown, _default$6 as useCreateValtioContext, _default$5 as useDebounce, _default$4 as useDeepEffect, _default$9 as useIframeRelayBridge, _default$3 as useRefState, _default$c as useSpeech, _default$2 as useSyncInput, _default$1 as useThrottle, _default as useWebSocket };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,20 @@ interface AudioPlayerProps {
|
|
|
19
19
|
* 提供基本的音频播放功能
|
|
20
20
|
* @param props - 组件属性
|
|
21
21
|
*/
|
|
22
|
-
declare const _default$
|
|
22
|
+
declare const _default$p: ({ fileUrl }: AudioPlayerProps) => react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
/** Docx文档预览组件的属性接口 */
|
|
25
|
+
interface DocxPreviewProps {
|
|
26
|
+
/** 文档文件的URL地址 */
|
|
27
|
+
fileUrl: string;
|
|
28
|
+
/** 缩放比例,默认为1 */
|
|
29
|
+
scale?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Docx文档预览组件
|
|
33
|
+
* @param props - 组件属性
|
|
34
|
+
*/
|
|
35
|
+
declare const _default$o: ({ fileUrl, scale }: DocxPreviewProps) => react_jsx_runtime.JSX.Element;
|
|
23
36
|
|
|
24
37
|
/**
|
|
25
38
|
* 文件图标组件属性接口
|
|
@@ -45,7 +58,7 @@ interface FileIconProps {
|
|
|
45
58
|
* @param props - 组件属性
|
|
46
59
|
* @returns 对应文件类型的图标
|
|
47
60
|
*/
|
|
48
|
-
declare const _default$
|
|
61
|
+
declare const _default$n: ({ suffix, fontSize }: FileIconProps) => react_jsx_runtime.JSX.Element;
|
|
49
62
|
|
|
50
63
|
/**
|
|
51
64
|
* 文件预览组件属性接口
|
|
@@ -55,7 +68,7 @@ interface FilePreviewProps {
|
|
|
55
68
|
fileUrl: string;
|
|
56
69
|
/** 文件后缀名 */
|
|
57
70
|
suffix?: string;
|
|
58
|
-
/**
|
|
71
|
+
/** 文件密码 */
|
|
59
72
|
password?: string;
|
|
60
73
|
/** 搜索关键字 */
|
|
61
74
|
searchValue?: string;
|
|
@@ -80,39 +93,18 @@ interface FilePreviewProps {
|
|
|
80
93
|
* 支持图片、PDF、视频、音频、Markdown等文件格式的预览
|
|
81
94
|
* @param props - 组件属性
|
|
82
95
|
*/
|
|
83
|
-
declare const _default$
|
|
96
|
+
declare const _default$m: ({ suffix, fileUrl, pdfParams, password, searchValue }: FilePreviewProps) => react_jsx_runtime.JSX.Element;
|
|
84
97
|
|
|
85
98
|
/**
|
|
86
99
|
* 文件预览抽屉组件属性接口
|
|
87
100
|
*/
|
|
88
|
-
interface FilePreviewDrawerProps {
|
|
101
|
+
interface FilePreviewDrawerProps extends FilePreviewProps {
|
|
89
102
|
/** 是否打开抽屉 */
|
|
90
103
|
open: boolean;
|
|
91
104
|
/** 关闭抽屉的回调函数 */
|
|
92
105
|
onClose: () => void;
|
|
93
106
|
/** 抽屉标题,默认为'文件预览' */
|
|
94
107
|
title?: string;
|
|
95
|
-
/** 文件URL地址 */
|
|
96
|
-
fileUrl: string;
|
|
97
|
-
/** 文件后缀名 */
|
|
98
|
-
suffix?: string;
|
|
99
|
-
/** PDF文件密码 */
|
|
100
|
-
password?: string;
|
|
101
|
-
/** 文件参数 */
|
|
102
|
-
fileParams?: ObjectType<string>;
|
|
103
|
-
/** PDF预览参数 */
|
|
104
|
-
pdfParams?: {
|
|
105
|
-
/** 当前页码 */
|
|
106
|
-
pageNo?: number;
|
|
107
|
-
/** 缩放比例 */
|
|
108
|
-
scale?: number;
|
|
109
|
-
/** 是否显示缩略图 */
|
|
110
|
-
isHasThumbnails?: boolean;
|
|
111
|
-
/** 页码变化回调 */
|
|
112
|
-
onSetPageNo?: (pageNo: number) => void;
|
|
113
|
-
};
|
|
114
|
-
/** 密码设置成功回调 */
|
|
115
|
-
onSetPassSuccess?: () => void;
|
|
116
108
|
}
|
|
117
109
|
/**
|
|
118
110
|
* 文件预览抽屉组件
|
|
@@ -131,7 +123,7 @@ interface FilePreviewDrawerProps {
|
|
|
131
123
|
* @param props - 组件属性
|
|
132
124
|
* @returns 文件预览抽屉组件
|
|
133
125
|
*/
|
|
134
|
-
declare const _default$
|
|
126
|
+
declare const _default$l: ({ open, title, onClose, ...props }: FilePreviewDrawerProps) => react_jsx_runtime.JSX.Element;
|
|
135
127
|
|
|
136
128
|
/**
|
|
137
129
|
* Markdown预览组件属性接口
|
|
@@ -147,7 +139,7 @@ interface MarkdownPreviewProps {
|
|
|
147
139
|
* 从指定URL获取Markdown内容并渲染显示
|
|
148
140
|
* @param props - 组件属性
|
|
149
141
|
*/
|
|
150
|
-
declare const _default$
|
|
142
|
+
declare const _default$k: ({ fileUrl, searchValue }: MarkdownPreviewProps) => react_jsx_runtime.JSX.Element;
|
|
151
143
|
|
|
152
144
|
/**
|
|
153
145
|
* PDF预览组件属性接口
|
|
@@ -174,7 +166,7 @@ interface PdfPreviewProps {
|
|
|
174
166
|
* 支持密码保护、缩略图、缩放、页面导航等功能
|
|
175
167
|
* @param props - 组件属性
|
|
176
168
|
*/
|
|
177
|
-
declare const _default$
|
|
169
|
+
declare const _default$j: ({ password, fileUrl, pageNo, scale, isHasThumbnails, onSetPassword, onSetPageNo }: PdfPreviewProps) => react_jsx_runtime.JSX.Element;
|
|
178
170
|
|
|
179
171
|
/**
|
|
180
172
|
* 视频播放器组件属性接口
|
|
@@ -188,7 +180,7 @@ interface VideoPlayerProps {
|
|
|
188
180
|
* 提供基本的视频播放功能
|
|
189
181
|
* @param props - 组件属性
|
|
190
182
|
*/
|
|
191
|
-
declare const _default$
|
|
183
|
+
declare const _default$i: ({ fileUrl }: VideoPlayerProps) => react_jsx_runtime.JSX.Element;
|
|
192
184
|
|
|
193
185
|
/**
|
|
194
186
|
* Iframe组件属性接口
|
|
@@ -210,7 +202,7 @@ interface IframeProps {
|
|
|
210
202
|
* 支持加载状态、URL参数处理、防缓存等功能
|
|
211
203
|
* @param props - 组件属性
|
|
212
204
|
*/
|
|
213
|
-
declare const _default$
|
|
205
|
+
declare const _default$h: react.ForwardRefExoticComponent<IframeProps & react.RefAttributes<HTMLIFrameElement>>;
|
|
214
206
|
|
|
215
207
|
/**
|
|
216
208
|
* 组件映射类型,用于延时加载
|
|
@@ -235,7 +227,7 @@ interface LazyComponentProps {
|
|
|
235
227
|
* 使用示例:<LazyComponent type="renderMarkdown" data={{}} loading={true} />
|
|
236
228
|
* @param props - 组件属性
|
|
237
229
|
*/
|
|
238
|
-
declare const _default$
|
|
230
|
+
declare const _default$g: ({ type, customComponents, ...rest }: LazyComponentProps) => react_jsx_runtime.JSX.Element;
|
|
239
231
|
|
|
240
232
|
/**
|
|
241
233
|
* Markdown编辑器组件属性接口
|
|
@@ -266,7 +258,7 @@ interface MarkdownEditorProps {
|
|
|
266
258
|
* 提供丰富的编辑功能:格式化、链接、图片、表格、高亮等
|
|
267
259
|
* @param props - 组件属性
|
|
268
260
|
*/
|
|
269
|
-
declare const _default$
|
|
261
|
+
declare const _default$f: ({ value, onChange, onScrollPage, searchValue, disabled, extraNav, showToolbar, onQuote, onDownloadFile }: MarkdownEditorProps) => react_jsx_runtime.JSX.Element;
|
|
270
262
|
|
|
271
263
|
/**
|
|
272
264
|
* Markdown渲染组件属性接口
|
|
@@ -287,7 +279,7 @@ interface RenderMarkdownProps {
|
|
|
287
279
|
* 支持自定义组件、搜索高亮等功能
|
|
288
280
|
* @param RenderMarkdownProps - 组件属性
|
|
289
281
|
*/
|
|
290
|
-
declare const _default$
|
|
282
|
+
declare const _default$e: ({ content, searchValue, customComponents, ...rest }: RenderMarkdownProps) => react_jsx_runtime.JSX.Element;
|
|
291
283
|
|
|
292
284
|
/**
|
|
293
285
|
* 渲染控制对象类型
|
|
@@ -339,7 +331,7 @@ interface RenderWrapperProps<C, P> {
|
|
|
339
331
|
* @param props - 组件属性
|
|
340
332
|
* @returns 渲染的组件或null
|
|
341
333
|
*/
|
|
342
|
-
declare const _default$
|
|
334
|
+
declare const _default$d: react.ForwardRefExoticComponent<RenderWrapperProps<unknown, unknown> & react.RefAttributes<unknown>>;
|
|
343
335
|
|
|
344
336
|
/**
|
|
345
337
|
* 判断是否应该渲染组件
|
|
@@ -359,6 +351,44 @@ declare function propsMerge(control?: RenderControl<any, any> | null, props?: Ob
|
|
|
359
351
|
props: any;
|
|
360
352
|
};
|
|
361
353
|
|
|
354
|
+
type SpeechPermission = 'granted' | 'denied' | 'prompt' | 'unsupported';
|
|
355
|
+
type SpeechProps = {
|
|
356
|
+
/**
|
|
357
|
+
* 识别结果回调函数
|
|
358
|
+
*/
|
|
359
|
+
onResult: (text: string) => void;
|
|
360
|
+
/**
|
|
361
|
+
* 语言,默认为中文
|
|
362
|
+
*/
|
|
363
|
+
lang?: string;
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* 语音识别 Hook
|
|
367
|
+
* @param onResult 识别结果回调函数
|
|
368
|
+
* @param lang 语言,默认为中文
|
|
369
|
+
* @returns 返回权限状态、录音状态和控制方法
|
|
370
|
+
*/
|
|
371
|
+
declare const _default$c: ({ onResult, lang }: SpeechProps) => {
|
|
372
|
+
/**
|
|
373
|
+
* 权限状态
|
|
374
|
+
*/
|
|
375
|
+
permission: SpeechPermission;
|
|
376
|
+
/**
|
|
377
|
+
* 录音状态
|
|
378
|
+
*/
|
|
379
|
+
isRecording: boolean;
|
|
380
|
+
/** 开始语音识别 */
|
|
381
|
+
start: () => void;
|
|
382
|
+
/** 停止语音识别 */
|
|
383
|
+
stop: () => void;
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* 语音按钮
|
|
388
|
+
* @param SpeechProps
|
|
389
|
+
*/
|
|
390
|
+
declare const _default$b: (props: SpeechProps) => react_jsx_runtime.JSX.Element;
|
|
391
|
+
|
|
362
392
|
/**
|
|
363
393
|
* 用户头像组件属性接口
|
|
364
394
|
*/
|
|
@@ -700,6 +730,22 @@ declare const objToOptions: (obj: Record<string, string> | string[], filter?: (k
|
|
|
700
730
|
declare const arrToObj: <T>(arr: T[], key: string) => {
|
|
701
731
|
[key: string]: T;
|
|
702
732
|
};
|
|
733
|
+
/**
|
|
734
|
+
* setInterval函数返回的控制对象类型接口
|
|
735
|
+
* 提供对定时器运行状态的检查和取消操作
|
|
736
|
+
*/
|
|
737
|
+
interface SetIntervalType {
|
|
738
|
+
/**
|
|
739
|
+
* 检查定时器是否正在运行
|
|
740
|
+
* @returns boolean - true表示正在运行,false表示已停止
|
|
741
|
+
*/
|
|
742
|
+
isRun: () => boolean;
|
|
743
|
+
/**
|
|
744
|
+
* 取消定时器
|
|
745
|
+
* 调用后将停止后续的函数执行并清理资源
|
|
746
|
+
*/
|
|
747
|
+
cancel: () => void;
|
|
748
|
+
}
|
|
703
749
|
/**
|
|
704
750
|
* 使用 setTimeout 模拟 setInterval,避免堆积
|
|
705
751
|
*
|
|
@@ -1082,7 +1128,6 @@ declare function aesEncrypt<T = any>(data: T, key: string): string;
|
|
|
1082
1128
|
* @returns 解密后的数据,解密失败时返回null
|
|
1083
1129
|
*/
|
|
1084
1130
|
declare function aesDecrypt<T = any>(data: string, key: string): T | null;
|
|
1085
|
-
declare const formatKB: (kbNum?: number) => string;
|
|
1086
1131
|
type SizeUnit = 'B' | 'KB' | 'MB' | 'GB' | 'TB' | 'PB';
|
|
1087
1132
|
interface FormatSizeOptions {
|
|
1088
1133
|
/** 起始单位,默认 KB */
|
|
@@ -2212,4 +2257,4 @@ declare function createTokenManager({ key, storage }: TokenManagerProps): {
|
|
|
2212
2257
|
clear: () => void;
|
|
2213
2258
|
};
|
|
2214
2259
|
|
|
2215
|
-
export { _default$
|
|
2260
|
+
export { _default$p as AudioPlayer, type AudioPlayerProps, BusinessCode, type CacheMessage, type ComponentMapType, DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, DEFAULT_YEAR_MONTH_DAY_FORMAT, DEFAULT_YEAR_MONTH_FORMAT, _default$o as DocxPreview, type DocxPreviewProps, _default$n as FileIcon, type FileIconProps, _default$m as FilePreview, _default$l as FilePreviewDrawer, type FilePreviewDrawerProps, type FilePreviewProps, type FormatSizeOptions, HttpStatus, _default$h as Iframe, type IframeProps, _default$g as LazyComponent, type LazyComponentProps, _default$f as MarkdownEditor, type MarkdownEditorProps, _default$k as MarkdownPreview, type MarkdownPreviewProps, MultiEmailValidator, _default$j as PdfPreview, type PdfPreviewProps, PhoneOrMobileValidator, RegBankCardNo, RegDetailAddress, RegEmail, RegFixedTelePhone, RegIdentityCardNo, RegMobile, RegNumNo, RegPassword, RegSmsCode, RegTaxNo, RegTelePhone, type RenderControl, _default$e as RenderMarkdown, type RenderMarkdownProps, _default$d as RenderWrapper, type RenderWrapperProps, type RequestConfig, type SecureManagerProps, type SetIntervalType, type SizeUnit, _default$b as SpeechButton, type SpeechPermission, type SpeechProps, ThanNumLengthValidator, ThanNumValidator, type TokenManagerProps, _default$a as UserAvatar, type UserAvatarProps, _default$i as VideoPlayer, type VideoPlayerProps, type WebSocketProps, type WebSocketType, absVal, addUrlLastSlash, aesDecrypt, aesEncrypt, arrToObj, buildUrlParams, cachedMessage, calculate, compareNum, convertCurrency, convertNewlineToBr, copyText, createRequest, createSecureManager, createTokenManager, decimalPlaces, deepCopy, deepEqual, deepMerge, dividedBy, downloadFile, emit, emitToChild, executeScript, formatDate, formatNumberWithCommas, formatSize, genNonDuplicateID, generateRandomNumbers, getAllUrlParams, getDeviceId, getEndOfTimestamp, getFileName, getFileSuffixName, getRowSpanCount, getStartOfTimestamp, getTimestamp, getWebSocketUrl, importThirdPartyFile, is, isArray, isBlob, isBoolean, isDate, isDef, isElement, isEmpty, isEmptyObj, isExpire, isExternal, isFunction, isInteger, isJson, isLocalhost, isMap, isNegative, isNull, isNullOrUnDef, isNumber, isNumberNoNaN, isObject, isPromise, isReferenceType, isRegExp, isScriptSafe, isSet, isString, isUnDef, isWindow, minus, objToOptions, plus, precision, processItemList, propsMerge, setInterval, setUrlMainSource, shouldRender, times, toFixed, transform, transforms, _default$8 as useAutoRefresh, _default$7 as useCountDown, _default$6 as useCreateValtioContext, _default$5 as useDebounce, _default$4 as useDeepEffect, _default$9 as useIframeRelayBridge, _default$3 as useRefState, _default$c as useSpeech, _default$2 as useSyncInput, _default$1 as useThrottle, _default as useWebSocket };
|