@zjlab-fe/util 0.7.0 → 0.9.0
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 +19 -2
- package/dist/index.esm.js +2 -2
- package/dist/index.js +2 -2
- package/dist/types/index.d.ts +14 -2
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -4,13 +4,20 @@
|
|
|
4
4
|
* @returns 解析后的数组
|
|
5
5
|
*/
|
|
6
6
|
export declare function fetchJsonlAsArray<T = any>(url: string): Promise<T[]>;
|
|
7
|
+
/**
|
|
8
|
+
* 根据文件名(包含扩展名)获取对应的 Content-Type
|
|
9
|
+
* @param fileName {string} 文件名或文件路径
|
|
10
|
+
* @returns {string} 对应的 MIME 类型
|
|
11
|
+
*/
|
|
12
|
+
export declare function getContentTypeByFileName(fileName: string): string;
|
|
7
13
|
/**
|
|
8
14
|
* 上传内容到OSS
|
|
9
15
|
* @param ossUrl {string} 上传地址
|
|
10
16
|
* @param content {string | Record<string, any>} 上传内容,类型可以是string,或者json对象
|
|
17
|
+
* @param contentType {string} 可选的 Content-Type,如果不传入,则会根据文件名自动判断,如果传入,则以传入的为准
|
|
11
18
|
* @returns {Promise<boolean>}
|
|
12
19
|
*/
|
|
13
|
-
export declare function uploadToOSS(ossUrl: string, content: string | Record<string, any
|
|
20
|
+
export declare function uploadToOSS(ossUrl: string, content: string | Record<string, any>, contentType?: string): Promise<boolean>;
|
|
14
21
|
/**
|
|
15
22
|
* 检查当前域名是否是线上环境,返回true表示是线上环境,返回false表示是非线上环境
|
|
16
23
|
* @returns {boolean}
|
|
@@ -157,7 +164,12 @@ export declare function getIframeUrl(initUrl: string): string;
|
|
|
157
164
|
*/
|
|
158
165
|
interface ISubAppInitConfig {
|
|
159
166
|
/** 账号信息数据会存放在window[namespace]下,默认值是_subApp,默认会将账号信息数据同步到window._subApp下 */
|
|
160
|
-
namespace
|
|
167
|
+
namespace?: string;
|
|
168
|
+
/** 如果传入,表示子应用路由变更时要替换父应用的路由 */
|
|
169
|
+
replaceMainAppRoute?: {
|
|
170
|
+
/** 父路由前缀 */
|
|
171
|
+
mainAppRoutePrefix: string;
|
|
172
|
+
};
|
|
161
173
|
}
|
|
162
174
|
/**
|
|
163
175
|
* 子应用初始化
|