@arms/rum-reactnative 0.0.2-bate.1
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/LICENSE +20 -0
- package/README.md +37 -0
- package/RumSdkReactnative.podspec +21 -0
- package/android/build.gradle +77 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/rumsdkreactnative/RumSdkReactnativeModule.kt +23 -0
- package/android/src/main/java/com/rumsdkreactnative/RumSdkReactnativePackage.kt +33 -0
- package/ios/RumSdkReactnative.h +5 -0
- package/ios/RumSdkReactnative.mm +18 -0
- package/lib/module/collector/action/index.js +68 -0
- package/lib/module/collector/action/index.js.map +1 -0
- package/lib/module/collector/exception/index.js +135 -0
- package/lib/module/collector/exception/index.js.map +1 -0
- package/lib/module/collector/resource/api.js +281 -0
- package/lib/module/collector/resource/api.js.map +1 -0
- package/lib/module/collector/view/perf.js +79 -0
- package/lib/module/collector/view/perf.js.map +1 -0
- package/lib/module/collector/view/pv.js +72 -0
- package/lib/module/collector/view/pv.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/plugin.js +39 -0
- package/lib/module/plugin.js.map +1 -0
- package/lib/module/processor/default-processor.js +22 -0
- package/lib/module/processor/default-processor.js.map +1 -0
- package/lib/module/processor/session-processor.js +20 -0
- package/lib/module/processor/session-processor.js.map +1 -0
- package/lib/module/reporter/index.js +56 -0
- package/lib/module/reporter/index.js.map +1 -0
- package/lib/module/shell.js +63 -0
- package/lib/module/shell.js.map +1 -0
- package/lib/module/types/client.js +4 -0
- package/lib/module/types/client.js.map +1 -0
- package/lib/module/types/index.js +2 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/utils/api.js +75 -0
- package/lib/module/utils/api.js.map +1 -0
- package/lib/module/utils/base.js +90 -0
- package/lib/module/utils/base.js.map +1 -0
- package/lib/module/utils/platform.js +95 -0
- package/lib/module/utils/platform.js.map +1 -0
- package/lib/module/utils/session.js +135 -0
- package/lib/module/utils/session.js.map +1 -0
- package/lib/module/utils/url.js +54 -0
- package/lib/module/utils/url.js.map +1 -0
- package/lib/module/utils/view.js +87 -0
- package/lib/module/utils/view.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/collector/action/index.d.ts +15 -0
- package/lib/typescript/src/collector/action/index.d.ts.map +1 -0
- package/lib/typescript/src/collector/exception/index.d.ts +25 -0
- package/lib/typescript/src/collector/exception/index.d.ts.map +1 -0
- package/lib/typescript/src/collector/resource/api.d.ts +21 -0
- package/lib/typescript/src/collector/resource/api.d.ts.map +1 -0
- package/lib/typescript/src/collector/view/perf.d.ts +1 -0
- package/lib/typescript/src/collector/view/perf.d.ts.map +1 -0
- package/lib/typescript/src/collector/view/pv.d.ts +16 -0
- package/lib/typescript/src/collector/view/pv.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/plugin.d.ts +3 -0
- package/lib/typescript/src/plugin.d.ts.map +1 -0
- package/lib/typescript/src/processor/default-processor.d.ts +6 -0
- package/lib/typescript/src/processor/default-processor.d.ts.map +1 -0
- package/lib/typescript/src/processor/session-processor.d.ts +9 -0
- package/lib/typescript/src/processor/session-processor.d.ts.map +1 -0
- package/lib/typescript/src/reporter/index.d.ts +16 -0
- package/lib/typescript/src/reporter/index.d.ts.map +1 -0
- package/lib/typescript/src/shell.d.ts +29 -0
- package/lib/typescript/src/shell.d.ts.map +1 -0
- package/lib/typescript/src/types/client.d.ts +27 -0
- package/lib/typescript/src/types/client.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +118 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/lib/typescript/src/utils/api.d.ts +59 -0
- package/lib/typescript/src/utils/api.d.ts.map +1 -0
- package/lib/typescript/src/utils/base.d.ts +8 -0
- package/lib/typescript/src/utils/base.d.ts.map +1 -0
- package/lib/typescript/src/utils/platform.d.ts +15 -0
- package/lib/typescript/src/utils/platform.d.ts.map +1 -0
- package/lib/typescript/src/utils/session.d.ts +37 -0
- package/lib/typescript/src/utils/session.d.ts.map +1 -0
- package/lib/typescript/src/utils/url.d.ts +17 -0
- package/lib/typescript/src/utils/url.d.ts.map +1 -0
- package/lib/typescript/src/utils/view.d.ts +13 -0
- package/lib/typescript/src/utils/view.d.ts.map +1 -0
- package/package.json +158 -0
- package/src/collector/action/index.ts +67 -0
- package/src/collector/exception/index.ts +158 -0
- package/src/collector/resource/api.ts +379 -0
- package/src/collector/view/perf.ts +77 -0
- package/src/collector/view/pv.ts +73 -0
- package/src/index.ts +4 -0
- package/src/plugin.ts +41 -0
- package/src/processor/default-processor.ts +22 -0
- package/src/processor/session-processor.ts +23 -0
- package/src/reporter/index.ts +67 -0
- package/src/shell.ts +81 -0
- package/src/types/client.ts +32 -0
- package/src/types/index.ts +159 -0
- package/src/utils/api.ts +119 -0
- package/src/utils/base.ts +92 -0
- package/src/utils/platform.ts +107 -0
- package/src/utils/session.ts +168 -0
- package/src/utils/url.ts +53 -0
- package/src/utils/view.ts +93 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ICollector, IContext, RumActionEvent, RumEvent } from '@arms/rum-core';
|
|
2
|
+
export default class ActionCollector implements ICollector {
|
|
3
|
+
name: string;
|
|
4
|
+
private DELAY_TIME;
|
|
5
|
+
ctx?: IContext;
|
|
6
|
+
sendEvent?: ((payload: RumEvent) => void);
|
|
7
|
+
events: string[];
|
|
8
|
+
lastEvent?: RumActionEvent;
|
|
9
|
+
timer: any;
|
|
10
|
+
setup(ctx: IContext, sendEvent: (payload: RumEvent) => void): void;
|
|
11
|
+
onEvent: (e: any) => void;
|
|
12
|
+
sendAction: () => void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/collector/action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAa,cAAc,EAAE,QAAQ,EAAgB,MAAM,gBAAgB,CAAC;AAGzG,MAAM,CAAC,OAAO,OAAO,eAAgB,YAAW,UAAU;IACxD,IAAI,SAAsB;IAC1B,OAAO,CAAC,UAAU,CAAO;IACzB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC;IAC1C,MAAM,WAAW;IACjB,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,KAAK,EAAE,GAAG,CAAC;IAEX,KAAK,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI;IAU3D,OAAO,GAAI,GAAG,GAAG,UAiCf;IAEF,UAAU,aAIR;IAEF,OAAO;CAGR"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ICollector, IContext, RumEvent } from '@arms/rum-core';
|
|
2
|
+
export default class ExceptionCollector implements ICollector {
|
|
3
|
+
name: string;
|
|
4
|
+
ctx?: IContext;
|
|
5
|
+
sendEvent?: (payload: RumEvent) => void;
|
|
6
|
+
private origin;
|
|
7
|
+
setup(ctx: IContext, sendEvent: (payload: RumEvent) => void): void;
|
|
8
|
+
hackOrigin(): void;
|
|
9
|
+
onError: (e: Error | string, isFatal?: boolean) => void;
|
|
10
|
+
onUnhandled: (_id: string, error: unknown) => void;
|
|
11
|
+
errorHandle: (error: any, source?: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* 根据stack获取Error信息
|
|
14
|
+
* TODO: 增加基于Stack解析filename和lineNumber的能力
|
|
15
|
+
* @param stack
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
getErrorByStack(stack?: string): {
|
|
19
|
+
name: string;
|
|
20
|
+
message: string;
|
|
21
|
+
} | undefined;
|
|
22
|
+
errorFilter(err: Error): boolean;
|
|
23
|
+
destroy(): void;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/collector/exception/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EAIR,QAAQ,EAET,MAAM,gBAAgB,CAAC;AAMxB,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,UAAU;IAC3D,IAAI,SAAyB;IAC7B,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAC;IAExC,OAAO,CAAC,MAAM,CAGZ;IAEF,KAAK,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI;IAM3D,UAAU;IAyBV,OAAO,GAAI,GAAG,KAAK,GAAG,MAAM,EAAE,UAAU,OAAO,UAM7C;IAEF,WAAW,GAAI,KAAK,MAAM,EAAE,OAAO,OAAO,UAExC;IAEF,WAAW,GAAI,OAAO,GAAG,EAAE,eAAW,UAwCpC;IAEF;;;;;OAKG;IACH,eAAe,CAAC,KAAK,GAAE,MAAW;;;;IAkBlC,WAAW,CAAC,GAAG,EAAE,KAAK;IAetB,OAAO;CASR"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ICollector, IContext, ITracingHeaders, RumEvent } from '@arms/rum-core';
|
|
2
|
+
import { IApiAttr, IApiCache } from '../../utils/api';
|
|
3
|
+
declare global {
|
|
4
|
+
interface XMLHttpRequest {
|
|
5
|
+
apiAttr: IApiAttr;
|
|
6
|
+
apiCache: IApiCache;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export default class ApiCollector implements ICollector {
|
|
10
|
+
name: string;
|
|
11
|
+
private ctx?;
|
|
12
|
+
private sendEvent?;
|
|
13
|
+
private originFetch;
|
|
14
|
+
setup(ctx: IContext, sendEvent: (payload: RumEvent) => void): void;
|
|
15
|
+
injectTracing(apiAttr: IApiAttr, inject: (tracingHeaders: ITracingHeaders) => void): void;
|
|
16
|
+
hackXhr(): void;
|
|
17
|
+
hackFetch(): void;
|
|
18
|
+
sendAPI(apiAttr: IApiAttr, entry: any): void;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/collector/resource/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,UAAU,EACV,QAAQ,EAKR,eAAe,EAKf,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAEL,QAAQ,EACR,SAAS,EAIV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,cAAc;QACtB,OAAO,EAAE,QAAQ,CAAC;QAClB,QAAQ,EAAE,SAAS,CAAC;KACrB;CACF;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,YAAW,UAAU;IACrD,IAAI,SAAmB;IAEvB,OAAO,CAAC,GAAG,CAAC,CAAW;IACvB,OAAO,CAAC,SAAS,CAAC,CAA8B;IAChD,OAAO,CAAC,WAAW,CAAU;IAE7B,KAAK,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI;IAY3D,aAAa,CACX,OAAO,EAAE,QAAQ,EACjB,MAAM,EAAE,CAAC,cAAc,EAAE,eAAe,KAAK,IAAI;IAsEnD,OAAO;IA6GP,SAAS;IAmGT,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG;IAuBrC,OAAO;CAYR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=perf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../../../src/collector/view/perf.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ICollector, IContext, RumEvent } from '@arms/rum-core';
|
|
2
|
+
import { IPage } from "../../types/client";
|
|
3
|
+
import { Route } from "../../types";
|
|
4
|
+
export default class PvCollector implements ICollector {
|
|
5
|
+
name: string;
|
|
6
|
+
ctx?: IContext;
|
|
7
|
+
sendEvent?: (payload: RumEvent) => void;
|
|
8
|
+
private prevPage?;
|
|
9
|
+
private pageMap;
|
|
10
|
+
setup(ctx: IContext, sendEvent: (payload: RumEvent) => void): void;
|
|
11
|
+
onChange: (route: Route<any>) => void;
|
|
12
|
+
sendPv: (page: IPage) => void;
|
|
13
|
+
private getViewName;
|
|
14
|
+
destroy(): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=pv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pv.d.ts","sourceRoot":"","sources":["../../../../../src/collector/view/pv.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAyB,QAAQ,EAA8B,MAAM,gBAAgB,CAAC;AACnH,OAAO,EAAa,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,WAAY,YAAW,UAAU;IACpD,IAAI,SAAkB;IACtB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAC;IAExC,OAAO,CAAC,QAAQ,CAAC,CAAQ;IAEzB,OAAO,CAAC,OAAO,CAAgC;IAE/C,KAAK,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI;IAM3D,QAAQ,GAAI,OAAO,KAAK,CAAC,GAAG,CAAC,UAO5B;IAED,MAAM,GAAI,MAAM,KAAK,UA6BpB;IAED,OAAO,CAAC,WAAW;IASnB,OAAO;CAGR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,OAAO,MAAM,SAAS,CAAC;AAoC9B,eAAe,OAAO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-processor.d.ts","sourceRoot":"","sources":["../../../../src/processor/default-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAa,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI3E,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,UAAU;IACzD,IAAI,SAAuB;IAE3B,OAAO,CAAC,GAAG,EAAE,QAAQ;CActB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IContext, IProcessor } from '@arms/rum-core';
|
|
2
|
+
export default class SessionProcessor implements IProcessor {
|
|
3
|
+
name: string;
|
|
4
|
+
ctx?: IContext;
|
|
5
|
+
setup(ctx: IContext): void;
|
|
6
|
+
update: (e?: Event) => void;
|
|
7
|
+
process(ctx: IContext): import("@arms/rum-core").RumEvent;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=session-processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-processor.d.ts","sourceRoot":"","sources":["../../../../src/processor/session-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,UAAU,EAAc,MAAM,gBAAgB,CAAC;AAE5E,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,UAAU;IACzD,IAAI,SAAuB;IAE3B,GAAG,CAAC,EAAE,QAAQ,CAAC;IAEf,KAAK,CAAC,GAAG,EAAE,QAAQ;IAMnB,MAAM,GAAI,IAAI,KAAK,UAGlB;IAED,OAAO,CAAC,GAAG,EAAE,QAAQ;CAItB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IContext, IReporter, Reporter, RumEventBundle } from '@arms/rum-core';
|
|
2
|
+
/**
|
|
3
|
+
* rn-app reporter
|
|
4
|
+
*/
|
|
5
|
+
declare class RNReporter extends Reporter implements IReporter {
|
|
6
|
+
name: string;
|
|
7
|
+
private appStateListener?;
|
|
8
|
+
constructor();
|
|
9
|
+
init(ctx: IContext): void;
|
|
10
|
+
onAppStateChanged(nextAppState: string): void;
|
|
11
|
+
request(ctx: IContext, bundle: RumEventBundle): void;
|
|
12
|
+
catchHandle: (err: any) => void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
}
|
|
15
|
+
export default RNReporter;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/reporter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,cAAc,EACf,MAAM,gBAAgB,CAAC;AAKxB;;GAEG;AACH,cAAM,UAAW,SAAQ,QAAS,YAAW,SAAS;IACpD,IAAI,SAAiB;IAErB,OAAO,CAAC,gBAAgB,CAAC,CAA0B;;IAanD,IAAI,CAAC,GAAG,EAAE,QAAQ;IAIlB,iBAAiB,CAAC,YAAY,EAAE,MAAM;IAUtC,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc;IAc7C,WAAW,GAAI,KAAK,GAAG,UAEtB;IAED,OAAO;CAGR;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Shell } from '@arms/rum-core';
|
|
2
|
+
import { IRNConfig } from "./types/client";
|
|
3
|
+
import { NavigationContainerRef } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* 对外导出 shell 层, 所有 shell 层模型的 API 设计约定:
|
|
6
|
+
* 1. API 命名空间按照 variables / functions / events 来组织
|
|
7
|
+
* 2. 事件(events)的命名格式为:on[Will|Did]VerbNoun?,参考 https://code.visualstudio.com/api/references/vscode-api#events
|
|
8
|
+
* 3. 基于 Disposable 模式,对于事件的绑定、快捷键的绑定函数,返回值则是解绑函数
|
|
9
|
+
*/
|
|
10
|
+
export declare class ArmsRum extends Shell {
|
|
11
|
+
version: string;
|
|
12
|
+
/**
|
|
13
|
+
* 初始化
|
|
14
|
+
*/
|
|
15
|
+
init(config: IRNConfig): void;
|
|
16
|
+
/**
|
|
17
|
+
* set config
|
|
18
|
+
*/
|
|
19
|
+
setConfig<T extends keyof IRNConfig>(key: T, value: IRNConfig[T]): void;
|
|
20
|
+
setConfig(value: IRNConfig): void;
|
|
21
|
+
getLocalConfig(_duration: number, _pid: string): any;
|
|
22
|
+
getRemoteConfig(_url: string, _config: any): any;
|
|
23
|
+
storeRemoteConfig(_config: any, _pid: string): boolean;
|
|
24
|
+
startTrackingViews(navigationRef: NavigationContainerRef | any): void;
|
|
25
|
+
stopTrackingViews(): void;
|
|
26
|
+
}
|
|
27
|
+
declare const _default: ArmsRum;
|
|
28
|
+
export default _default;
|
|
29
|
+
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAOvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAI3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAEhD;;;;;GAKG;AACH,qBAAa,OAAQ,SAAQ,KAAK;IAChC,OAAO,SAAW;IAElB;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS;IActB;;OAEG;IACH,SAAS,CAAC,CAAC,SAAS,MAAM,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI;IACvE,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAgBjC,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG;IAGpD,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,GAAG;IAIhD,iBAAiB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO;IAItD,kBAAkB,CAAC,aAAa,EAAE,sBAAsB,GAAG,GAAG;IAK9D,iBAAiB;CAGlB;;AAED,wBAA6B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IConfiguration, ITracingOption } from "@arms/rum-core";
|
|
2
|
+
import { IApiBaseAttr } from "../utils/api";
|
|
3
|
+
export interface IPage {
|
|
4
|
+
id: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
params?: object;
|
|
8
|
+
}
|
|
9
|
+
export interface IRNConfig extends IConfiguration {
|
|
10
|
+
/**
|
|
11
|
+
* view.name 解析
|
|
12
|
+
*/
|
|
13
|
+
parseViewName?(url: string, page?: IPage): string;
|
|
14
|
+
/**
|
|
15
|
+
* resource.name 解析
|
|
16
|
+
*/
|
|
17
|
+
parseResourceName?(url: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* tracing 配置 'tracecontext' | 'b3' | 'b3multi' | 'jaeger';
|
|
20
|
+
*/
|
|
21
|
+
tracing?: boolean | ITracingOption;
|
|
22
|
+
/**
|
|
23
|
+
* request 自定义解析;
|
|
24
|
+
*/
|
|
25
|
+
evaluateApi?(request: any, response: any, error?: Error, xhr?: XMLHttpRequest): Promise<IApiBaseAttr>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/types/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAU,SAAQ,cAAc;IAE/C;;OAEG;IACH,aAAa,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAElD;;OAEG;IACH,iBAAiB,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAExC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC;IAEnC;;OAEG;IACH,WAAW,CAAC,CAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACxG"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains copy/pastes from react-navigation types. The types have been simplified to be able to work with
|
|
3
|
+
* both v5 and v6.
|
|
4
|
+
* This is needed because NavigationContainerRef became NavigationContainerRef<T> in v6, and so we cannot keep compatibility
|
|
5
|
+
* between the 2 types. Also this way we never import '@react-navigation/native-vX' in our code.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Route
|
|
9
|
+
*/
|
|
10
|
+
export declare type Route<RouteName extends string, Params extends object | undefined = object | undefined> = Readonly<{
|
|
11
|
+
/**
|
|
12
|
+
* Unique key for the route.
|
|
13
|
+
*/
|
|
14
|
+
key: string;
|
|
15
|
+
/**
|
|
16
|
+
* User-provided name for the route.
|
|
17
|
+
*/
|
|
18
|
+
name: RouteName;
|
|
19
|
+
path?: string;
|
|
20
|
+
}> & (undefined extends Params ? Readonly<{
|
|
21
|
+
/**
|
|
22
|
+
* Params for this route
|
|
23
|
+
*/
|
|
24
|
+
params?: Readonly<Params>;
|
|
25
|
+
}> : Readonly<{
|
|
26
|
+
/**
|
|
27
|
+
* Params for this route
|
|
28
|
+
*/
|
|
29
|
+
params: Readonly<Params>;
|
|
30
|
+
}>);
|
|
31
|
+
/**
|
|
32
|
+
* Navigation Container
|
|
33
|
+
*/
|
|
34
|
+
export declare type NavigationContainerRef = EventConsumer<NavigationContainerEventMap> & {
|
|
35
|
+
canGoBack(): boolean;
|
|
36
|
+
getCurrentRoute(): Route<string> | undefined;
|
|
37
|
+
};
|
|
38
|
+
export declare type NavigationContainerEventMap = {
|
|
39
|
+
/**
|
|
40
|
+
* Event which fires when the navigation state changes.
|
|
41
|
+
*/
|
|
42
|
+
state: {
|
|
43
|
+
data: {
|
|
44
|
+
/**
|
|
45
|
+
* The updated state object after the state change.
|
|
46
|
+
*/
|
|
47
|
+
state: any;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Event which fires when current options changes.
|
|
52
|
+
*/
|
|
53
|
+
options: {
|
|
54
|
+
data: {
|
|
55
|
+
options: object;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Event which fires when an action is dispatched.
|
|
60
|
+
* Only intended for debugging purposes, don't use it for app logic.
|
|
61
|
+
* This event will be emitted before state changes have been applied.
|
|
62
|
+
*/
|
|
63
|
+
__unsafe_action__: {
|
|
64
|
+
data: {
|
|
65
|
+
/**
|
|
66
|
+
* The action object which was dispatched.
|
|
67
|
+
*/
|
|
68
|
+
action: any;
|
|
69
|
+
/**
|
|
70
|
+
* Whether the action was a no-op, i.e. resulted any state changes.
|
|
71
|
+
*/
|
|
72
|
+
noop: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Stack trace of the action, this will only be available during development.
|
|
75
|
+
*/
|
|
76
|
+
stack: string | undefined;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export declare type EventConsumer<EventMap extends EventMapBase> = {
|
|
81
|
+
/**
|
|
82
|
+
* Subscribe to events from the parent navigator.
|
|
83
|
+
*
|
|
84
|
+
* @param type Type of the event (e.g. `focus`, `blur`)
|
|
85
|
+
* @param callback Callback listener which is executed upon receiving the event.
|
|
86
|
+
*/
|
|
87
|
+
addListener<EventName extends Extract<keyof EventMap, string>>(type: EventName, callback: (...args: any[]) => any): () => void;
|
|
88
|
+
removeListener<EventName extends Extract<keyof EventMap, string>>(type: EventName, callback: (...args: any[]) => any): void;
|
|
89
|
+
};
|
|
90
|
+
export declare type EventMapBase = Record<string, {
|
|
91
|
+
data?: any;
|
|
92
|
+
canPreventDefault?: boolean;
|
|
93
|
+
}>;
|
|
94
|
+
/**
|
|
95
|
+
* NavigationListener
|
|
96
|
+
*/
|
|
97
|
+
export declare type NavigationListener = (event: EventArg<string, boolean, any>) => void | null;
|
|
98
|
+
export declare type EventArg<EventName extends string, CanPreventDefault extends boolean | undefined = false, Data = undefined> = {
|
|
99
|
+
/**
|
|
100
|
+
* Type of the event (e.g. `focus`, `blur`)
|
|
101
|
+
*/
|
|
102
|
+
readonly type: EventName;
|
|
103
|
+
readonly target?: string;
|
|
104
|
+
} & (CanPreventDefault extends true ? {
|
|
105
|
+
/**
|
|
106
|
+
* Whether `event.preventDefault()` was called on this event object.
|
|
107
|
+
*/
|
|
108
|
+
readonly defaultPrevented: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Prevent the default action which happens on this event.
|
|
111
|
+
*/
|
|
112
|
+
preventDefault(): void;
|
|
113
|
+
} : any) & (undefined extends Data ? {
|
|
114
|
+
readonly data?: Readonly<Data>;
|
|
115
|
+
} : {
|
|
116
|
+
readonly data: Readonly<Data>;
|
|
117
|
+
});
|
|
118
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { IViewData, ResourceStatus } from "@arms/rum-core";
|
|
2
|
+
export interface IMeasure {
|
|
3
|
+
[key: string]: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const ApiType: {
|
|
6
|
+
FETCH: string;
|
|
7
|
+
XHR: string;
|
|
8
|
+
};
|
|
9
|
+
export interface IApiBaseAttr {
|
|
10
|
+
name?: string;
|
|
11
|
+
message?: string;
|
|
12
|
+
success?: ResourceStatus;
|
|
13
|
+
duration?: number;
|
|
14
|
+
size?: number;
|
|
15
|
+
status_code?: number | string;
|
|
16
|
+
snapshots?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface IApiAttr extends IApiBaseAttr {
|
|
19
|
+
view?: IViewData;
|
|
20
|
+
url?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
timestamp: number;
|
|
23
|
+
method?: string;
|
|
24
|
+
trace_id?: string;
|
|
25
|
+
trace_data?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface IApiCache {
|
|
28
|
+
url: string | URL;
|
|
29
|
+
method: string;
|
|
30
|
+
type: string;
|
|
31
|
+
async?: boolean;
|
|
32
|
+
user?: string;
|
|
33
|
+
password?: string;
|
|
34
|
+
headers?: Record<string, string>;
|
|
35
|
+
data?: any;
|
|
36
|
+
}
|
|
37
|
+
export interface Options {
|
|
38
|
+
url: string;
|
|
39
|
+
method?: string;
|
|
40
|
+
header?: any;
|
|
41
|
+
success?: (res: any) => void;
|
|
42
|
+
fail?: (res: any) => void;
|
|
43
|
+
complete?: (res: any) => void;
|
|
44
|
+
}
|
|
45
|
+
export declare function reviseApiAttr(attrs: IApiBaseAttr): IApiBaseAttr | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* 根据指定 URL 获取视图的名称,默认为其 path 部分
|
|
48
|
+
* @param url 需要提取路径部分的 URL
|
|
49
|
+
* @param spaMode 页面 SPA 路由模式
|
|
50
|
+
*/
|
|
51
|
+
export declare function getPathByURL(url: string): string;
|
|
52
|
+
export declare function getResourceName(url: string, parseFunction?: (url: string) => string): string;
|
|
53
|
+
/**
|
|
54
|
+
* 判断成功还是失败
|
|
55
|
+
* @param status_code
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
export declare function getResourceSuccessByCode(status_code: number | string): ResourceStatus;
|
|
59
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/utils/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErG,MAAM,WAAW,QAAQ;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,OAAO;;;CAInB,CAAA;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,QAAS,SAAQ,YAAY;IAC5C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS,CAyB3E;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,UAOvC;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,UAQnF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,kBAUpE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取获取当前时间 fix Data.now() 存在的缺陷
|
|
3
|
+
* duration方法用于计算时间跨度,由于Date.now存在bug,可能为负数,尽可能使用performance.now计算
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export declare function getCurrentTime(): number;
|
|
7
|
+
export declare function getStringSize(str: string, encode?: string): number;
|
|
8
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/utils/base.ts"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,wBAAgB,cAAc,WAE7B;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,SAAS,UA8DzD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RumEventBundle } from "@arms/rum-core";
|
|
2
|
+
export declare const VERSION = "test";
|
|
3
|
+
export interface Global {
|
|
4
|
+
ErrorUtils: {
|
|
5
|
+
setGlobalHandler: any;
|
|
6
|
+
reportFatalError: any;
|
|
7
|
+
getGlobalHandler: any;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare var global: Global;
|
|
11
|
+
export declare const appName = "react-native";
|
|
12
|
+
export declare function getStorage(key: string): Promise<string | null>;
|
|
13
|
+
export declare function setStorage(key: string, data: string): Promise<void>;
|
|
14
|
+
export declare const fixAttrs: (bundle: RumEventBundle) => RumEventBundle | undefined;
|
|
15
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../src/utils/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAKzD,eAAO,MAAM,OAAO,SAAS,CAAC;AAE9B,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE;QACV,gBAAgB,EAAE,GAAG,CAAA;QACrB,gBAAgB,EAAE,GAAG,CAAA;QACrB,gBAAgB,EAAE,GAAG,CAAA;KACtB,CAAA;CACF;AAED,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,EAAE,MAAM,CAAC;AAGlC,eAAO,MAAM,OAAO,iBAAiB,CAAC;AAEtC,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,0BAErC;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAEnD;AAoBD,eAAO,MAAM,QAAQ,GAAa,QAAQ,cAAc,KAAG,cAAc,GAAG,SA2D3E,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IContext, IRumSession, SessionConfig } from '@arms/rum-core';
|
|
2
|
+
interface SessionInfo {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
sampled: boolean;
|
|
5
|
+
startTime: number;
|
|
6
|
+
lastTime: number;
|
|
7
|
+
isNew?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class RumSession implements IRumSession {
|
|
10
|
+
ctx?: IContext;
|
|
11
|
+
sessionConfig: SessionConfig;
|
|
12
|
+
private session;
|
|
13
|
+
private userId;
|
|
14
|
+
constructor();
|
|
15
|
+
init(ctx: IContext): void;
|
|
16
|
+
getSessionId(): string;
|
|
17
|
+
getSampled(): boolean;
|
|
18
|
+
checkSession(info: SessionInfo): boolean;
|
|
19
|
+
updateSession(): void;
|
|
20
|
+
getSessionInfo(): SessionInfo;
|
|
21
|
+
getEventId(): string;
|
|
22
|
+
getViewId(): string;
|
|
23
|
+
initUser(): Promise<void>;
|
|
24
|
+
getUserId(): string;
|
|
25
|
+
private resetSession;
|
|
26
|
+
private getUUID;
|
|
27
|
+
fixSessionConfig(sessionConfig?: SessionConfig): SessionConfig;
|
|
28
|
+
getBaseEvent(): {
|
|
29
|
+
timestamp: number;
|
|
30
|
+
session_id: string;
|
|
31
|
+
event_id: string;
|
|
32
|
+
view: import("@arms/rum-core").IViewData | null | undefined;
|
|
33
|
+
times: number;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/utils/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EACR,WAAW,EAMX,aAAa,EACd,MAAM,gBAAgB,CAAC;AAUxB,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,UAAW,YAAW,WAAW;IAC5C,GAAG,CAAC,EAAE,QAAQ,CAAC;IAGf,aAAa,EAAE,aAAa,CAAC;IAI7B,OAAO,CAAC,OAAO,CAAM;IAErB,OAAO,CAAC,MAAM,CAAM;;IAMpB,IAAI,CAAC,GAAG,EAAE,QAAQ;IAKlB,YAAY;IAIZ,UAAU;IAIV,YAAY,CAAC,IAAI,EAAE,WAAW;IAQ9B,aAAa;IAYb,cAAc;IAcd,UAAU;IAKV,SAAS;IAIH,QAAQ;IAQd,SAAS;IAIT,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,OAAO;IAIf,gBAAgB,CAAC,aAAa,GAAE,aAAkB,GAAG,aAAa;IAsBlE,YAAY;;;;;;;CAWb"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 根据指定 URL 获取视图的名称,默认为其path部分
|
|
3
|
+
* @param url 需要提取路径部分的 URL
|
|
4
|
+
* @param isHash 是否为 hash 模式路由的 URL
|
|
5
|
+
*/
|
|
6
|
+
export declare function getPathByURL(url: string, isHash?: boolean): string | undefined;
|
|
7
|
+
export declare function getURL(url: string): {
|
|
8
|
+
uri: string;
|
|
9
|
+
protocol: string | undefined;
|
|
10
|
+
host: string | undefined;
|
|
11
|
+
hostname: string | undefined;
|
|
12
|
+
port: string | undefined;
|
|
13
|
+
pathname: string | undefined;
|
|
14
|
+
search: string | undefined;
|
|
15
|
+
hash: string | undefined;
|
|
16
|
+
} | null;
|
|
17
|
+
//# sourceMappingURL=url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/utils/url.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,UAAQ,sBAYvD;AAkBD,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM;;;;;;;;;SAgBjC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IContext } from '@arms/rum-core';
|
|
2
|
+
import { NavigationListener } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* 获取当前 view
|
|
5
|
+
* @param ctx
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCurView(ctx: IContext): import("@arms/rum-core").IViewData | null | undefined;
|
|
9
|
+
export declare function addNavigateListener(listener: NavigationListener): void;
|
|
10
|
+
export declare function removeNavigateListener(listener: NavigationListener): void;
|
|
11
|
+
export declare function startTrackingViews(nav: any): void;
|
|
12
|
+
export declare function stopTrackingViews(): void;
|
|
13
|
+
//# sourceMappingURL=view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../../src/utils/view.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAA0B,kBAAkB,EAAE,MAAM,UAAU,CAAA;AA+BrE;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,yDAOvC;AAKD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,QAI/D;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,kBAAkB,QAElE;AAcD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,QAU1C;AAED,wBAAgB,iBAAiB,SAIhC"}
|