my-uniapp-tools 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -7,4 +7,5 @@ export * from "./clipboard";
7
7
  export * from "./system";
8
8
  export * from "./localStorage";
9
9
  export * from "./utils";
10
+ export * from "./upload";
10
11
  export const VERSION: "1.0.8";
@@ -1333,6 +1333,72 @@ const getTopNavBarHeight = () => {
1333
1333
  };
1334
1334
  }
1335
1335
  };
1336
+ /**
1337
+ * 修改浏览器标题
1338
+ * @param title 新的页面标题
1339
+ * @description 动态修改浏览器标签页显示的标题,仅在H5/Web平台有效
1340
+ * @example
1341
+ * // 修改页面标题
1342
+ * setPageTitle('新的页面标题')
1343
+ */
1344
+ const setPageTitle = (title) => {
1345
+ return safeSync(() => {
1346
+ const platform = getPlatform();
1347
+ // 只在H5/Web平台执行
1348
+ if (platform === 'h5' || platform === 'web') {
1349
+ // #ifdef H5 || WEB
1350
+ if (typeof document !== 'undefined') {
1351
+ document.title = title;
1352
+ console.log('页面标题已更新为:', title);
1353
+ return true;
1354
+ }
1355
+ // #endif
1356
+ }
1357
+ else {
1358
+ console.warn('setPageTitle 仅在H5/Web平台有效');
1359
+ }
1360
+ return false;
1361
+ }, 'system', 'SET_PAGE_TITLE_ERROR', false);
1362
+ };
1363
+ /**
1364
+ * 修改浏览器图标(favicon)
1365
+ * @param iconUrl 新的图标URL地址
1366
+ * @param iconType 图标类型,默认为 'image/x-icon'
1367
+ * @description 动态修改浏览器标签页显示的图标,仅在H5/Web平台有效
1368
+ * @example
1369
+ * // 修改页面图标
1370
+ * setPageIcon('https://example.com/new-icon.ico')
1371
+ * // 或使用PNG格式
1372
+ * setPageIcon('https://example.com/new-icon.png', 'image/png')
1373
+ */
1374
+ const setPageIcon = (iconUrl, iconType = 'image/x-icon') => {
1375
+ return safeSync(() => {
1376
+ const platform = getPlatform();
1377
+ // 只在H5/Web平台执行
1378
+ if (platform === 'h5' || platform === 'web') {
1379
+ // #ifdef H5 || WEB
1380
+ if (typeof document !== 'undefined') {
1381
+ // 移除现有的favicon链接
1382
+ const existingLinks = document.querySelectorAll('link[rel*="icon"]');
1383
+ existingLinks.forEach(link => link.remove());
1384
+ // 创建新的favicon链接
1385
+ const link = document.createElement('link');
1386
+ link.rel = 'icon';
1387
+ link.type = iconType;
1388
+ link.href = iconUrl;
1389
+ // 添加到head中
1390
+ document.head.appendChild(link);
1391
+ console.log('页面图标已更新为:', iconUrl);
1392
+ return true;
1393
+ }
1394
+ // #endif
1395
+ }
1396
+ else {
1397
+ console.warn('setPageIcon 仅在H5/Web平台有效');
1398
+ }
1399
+ return false;
1400
+ }, 'system', 'SET_PAGE_ICON_ERROR', false);
1401
+ };
1336
1402
 
1337
1403
  /**
1338
1404
  * 本地存储相关工具函数(优化版本)
@@ -1689,45 +1755,499 @@ function batchGetStorage(keys) {
1689
1755
  return result;
1690
1756
  }
1691
1757
 
1692
- // 核心功能
1693
-
1694
- // 版本信息
1695
- const VERSION = '1.0.8';
1696
-
1697
- // 初始化函数
1698
- async function initUniAppTools(config = {}) {
1699
- const {
1700
- enablePerformanceMonitor = false,
1701
- enableErrorHandler = true,
1702
- logLevel = 'warn'
1703
- } = config;
1704
-
1705
- if (enableErrorHandler) {
1706
- const { ErrorHandler } = await Promise.resolve().then(function () { return errorHandler; });
1707
- const errorHandler$1 = ErrorHandler.getInstance();
1708
-
1709
- // 设置全局错误监听
1710
- if (enablePerformanceMonitor) {
1711
- errorHandler$1.onError((error) => {
1712
- console.log(`[UniAppTools] ${error.module} - ${error.code}: ${error.message}`);
1713
- });
1714
- }
1715
- }
1716
-
1717
- if (enablePerformanceMonitor) {
1718
- const { PerformanceMonitor } = await Promise.resolve().then(function () { return performance$1; });
1719
- const monitor = PerformanceMonitor.getInstance();
1720
-
1721
- // 定期输出性能报告
1722
- setInterval(() => {
1723
- const report = monitor.getReport();
1724
- if (report.slowest.length > 0) {
1725
- console.log('[UniAppTools] 性能报告:', report);
1726
- }
1727
- }, 60000); // 每分钟输出一次
1728
- }
1729
-
1730
- console.log(`[UniAppTools] v${VERSION} 初始化完成`);
1758
+ /**
1759
+ * 文件上传相关工具函数
1760
+ * 支持微信小程序、支付宝小程序、H5多端兼容
1761
+ */
1762
+ /**
1763
+ * 默认上传配置
1764
+ */
1765
+ const DEFAULT_UPLOAD_CONFIG = {
1766
+ name: 'file',
1767
+ maxSize: 10, // 10MB
1768
+ allowedTypes: ['jpg', 'jpeg', 'png', 'gif', 'webp'],
1769
+ showToast: true,
1770
+ timeout: 60000, // 60秒
1771
+ successMessage: '上传成功',
1772
+ failMessage: '上传失败'
1773
+ };
1774
+ /**
1775
+ * 默认选择文件配置
1776
+ */
1777
+ const DEFAULT_CHOOSE_CONFIG = {
1778
+ type: 'image',
1779
+ count: 1,
1780
+ sizeType: ['original', 'compressed'],
1781
+ sourceType: ['album', 'camera'],
1782
+ extension: [],
1783
+ maxSize: 10, // 10MB
1784
+ showToast: true,
1785
+ failMessage: '选择文件失败'
1786
+ };
1787
+ /**
1788
+ * 验证文件大小和类型
1789
+ * @param filePath 文件路径
1790
+ * @param config 配置
1791
+ * @returns 验证结果
1792
+ */
1793
+ function validateFile(filePath, config) {
1794
+ if (!filePath) {
1795
+ return { valid: false, message: '文件路径不能为空' };
1796
+ }
1797
+ // 验证文件类型
1798
+ if (config.allowedTypes && config.allowedTypes.length > 0) {
1799
+ const fileExtension = filePath.split('.').pop()?.toLowerCase();
1800
+ if (!fileExtension || !config.allowedTypes.includes(fileExtension)) {
1801
+ return {
1802
+ valid: false,
1803
+ message: `不支持的文件类型,仅支持:${config.allowedTypes.join(', ')}`
1804
+ };
1805
+ }
1806
+ }
1807
+ return { valid: true };
1808
+ }
1809
+ /**
1810
+ * 验证文件大小
1811
+ * @param fileSize 文件大小(字节)
1812
+ * @param maxSize 最大大小(MB)
1813
+ * @returns 验证结果
1814
+ */
1815
+ function validateFileSize(fileSize, maxSize) {
1816
+ if (!maxSize)
1817
+ return { valid: true };
1818
+ const maxSizeBytes = maxSize * 1024 * 1024;
1819
+ if (fileSize > maxSizeBytes) {
1820
+ return {
1821
+ valid: false,
1822
+ message: `文件大小不能超过 ${maxSize}MB`
1823
+ };
1824
+ }
1825
+ return { valid: true };
1826
+ }
1827
+ /**
1828
+ * 检查平台是否支持指定的文件选择类型
1829
+ */
1830
+ const isPlatformSupported = (type) => {
1831
+ // #ifdef MP-WEIXIN
1832
+ if (type === 'messagefile') {
1833
+ return typeof uni.chooseMessageFile === 'function';
1834
+ }
1835
+ // #endif
1836
+ if (type === 'local') {
1837
+ // #ifdef H5
1838
+ return true; // H5支持本地文件选择
1839
+ // #endif
1840
+ }
1841
+ // image类型所有平台都支持
1842
+ if (type === 'image') {
1843
+ return true;
1844
+ }
1845
+ return false;
1846
+ };
1847
+ /**
1848
+ * 选择文件
1849
+ * @param config 选择配置
1850
+ * @returns Promise<ChooseFileResult> 选择结果
1851
+ */
1852
+ // #ifdef H5
1853
+ /**
1854
+ * 创建H5文件选择的input元素, 并处理文件选择回调
1855
+ * @param {ChooseFileConfig} config - 文件选择的配置
1856
+ * @param {(res: ChooseFileResult) => void} resolve - Promise的resolve函数
1857
+ * @private
1858
+ */
1859
+ function _createH5FileInput(config, resolve) {
1860
+ const input = document.createElement('input');
1861
+ input.type = 'file';
1862
+ input.multiple = config.count > 1;
1863
+ if (config.type === 'image') {
1864
+ input.accept = 'image/*';
1865
+ }
1866
+ else if (config.extension.length > 0) {
1867
+ input.accept = config.extension.map(ext => (ext.startsWith('.') ? ext : `.${ext}`)).join(',');
1868
+ }
1869
+ input.onchange = (event) => {
1870
+ const files = event.target.files;
1871
+ if (files && files.length > 0) {
1872
+ const tempFiles = Array.from(files).map(file => {
1873
+ /**
1874
+ * @description 创建一个临时的对象URL。
1875
+ * 注意:这个URL在不再需要时,建议调用 URL.revokeObjectURL() 来释放内存,以避免内存泄漏。
1876
+ */
1877
+ const path = URL.createObjectURL(file);
1878
+ return {
1879
+ path,
1880
+ size: file.size,
1881
+ name: file.name,
1882
+ type: file.type,
1883
+ file // H5 only
1884
+ };
1885
+ });
1886
+ const normalizedTempFiles = tempFiles.map(file => ({
1887
+ path: file.path,
1888
+ size: file.size,
1889
+ }));
1890
+ resolve({
1891
+ success: true,
1892
+ tempFilePaths: tempFiles.map(f => f.path),
1893
+ tempFiles: normalizedTempFiles,
1894
+ type: config.type
1895
+ });
1896
+ }
1897
+ else {
1898
+ // 用户取消了文件选择
1899
+ resolve({
1900
+ success: false,
1901
+ message: '用户取消选择',
1902
+ type: config.type
1903
+ });
1904
+ }
1905
+ // 从DOM中移除input元素以进行清理
1906
+ document.body.removeChild(input);
1907
+ };
1908
+ // 触发文件选择对话框
1909
+ input.style.display = 'none';
1910
+ document.body.appendChild(input);
1911
+ input.click();
1912
+ }
1913
+ // #endif
1914
+ async function chooseFile(config = {}) {
1915
+ const monitor = PerformanceMonitor.getInstance();
1916
+ monitor.start('chooseFile', 'upload', { count: config.count, type: config.type });
1917
+ const finalConfig = { ...DEFAULT_CHOOSE_CONFIG, ...config };
1918
+ let actualType = finalConfig.type;
1919
+ // 检查平台支持,不支持则降级到image
1920
+ if (!isPlatformSupported(actualType)) {
1921
+ actualType = 'image';
1922
+ console.warn(`当前平台不支持${finalConfig.type}类型,已降级为image类型`);
1923
+ }
1924
+ const result = await safeAsync(() => new Promise((resolve) => {
1925
+ const failCallback = (err) => {
1926
+ const message = err.errMsg || finalConfig.failMessage;
1927
+ if (finalConfig.showToast) {
1928
+ useToast(message, false, 'error');
1929
+ }
1930
+ resolve({ success: false, message, type: actualType });
1931
+ };
1932
+ // #ifdef H5
1933
+ if (actualType === 'image' || actualType === 'local') {
1934
+ _createH5FileInput(finalConfig, resolve);
1935
+ return;
1936
+ }
1937
+ // #endif
1938
+ // #ifdef MP-WEIXIN
1939
+ if (actualType === 'messagefile') {
1940
+ uni.chooseMessageFile({
1941
+ count: finalConfig.count,
1942
+ type: 'all',
1943
+ success: (res) => {
1944
+ // chooseMessageFile 返回的 tempFiles 结构是标准的,直接使用
1945
+ resolve({
1946
+ success: true,
1947
+ tempFilePaths: res.tempFiles.map(f => f.path),
1948
+ tempFiles: res.tempFiles,
1949
+ type: 'messagefile'
1950
+ });
1951
+ },
1952
+ fail: failCallback
1953
+ });
1954
+ }
1955
+ else
1956
+ // #endif
1957
+ if (actualType === 'image') {
1958
+ // #ifndef H5
1959
+ uni.chooseImage({
1960
+ count: finalConfig.count,
1961
+ sizeType: finalConfig.sizeType,
1962
+ sourceType: finalConfig.sourceType,
1963
+ success: (res) => {
1964
+ const tempFilePaths = Array.isArray(res.tempFilePaths) ? res.tempFilePaths : [res.tempFilePaths];
1965
+ const tempFilesArr = Array.isArray(res.tempFiles) ? res.tempFiles : [res.tempFiles];
1966
+ // 规范化 tempFiles
1967
+ const tempFiles = tempFilesArr.map((file, index) => ({
1968
+ path: tempFilePaths[index], // 确保 path 存在
1969
+ size: file.size,
1970
+ }));
1971
+ resolve({
1972
+ success: true,
1973
+ tempFilePaths,
1974
+ tempFiles,
1975
+ type: 'image'
1976
+ });
1977
+ },
1978
+ fail: failCallback
1979
+ });
1980
+ // #endif
1981
+ }
1982
+ else if (actualType === 'local') {
1983
+ // #ifndef H5
1984
+ if (typeof uni.chooseFile === 'function') {
1985
+ uni.chooseFile({
1986
+ count: finalConfig.count,
1987
+ extension: finalConfig.extension,
1988
+ success: (res) => {
1989
+ const tempFilePaths = Array.isArray(res.tempFilePaths) ? res.tempFilePaths : [res.tempFilePaths];
1990
+ const tempFilesArr = Array.isArray(res.tempFiles) ? res.tempFiles : [res.tempFiles];
1991
+ // 规范化 tempFiles
1992
+ const tempFiles = tempFilesArr.map((file, index) => ({
1993
+ path: tempFilePaths[index],
1994
+ size: file.size,
1995
+ }));
1996
+ resolve({
1997
+ success: true,
1998
+ tempFilePaths,
1999
+ tempFiles,
2000
+ type: 'local'
2001
+ });
2002
+ },
2003
+ fail: failCallback
2004
+ });
2005
+ }
2006
+ else {
2007
+ resolve({
2008
+ success: false,
2009
+ message: '当前平台不支持选择本地文件',
2010
+ type: actualType
2011
+ });
2012
+ }
2013
+ // #endif
2014
+ }
2015
+ }).then((res) => {
2016
+ // 仅当成功时验证文件大小
2017
+ if (!res.success || !res.tempFiles || !finalConfig.maxSize) {
2018
+ return res;
2019
+ }
2020
+ const invalidFiles = res.tempFiles.filter((file) => {
2021
+ const sizeValidation = validateFileSize(file.size, finalConfig.maxSize);
2022
+ return !sizeValidation.valid;
2023
+ });
2024
+ if (invalidFiles.length > 0) {
2025
+ const message = `部分文件大小超过 ${finalConfig.maxSize}MB 限制`;
2026
+ if (finalConfig.showToast) {
2027
+ useToast(message, false, 'error');
2028
+ }
2029
+ // 保留已选择的文件,但标记为失败
2030
+ return {
2031
+ ...res,
2032
+ success: false,
2033
+ message,
2034
+ };
2035
+ }
2036
+ return res;
2037
+ }), 'upload', 'CHOOSE_FILE_ERROR');
2038
+ monitor.end('chooseFile');
2039
+ return result || { success: false, message: '选择文件失败', type: actualType };
2040
+ }
2041
+ /**
2042
+ * 选择图片(向后兼容)
2043
+ * @param config 选择配置
2044
+ * @returns Promise<ChooseImageResult> 选择结果
2045
+ */
2046
+ async function chooseImage(config = {}) {
2047
+ const result = await chooseFile({ ...config, type: 'image' });
2048
+ return {
2049
+ success: result.success,
2050
+ tempFilePaths: result.tempFilePaths,
2051
+ tempFiles: result.tempFiles,
2052
+ message: result.message
2053
+ };
2054
+ }
2055
+ /**
2056
+ * 上传文件
2057
+ * @param filePath 文件路径
2058
+ * @param config 上传配置
2059
+ * @param onProgress 进度回调
2060
+ * @returns Promise<UploadResult> 上传结果
2061
+ */
2062
+ async function uploadFile(filePath, config, onProgress) {
2063
+ const monitor = PerformanceMonitor.getInstance();
2064
+ monitor.start('uploadFile', 'upload', { filePath });
2065
+ const finalConfig = { ...DEFAULT_UPLOAD_CONFIG, ...config };
2066
+ // 验证必要参数
2067
+ if (!finalConfig.url) {
2068
+ const message = '上传地址不能为空';
2069
+ if (finalConfig.showToast) {
2070
+ useToast(message, false, 'error');
2071
+ }
2072
+ monitor.end('uploadFile');
2073
+ return { success: false, message };
2074
+ }
2075
+ // 验证文件
2076
+ const fileValidation = validateFile(filePath, finalConfig);
2077
+ if (!fileValidation.valid) {
2078
+ if (finalConfig.showToast) {
2079
+ useToast(fileValidation.message, false, 'error');
2080
+ }
2081
+ monitor.end('uploadFile');
2082
+ return { success: false, message: fileValidation.message };
2083
+ }
2084
+ const result = await safeAsync(() => new Promise((resolve) => {
2085
+ const uploadTask = uni.uploadFile({
2086
+ url: finalConfig.url,
2087
+ filePath,
2088
+ name: finalConfig.name,
2089
+ formData: finalConfig.formData,
2090
+ header: finalConfig.header,
2091
+ timeout: finalConfig.timeout,
2092
+ success: (res) => {
2093
+ let data;
2094
+ try {
2095
+ data = JSON.parse(res.data);
2096
+ }
2097
+ catch {
2098
+ data = res.data;
2099
+ }
2100
+ if (res.statusCode === 200) {
2101
+ if (finalConfig.showToast) {
2102
+ useToast(finalConfig.successMessage, false, 'success');
2103
+ }
2104
+ resolve({
2105
+ success: true,
2106
+ data,
2107
+ tempFilePath: filePath,
2108
+ statusCode: res.statusCode
2109
+ });
2110
+ }
2111
+ else {
2112
+ const message = `上传失败,状态码:${res.statusCode}`;
2113
+ if (finalConfig.showToast) {
2114
+ useToast(message, false, 'error');
2115
+ }
2116
+ resolve({
2117
+ success: false,
2118
+ message,
2119
+ statusCode: res.statusCode
2120
+ });
2121
+ }
2122
+ },
2123
+ fail: (err) => {
2124
+ const message = err.errMsg || finalConfig.failMessage;
2125
+ if (finalConfig.showToast) {
2126
+ useToast(message, false, 'error');
2127
+ }
2128
+ resolve({
2129
+ success: false,
2130
+ message,
2131
+ tempFilePath: filePath
2132
+ });
2133
+ }
2134
+ });
2135
+ // 监听上传进度
2136
+ if (onProgress && uploadTask) {
2137
+ uploadTask.onProgressUpdate((res) => {
2138
+ onProgress({
2139
+ progress: res.progress,
2140
+ totalBytesSent: res.totalBytesSent,
2141
+ totalBytesExpectedToSend: res.totalBytesExpectedToSend
2142
+ });
2143
+ });
2144
+ }
2145
+ }), 'upload', 'UPLOAD_FILE_ERROR');
2146
+ monitor.end('uploadFile');
2147
+ return result || { success: false, message: '上传文件失败' };
2148
+ }
2149
+ /**
2150
+ * 选择并上传文件(一体化功能)
2151
+ * @param config 上传配置
2152
+ * @param chooseConfig 选择文件配置
2153
+ * @param onProgress 进度回调
2154
+ * @returns Promise<UploadResult[]> 上传结果数组
2155
+ */
2156
+ async function chooseAndUploadFile(config, chooseConfig = {}, onProgress) {
2157
+ const monitor = PerformanceMonitor.getInstance();
2158
+ monitor.start('chooseAndUploadFile', 'upload');
2159
+ // 选择文件
2160
+ const chooseResult = await chooseFile(chooseConfig);
2161
+ if (!chooseResult.success || !chooseResult.tempFilePaths) {
2162
+ monitor.end('chooseAndUploadFile');
2163
+ return [{ success: false, message: chooseResult.message || '选择文件失败' }];
2164
+ }
2165
+ // 批量上传
2166
+ const uploadPromises = chooseResult.tempFilePaths.map(filePath => uploadFile(filePath, config, onProgress));
2167
+ const results = await Promise.all(uploadPromises);
2168
+ monitor.end('chooseAndUploadFile');
2169
+ return results;
2170
+ }
2171
+ /**
2172
+ * 选择并上传图片(向后兼容)
2173
+ * @param config 上传配置
2174
+ * @param chooseConfig 选择图片配置
2175
+ * @param onProgress 进度回调
2176
+ * @returns Promise<UploadResult[]> 上传结果数组
2177
+ */
2178
+ async function chooseAndUploadImage(config, chooseConfig = {}, onProgress) {
2179
+ return chooseAndUploadFile(config, { ...chooseConfig, type: 'image' }, onProgress);
2180
+ }
2181
+ /**
2182
+ * 检查是否支持文件上传
2183
+ * @returns boolean 是否支持
2184
+ */
2185
+ function isUploadSupported() {
2186
+ return typeof uni !== 'undefined' &&
2187
+ typeof uni.chooseImage === 'function' &&
2188
+ typeof uni.uploadFile === 'function';
2189
+ }
2190
+ /**
2191
+ * 获取文件信息
2192
+ * @param filePath 文件路径
2193
+ * @returns Promise<{size: number, type?: string}> 文件信息
2194
+ */
2195
+ async function getFileInfo(filePath) {
2196
+ return await safeAsync(() => new Promise((resolve, reject) => {
2197
+ uni.getFileInfo({
2198
+ filePath,
2199
+ digestAlgorithm: 'md5', // 明确指定算法,虽然默认是md5
2200
+ success: (res) => {
2201
+ const result = res;
2202
+ resolve({
2203
+ size: result.size,
2204
+ digest: result.digest
2205
+ });
2206
+ },
2207
+ fail: reject
2208
+ });
2209
+ }), 'upload', 'GET_FILE_INFO_ERROR');
2210
+ }
2211
+
2212
+ // 核心功能
2213
+
2214
+ // 版本信息
2215
+ const VERSION = '1.0.8';
2216
+
2217
+ // 初始化函数
2218
+ async function initUniAppTools(config = {}) {
2219
+ const {
2220
+ enablePerformanceMonitor = false,
2221
+ enableErrorHandler = true,
2222
+ logLevel = 'warn'
2223
+ } = config;
2224
+
2225
+ if (enableErrorHandler) {
2226
+ const { ErrorHandler } = await Promise.resolve().then(function () { return errorHandler; });
2227
+ const errorHandler$1 = ErrorHandler.getInstance();
2228
+
2229
+ // 设置全局错误监听
2230
+ if (enablePerformanceMonitor) {
2231
+ errorHandler$1.onError((error) => {
2232
+ console.log(`[UniAppTools] ${error.module} - ${error.code}: ${error.message}`);
2233
+ });
2234
+ }
2235
+ }
2236
+
2237
+ if (enablePerformanceMonitor) {
2238
+ const { PerformanceMonitor } = await Promise.resolve().then(function () { return performance$1; });
2239
+ const monitor = PerformanceMonitor.getInstance();
2240
+
2241
+ // 定期输出性能报告
2242
+ setInterval(() => {
2243
+ const report = monitor.getReport();
2244
+ if (report.slowest.length > 0) {
2245
+ console.log('[UniAppTools] 性能报告:', report);
2246
+ }
2247
+ }, 60000); // 每分钟输出一次
2248
+ }
2249
+
2250
+ console.log(`[UniAppTools] v${VERSION} 初始化完成`);
1731
2251
  }
1732
2252
 
1733
2253
  exports.ErrorHandler = ErrorHandler;
@@ -1736,6 +2256,10 @@ exports.UniAppToolsError = UniAppToolsError;
1736
2256
  exports.VERSION = VERSION;
1737
2257
  exports.batchGetStorage = batchGetStorage;
1738
2258
  exports.batchSetStorage = batchSetStorage;
2259
+ exports.chooseAndUploadFile = chooseAndUploadFile;
2260
+ exports.chooseAndUploadImage = chooseAndUploadImage;
2261
+ exports.chooseFile = chooseFile;
2262
+ exports.chooseImage = chooseImage;
1739
2263
  exports.cleanExpiredStorage = cleanExpiredStorage;
1740
2264
  exports.clearClipboard = clearClipboard;
1741
2265
  exports.clearNavigationQueue = clearNavigationQueue;
@@ -1746,6 +2270,7 @@ exports.deepClone = deepClone;
1746
2270
  exports.deepMerge = deepMerge;
1747
2271
  exports.getCurrentEnv = getCurrentEnv;
1748
2272
  exports.getCurrentPageInfo = getCurrentPageInfo;
2273
+ exports.getFileInfo = getFileInfo;
1749
2274
  exports.getMenuButtonBoundingClientRect = getMenuButtonBoundingClientRect;
1750
2275
  exports.getNavHeight = getNavHeight;
1751
2276
  exports.getPageStack = getPageStack;
@@ -1757,6 +2282,7 @@ exports.getStorageSync = getStorageSync;
1757
2282
  exports.getTopNavBarHeight = getTopNavBarHeight;
1758
2283
  exports.initUniAppTools = initUniAppTools;
1759
2284
  exports.isClipboardSupported = isClipboardSupported;
2285
+ exports.isUploadSupported = isUploadSupported;
1760
2286
  exports.measurePerformance = measurePerformance;
1761
2287
  exports.mergeObjects = mergeObjects;
1762
2288
  exports.navigateTo = navigateTo;
@@ -1767,10 +2293,13 @@ exports.redirectTo = redirectTo;
1767
2293
  exports.safeAsync = safeAsync;
1768
2294
  exports.safeNavigateTo = safeNavigateTo;
1769
2295
  exports.safeSync = safeSync;
2296
+ exports.setPageIcon = setPageIcon;
2297
+ exports.setPageTitle = setPageTitle;
1770
2298
  exports.setStorage = setStorage;
1771
2299
  exports.setStorageSync = setStorageSync;
1772
2300
  exports.switchTab = switchTab;
1773
2301
  exports.throttle = throttle;
2302
+ exports.uploadFile = uploadFile;
1774
2303
  exports.useBack = useBack;
1775
2304
  exports.useBackDebounced = useBackDebounced;
1776
2305
  exports.useBackOrHome = useBackOrHome;