@lark-apaas/client-toolkit 1.2.28-alpha.4 → 1.2.28-alpha.40
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.
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { IUserProfile } from '../apis/udt-types';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* useCurrentUserProfile 的返回类型。
|
|
4
|
+
* 初始状态为空对象 `{}`(所有字段均为 undefined),异步获取用户信息后字段才会被填充。
|
|
5
|
+
* 使用时必须通过可选链或空值合并进行安全访问,如 `userInfo?.user_id`。
|
|
6
|
+
* 判断是否已加载完成应使用 `if (!userInfo?.user_id)` 而非 `if (!userInfo)`(因为空对象是 truthy)。
|
|
7
|
+
*/
|
|
8
|
+
export type ICompatibilityUserProfile = Partial<IUserProfile & {
|
|
3
9
|
/**
|
|
4
10
|
* @deprecated please use `name`
|
|
5
11
|
*/
|
|
@@ -8,5 +14,14 @@ export interface ICompatibilityUserProfile extends IUserProfile {
|
|
|
8
14
|
* @deprecated please use `avatar`
|
|
9
15
|
*/
|
|
10
16
|
userAvatar: string;
|
|
11
|
-
}
|
|
12
|
-
export declare const useCurrentUserProfile: () =>
|
|
17
|
+
}>;
|
|
18
|
+
export declare const useCurrentUserProfile: () => Partial<IUserProfile & {
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated please use `name`
|
|
21
|
+
*/
|
|
22
|
+
userName: string;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated please use `avatar`
|
|
25
|
+
*/
|
|
26
|
+
userAvatar: string;
|
|
27
|
+
}>;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { IUserProfile } from '../apis/udt-types';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* 获取当前用户信息。
|
|
4
|
+
* 返回 Partial<IUserProfile>,因为初始值来自 window._userInfo,
|
|
5
|
+
* 该值在运行时始终为空对象 {},所有字段均为 undefined。
|
|
6
|
+
* 异步获取用户信息后才会被填充为完整的 IUserProfile。
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCurrentUserProfile(): Partial<IUserProfile>;
|
|
3
9
|
/**
|
|
4
10
|
* @deprecated 请使用 getCurrentUserProfile 代替
|
|
5
11
|
*/
|
package/lib/utils/hmr-api.d.ts
CHANGED
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
* @see docs/RFC_HMR_API.md
|
|
10
10
|
*/
|
|
11
11
|
export interface HmrApi {
|
|
12
|
+
/**
|
|
13
|
+
* 注册 HMR 更新前回调(模块替换之前触发)
|
|
14
|
+
* @param callback 回调函数
|
|
15
|
+
* @returns cleanup 函数,用于取消注册
|
|
16
|
+
*/
|
|
17
|
+
onBeforeApply?(callback: () => void): () => void;
|
|
12
18
|
/**
|
|
13
19
|
* 注册 HMR 成功回调
|
|
14
20
|
* @param callback 成功回调函数
|
|
@@ -24,7 +30,7 @@ export interface HmrApi {
|
|
|
24
30
|
}
|
|
25
31
|
declare global {
|
|
26
32
|
interface Window {
|
|
27
|
-
__VITE_HMR__?: HmrApi
|
|
33
|
+
__VITE_HMR__?: Required<HmrApi>;
|
|
28
34
|
}
|
|
29
35
|
}
|
|
30
36
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/client-toolkit",
|
|
3
|
-
"version": "1.2.28-alpha.
|
|
3
|
+
"version": "1.2.28-alpha.40",
|
|
4
4
|
"types": "./lib/index.d.ts",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -98,12 +98,12 @@
|
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@ant-design/colors": "^7.2.1",
|
|
100
100
|
"@ant-design/cssinjs": "^1.24.0",
|
|
101
|
-
"@data-loom/js": "0.4.
|
|
101
|
+
"@data-loom/js": "0.4.12",
|
|
102
102
|
"@lark-apaas/aily-web-sdk": "^0.0.7",
|
|
103
103
|
"@lark-apaas/auth-sdk": "^0.1.2",
|
|
104
104
|
"@lark-apaas/client-capability": "^0.1.6",
|
|
105
105
|
"@lark-apaas/internal-slardar": "^0.0.3",
|
|
106
|
-
"@lark-apaas/miaoda-inspector": "
|
|
106
|
+
"@lark-apaas/miaoda-inspector": "1.0.14-alpha.44",
|
|
107
107
|
"@lark-apaas/observable-web": "^1.0.5",
|
|
108
108
|
"@radix-ui/react-avatar": "^1.1.10",
|
|
109
109
|
"@radix-ui/react-popover": "^1.1.15",
|