Skip to content

Commit

Permalink
Merge pull request #107 from codex-team/fix-event-type
Browse files Browse the repository at this point in the history
fix(type): event properties can't be undefined
  • Loading branch information
neSpecc authored Oct 13, 2024
2 parents 1311e8c + 08f44f4 commit f85af48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hawk.so/javascript",
"version": "3.0.6",
"version": "3.0.7",
"description": "JavaScript errors tracking for Hawk.so",
"main": "./dist/hawk.js",
"types": "./dist/index.d.ts",
Expand Down
17 changes: 8 additions & 9 deletions src/types/event.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { EventData, JavaScriptAddons } from '@hawk.so/types';
import type { AffectedUser, BacktraceFrame, EventContext, EventData, JavaScriptAddons } from '@hawk.so/types';

/**
* Event data with JS specific addons
Expand All @@ -14,37 +14,36 @@ export type HawkJavaScriptEvent = Omit<JSEventData, 'type' | 'release' | 'user'
/**
* Event type: TypeError, ReferenceError etc
*/
type: JSEventData['type'];
type: 'errors/javascript';

/**
* Current release (aka version, revision) of an application
*/
release: JSEventData['release'] | null;
release: string | null;

/**
* Current authenticated user
*/
user: JSEventData['user'] | null;
user: AffectedUser | null;

/**
* Any other information collected and passed by user
*/
context: JSEventData['context'];
context: EventContext;

/**
*
* Catcher-specific information
*/
addons: JSEventData['addons'];
addons: JavaScriptAddons;

/**
* Stack
* From the latest call to the earliest
*/
backtrace: JSEventData['backtrace'] | null;
backtrace: BacktraceFrame[] | null;

/**
* Catcher version
*/
catcherVersion: JSEventData['catcherVersion'];
catcherVersion: string;
};

0 comments on commit f85af48

Please sign in to comment.