-
-
Save pragmat1c/8e0c60dec3a797af2723d685ade879a3 to your computer and use it in GitHub Desktop.
Fullstory API typescript definitions
This file contains hidden or 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
interface Fullstory { | |
identify(uid: string, userVars?: object): void; | |
setUserVars(userVars: object): void; | |
getCurrentSessionURL(now?: boolean): string; | |
log(msg: string): void; | |
log(level: string, msg: string): void; | |
shutdown(): void; | |
restart(): void; | |
consent(consent: boolean): void; | |
event(eventName: string, eventProperties: object): void; | |
anonymize(); | |
} | |
declare var FS: Fullstory; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Per the property name requirements we can refine the type for
FS.event
a bit more:These restrictions seem to apply similarly for
FS.setUserVars
andFS.identify
with a few exceptions for "reserved properties", you could add those too and it would look something like this:Of course, we can take advantage of some aliases to clean this all up a bit. The final result would be more like so: