-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
711 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[*.{js,jsx,ts,tsx,vue,css,scss}] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
export enum HuhaTaskStatus { | ||
IN_PROGRESS = 'In progress', | ||
COMPLETED = 'Completed', | ||
ABANDONED = 'Abandoned', | ||
} | ||
|
||
export interface HuhaOptions { | ||
trackOnGoogleAnalytics?: boolean, | ||
trackOnIntercom?: boolean, | ||
trackOnSegment?: boolean, | ||
} | ||
|
||
export interface HuhaTaskProps { | ||
name: string, | ||
label?: string, | ||
category?: string, | ||
value?: string, | ||
parentTask?: HuhaTask | null, | ||
execId?: string, | ||
persistent?: boolean, | ||
} | ||
|
||
export class HuhaTask implements HuhaOptions { | ||
name: string; | ||
label?: string; | ||
category?: string; | ||
value?: string; | ||
status: HuhaTaskStatus; | ||
effort: number; | ||
errors: number; | ||
start: number; | ||
end?: number; | ||
execId: string; | ||
persistent: boolean; | ||
parentExecId?: string; | ||
parentTask?: HuhaTask | null; | ||
trackOnGoogleAnalytics?: boolean; | ||
trackOnIntercom?: boolean; | ||
trackOnSegment?: boolean; | ||
|
||
constructor(props: HuhaTaskProps, options: HuhaOptions); | ||
|
||
addInteraction(): void; | ||
addError(): void; | ||
finish(status: HuhaTaskStatus): void; | ||
complete(): void; | ||
abandon(): void; | ||
track(): void; | ||
|
||
get time(): number; | ||
|
||
sendToGoogleAnalytics(): void; | ||
sendToIntercom(): void; | ||
sendToSegment(): void; | ||
|
||
updateFromLocalStorage(): void; | ||
removeFromLocalStorage(): void; | ||
} | ||
|
||
export interface HuhaEventProps { | ||
name: string, | ||
object?: string, | ||
action?: string, | ||
category?: string, | ||
value?: string, | ||
task?: string | HuhaTask | null, | ||
eventGroup?: string, | ||
} | ||
|
||
export class HuhaEvent implements HuhaOptions { | ||
name: string; | ||
object?: string; | ||
action?: string; | ||
category?: string; | ||
value?: string; | ||
task?: string | HuhaTask | null; | ||
eventGroup?: string; | ||
trackOnGoogleAnalytics?: boolean; | ||
trackOnIntercom?: boolean; | ||
trackOnSegment?: boolean; | ||
|
||
constructor(props: HuhaEventProps, options: HuhaOptions); | ||
|
||
track(): void; | ||
sendToGoogleAnalytics(): void; | ||
sendToSegment(): void; | ||
} | ||
|
||
export class Huha implements HuhaOptions { | ||
tasks: HuhaTask[]; | ||
events: HuhaEvent[]; | ||
|
||
trackOnGoogleAnalytics?: boolean; | ||
trackOnIntercom?: boolean; | ||
trackOnSegment?: boolean; | ||
|
||
constructor(options: HuhaOptions); | ||
|
||
createTask(properties: HuhaTaskProps): HuhaTask; | ||
createEvent(properties: HuhaEventProps): HuhaEvent; | ||
getTask(name: string): HuhaTask | null; | ||
|
||
setUpEvents(): void; | ||
registerEvent(capturedEvent: string, element: Element): void; | ||
|
||
abandonInProgressTasks(): void; | ||
} |
Oops, something went wrong.