@fz-firefly/web 0.0.0-stage → 0.2.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/dist/firefly.iife.js +5 -0
- package/dist/index.cjs +877 -0
- package/dist/index.d.cts +47 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +876 -0
- package/package.json +36 -3
- package/README.md +0 -3
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CaptureContext, FireflyClient, FireflyClient as FireflyClient$1, FireflyOptions, FireflyOptions as FireflyOptions$1, FireflyStorage, FireflyTransport, PlatformContext, ResolvedOptions, Tags } from "@fz-firefly/core";
|
|
2
|
+
/**
|
|
3
|
+
* 浏览器端的初始化参数。
|
|
4
|
+
* 与 core 的 FireflyOptions 一致,dsn 与 endpoint 在浏览器场景下必填。
|
|
5
|
+
*/
|
|
6
|
+
interface InitOptions extends FireflyOptions$1 {
|
|
7
|
+
/** 项目公开写入凭证,从后台项目设置里获取。 */
|
|
8
|
+
dsn: string;
|
|
9
|
+
/** 服务端地址,例如 https://firefly.example.com。 */
|
|
10
|
+
endpoint: string;
|
|
11
|
+
/** 是否自动记录点击面包屑,默认 true。 */
|
|
12
|
+
captureClicks?: boolean;
|
|
13
|
+
/** 是否自动记录 console.error / console.warn,默认 true。 */
|
|
14
|
+
captureConsole?: boolean;
|
|
15
|
+
/** 是否记录页面可见性与网络状态变化,默认 true。 */
|
|
16
|
+
captureLifecycle?: boolean;
|
|
17
|
+
/** 是否记录资源加载失败,默认 true。 */
|
|
18
|
+
captureResourceErrors?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** initFirefly 的返回值。 */
|
|
21
|
+
interface FireflyHandle {
|
|
22
|
+
/** 客户端实例,可用于手动 captureException / track / setUser。 */
|
|
23
|
+
client: FireflyClient$1;
|
|
24
|
+
/** 移除所有全局钩子并停止定时器。SPA 卸载或热更新时调用。 */
|
|
25
|
+
dispose(): void;
|
|
26
|
+
}
|
|
27
|
+
declare global {
|
|
28
|
+
interface Window {
|
|
29
|
+
/** 内联 SDK 或业务入口创建的全局实例。 */
|
|
30
|
+
__firefly__?: FireflyHandle;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 浏览器端入口。
|
|
35
|
+
*
|
|
36
|
+
* 一行接入:
|
|
37
|
+
* ```ts
|
|
38
|
+
* const handle = initFirefly({ dsn, endpoint, environment, release });
|
|
39
|
+
* ```
|
|
40
|
+
* 之后未捕获异常、未处理的 Promise 拒绝、资源加载失败会自动上报;
|
|
41
|
+
* 失败 HTTP 请求会单独上报,成功请求进入页面请求日志,慢请求额外
|
|
42
|
+
* 写 warning 面包屑;点击、路由、console、生命周期和失败请求会写入
|
|
43
|
+
* 面包屑时间线。
|
|
44
|
+
*/
|
|
45
|
+
export declare function initFirefly(options: InitOptions): FireflyHandle;
|
|
46
|
+
export type { CaptureContext, FireflyClient, FireflyHandle, FireflyOptions, FireflyStorage, FireflyTransport, InitOptions, PlatformContext, ResolvedOptions, Tags };
|
|
47
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CaptureContext, FireflyClient, FireflyClient as FireflyClient$1, FireflyOptions, FireflyOptions as FireflyOptions$1, FireflyStorage, FireflyTransport, PlatformContext, ResolvedOptions, Tags } from "@fz-firefly/core";
|
|
2
|
+
/**
|
|
3
|
+
* 浏览器端的初始化参数。
|
|
4
|
+
* 与 core 的 FireflyOptions 一致,dsn 与 endpoint 在浏览器场景下必填。
|
|
5
|
+
*/
|
|
6
|
+
interface InitOptions extends FireflyOptions$1 {
|
|
7
|
+
/** 项目公开写入凭证,从后台项目设置里获取。 */
|
|
8
|
+
dsn: string;
|
|
9
|
+
/** 服务端地址,例如 https://firefly.example.com。 */
|
|
10
|
+
endpoint: string;
|
|
11
|
+
/** 是否自动记录点击面包屑,默认 true。 */
|
|
12
|
+
captureClicks?: boolean;
|
|
13
|
+
/** 是否自动记录 console.error / console.warn,默认 true。 */
|
|
14
|
+
captureConsole?: boolean;
|
|
15
|
+
/** 是否记录页面可见性与网络状态变化,默认 true。 */
|
|
16
|
+
captureLifecycle?: boolean;
|
|
17
|
+
/** 是否记录资源加载失败,默认 true。 */
|
|
18
|
+
captureResourceErrors?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** initFirefly 的返回值。 */
|
|
21
|
+
interface FireflyHandle {
|
|
22
|
+
/** 客户端实例,可用于手动 captureException / track / setUser。 */
|
|
23
|
+
client: FireflyClient$1;
|
|
24
|
+
/** 移除所有全局钩子并停止定时器。SPA 卸载或热更新时调用。 */
|
|
25
|
+
dispose(): void;
|
|
26
|
+
}
|
|
27
|
+
declare global {
|
|
28
|
+
interface Window {
|
|
29
|
+
/** 内联 SDK 或业务入口创建的全局实例。 */
|
|
30
|
+
__firefly__?: FireflyHandle;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 浏览器端入口。
|
|
35
|
+
*
|
|
36
|
+
* 一行接入:
|
|
37
|
+
* ```ts
|
|
38
|
+
* const handle = initFirefly({ dsn, endpoint, environment, release });
|
|
39
|
+
* ```
|
|
40
|
+
* 之后未捕获异常、未处理的 Promise 拒绝、资源加载失败会自动上报;
|
|
41
|
+
* 失败 HTTP 请求会单独上报,成功请求进入页面请求日志,慢请求额外
|
|
42
|
+
* 写 warning 面包屑;点击、路由、console、生命周期和失败请求会写入
|
|
43
|
+
* 面包屑时间线。
|
|
44
|
+
*/
|
|
45
|
+
export declare function initFirefly(options: InitOptions): FireflyHandle;
|
|
46
|
+
export type { CaptureContext, FireflyClient, FireflyHandle, FireflyOptions, FireflyStorage, FireflyTransport, InitOptions, PlatformContext, ResolvedOptions, Tags };
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|