@djvlc/runtime-web 1.0.5 → 1.0.6
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 +17 -13
- package/dist/runtime.esm.js +2982 -6773
- package/dist/runtime.iife.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -689,8 +689,8 @@ export declare function mount(container: string | HTMLElement, options: MountOpt
|
|
|
689
689
|
* 挂载选项
|
|
690
690
|
*/
|
|
691
691
|
export declare interface MountOptions {
|
|
692
|
-
/** 页面
|
|
693
|
-
|
|
692
|
+
/** 页面 ID(对应 contracts 中的 pageId) */
|
|
693
|
+
pageId: string;
|
|
694
694
|
/** API 基础 URL */
|
|
695
695
|
apiBaseUrl: string;
|
|
696
696
|
/** CDN 基础 URL */
|
|
@@ -759,17 +759,21 @@ export declare function onVisibilityChange(callback: (visible: boolean) => void)
|
|
|
759
759
|
|
|
760
760
|
/**
|
|
761
761
|
* 页面解析结果(Runtime 使用)
|
|
762
|
+
*
|
|
763
|
+
* @description
|
|
764
|
+
* 这是 Runtime 内部使用的类型,从 PageResolveResponse 和 PageSnapshotJson 转换而来。
|
|
765
|
+
* 使用 pageId 符合 contracts 定义。
|
|
762
766
|
*/
|
|
763
767
|
declare interface PageResolveResult {
|
|
764
|
-
/** 页面
|
|
765
|
-
|
|
768
|
+
/** 页面 ID(对应 contracts 中的 pageId) */
|
|
769
|
+
pageId: string;
|
|
766
770
|
/** 页面版本 ID */
|
|
767
771
|
pageVersionId: string;
|
|
768
772
|
/** 页面 JSON(PageSchema) */
|
|
769
773
|
pageJson: _djvlc_contracts_types.PageSchema;
|
|
770
774
|
/** 组件清单 */
|
|
771
775
|
manifest: _djvlc_contracts_types.PageManifest;
|
|
772
|
-
/**
|
|
776
|
+
/** 运行时配置(从 OpsConfig 转换而来) */
|
|
773
777
|
runtimeConfig?: {
|
|
774
778
|
/** 被阻断的组件列表 */
|
|
775
779
|
blockedComponents?: Array<{
|
|
@@ -905,7 +909,7 @@ export declare const RUNTIME_VERSION: string;
|
|
|
905
909
|
* 运行时上下文
|
|
906
910
|
*/
|
|
907
911
|
declare interface RuntimeContext {
|
|
908
|
-
|
|
912
|
+
pageId: string;
|
|
909
913
|
pageVersionId: string;
|
|
910
914
|
runtimeVersion: string;
|
|
911
915
|
userId?: string;
|
|
@@ -967,8 +971,8 @@ declare type RuntimeEventType = 'page:resolving' | 'page:resolved' | 'page:loadi
|
|
|
967
971
|
export declare interface RuntimeOptions {
|
|
968
972
|
/** 容器元素或选择器 */
|
|
969
973
|
container: string | HTMLElement;
|
|
970
|
-
/** 页面
|
|
971
|
-
|
|
974
|
+
/** 页面 ID(对应 contracts 中的 pageId) */
|
|
975
|
+
pageId: string;
|
|
972
976
|
/** API 基础 URL */
|
|
973
977
|
apiBaseUrl: string;
|
|
974
978
|
/** CDN 基础 URL */
|
|
@@ -1211,7 +1215,7 @@ declare interface TrackEvent_2 {
|
|
|
1211
1215
|
/** 事件数据 */
|
|
1212
1216
|
data?: Record<string, unknown>;
|
|
1213
1217
|
/** 页面 UID */
|
|
1214
|
-
|
|
1218
|
+
pageId?: string;
|
|
1215
1219
|
/** 页面版本 ID */
|
|
1216
1220
|
pageVersionId?: string;
|
|
1217
1221
|
/** 组件 ID */
|
|
@@ -1257,19 +1261,19 @@ export declare class TrackingManager {
|
|
|
1257
1261
|
/**
|
|
1258
1262
|
* 追踪页面访问
|
|
1259
1263
|
*/
|
|
1260
|
-
trackPageView(
|
|
1264
|
+
trackPageView(pageId: string, pageVersionId?: string): void;
|
|
1261
1265
|
/**
|
|
1262
1266
|
* 追踪组件曝光
|
|
1263
1267
|
*/
|
|
1264
|
-
trackComponentView(componentId: string, componentType: string,
|
|
1268
|
+
trackComponentView(componentId: string, componentType: string, pageId?: string): void;
|
|
1265
1269
|
/**
|
|
1266
1270
|
* 追踪组件点击
|
|
1267
1271
|
*/
|
|
1268
|
-
trackComponentClick(componentId: string, componentType: string,
|
|
1272
|
+
trackComponentClick(componentId: string, componentType: string, pageId?: string): void;
|
|
1269
1273
|
/**
|
|
1270
1274
|
* 追踪动作执行
|
|
1271
1275
|
*/
|
|
1272
|
-
trackAction(actionType: string, success: boolean, duration: number,
|
|
1276
|
+
trackAction(actionType: string, success: boolean, duration: number, pageId?: string): void;
|
|
1273
1277
|
/**
|
|
1274
1278
|
* 追踪错误
|
|
1275
1279
|
*/
|