-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
12 changed files
with
4,504 additions
and
14,635 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,30 @@ | ||
export default class Config { | ||
environmentLocal: string; | ||
environmentStaging: string; | ||
environmentProduction: string; | ||
apiUrl: string; | ||
apiUrlLocal: string; | ||
apiUrlStaging: string; | ||
apiUrlProduction: string; | ||
eventsUrl: string; | ||
eventsUrlLocal: string; | ||
eventsUrlStaging: string; | ||
eventsUrlProduction: string; | ||
customEnvironmentAttribute: string; | ||
environment: string; | ||
environments: string[]; | ||
maxSessionDays: number; | ||
challengeParameterName: string; | ||
sessionParameterName: string; | ||
version: string; | ||
widgetDivClass: string; | ||
widgetIdAttribute: string; | ||
hostUrlLocal: string; | ||
hostUrlStaging: string; | ||
hostUrlProduction: string; | ||
hostUrl: string; | ||
fbAppId: string; | ||
constructor(); | ||
isEnvironmentValid: (environment: string) => boolean; | ||
setEnvironment: (environment: string) => void; | ||
} |
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,15 @@ | ||
import Config from './config'; | ||
export default class Events { | ||
sessionId: string; | ||
start: number; | ||
interactionSent: boolean; | ||
config: Config; | ||
challengeGuid: string; | ||
constructor(sessionId: string | undefined, challengeGuid: string | undefined, config: Config); | ||
sendPing: () => void; | ||
detectWidgetClick: () => void; | ||
detectBounce: () => void; | ||
sendChallengeResponse: () => void; | ||
detectInteraction: () => void; | ||
sendEvent: (eventName: string, data: string) => Promise<void>; | ||
} |
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,42 @@ | ||
import Config from './config'; | ||
import Events from './events'; | ||
import Storage from './storage'; | ||
import TPow from './types'; | ||
declare enum Platform { | ||
LinkedIn = "linkedin", | ||
PowPing = "powping", | ||
Twitter = "twitter", | ||
Twetch = "twetch", | ||
Facebook = "facebook" | ||
} | ||
export default class TonicPow { | ||
config: Config; | ||
storage: Storage; | ||
events: Events | undefined; | ||
widgets: Map<string, TPow.Widget | null>; | ||
options: TPow.TonicPowOptions | undefined; | ||
buttonViewsInitialized: boolean; | ||
shareButtons: Map<string, TPow.ShareButtonOptions>; | ||
nrOfButtons: number; | ||
constructor(options?: TPow.TonicPowOptions); | ||
setOreo: (name: string, value: string, days: number) => void; | ||
captureVisitorSession: (customSessionId?: string, customChallengeGuid?: string) => TPow.Capture; | ||
getVisitorSession: () => string | null; | ||
loadDivs: () => Promise<void>; | ||
private getDataAttributes; | ||
private initializeButton; | ||
shareButton: (id: string, options: TPow.ShareButtonOptions) => void; | ||
private initializeButtonViews; | ||
private static showPopup; | ||
shareOnPlatform: (shortlink: TPow.ShortLink, platform: Platform) => void; | ||
copyText: (text: string) => void; | ||
closePopup: () => void; | ||
private initializeBanner; | ||
load: () => Promise<void>; | ||
} | ||
declare global { | ||
interface Window { | ||
TonicPow: any; | ||
} | ||
} | ||
export {}; |
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,5 @@ | ||
export default class Storage { | ||
removeStorage: (name: string) => boolean; | ||
getStorage: (key: string) => string | null; | ||
setStorage: (key: string, value: string, expires?: number | null) => boolean; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.