@mortada50/error-tracker 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/index.d.ts +29 -0
  2. package/package.json +3 -2
package/index.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ export interface ErrorTrackerConfig {
2
+ apiKey: string;
3
+ serverUrl: string;
4
+ appVersion?: string;
5
+ userId?: string | null;
6
+ }
7
+
8
+ export interface ErrorContext {
9
+ [key: string]: any;
10
+ }
11
+
12
+ /**
13
+ * Initialize the error tracker
14
+ */
15
+ export function init(config: ErrorTrackerConfig): void;
16
+
17
+ /**
18
+ * Capture an error manually
19
+ */
20
+ export function captureError(error: any, context?: ErrorContext): void;
21
+
22
+ /**
23
+ * Capture a custom message
24
+ */
25
+ export function captureMessage(
26
+ message: string,
27
+ level?: "info" | "warning" | "error" | "fatal",
28
+ context?: ErrorContext
29
+ ): void;
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@mortada50/error-tracker",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "description": "",
8
8
  "license": "ISC",
9
9
  "author": "mortada_altaj",
10
- "type": "commonjs",
10
+ "type": "module",
11
11
  "main": "index.js",
12
+ "types": "index.d.ts",
12
13
  "scripts": {
13
14
  "test": "echo \"Error: no test specified\" && exit 1"
14
15
  }