Include /test in tsc config, fix rest of issues (#8119)

* fix ts issue in PosthogAnalytics test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix remaining ts issues

Signed-off-by: Kerry Archibald <kerrya@element.io>

* tsconfig change

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use sdkconfig patch instead of put

Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
Kerry 2022-03-23 11:27:28 +01:00 committed by GitHub
parent 752ad6a9f9
commit a8d65ab5c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 63 additions and 65 deletions

View file

@ -41,7 +41,7 @@ import { ScreenName } from "./PosthogTrackers";
* - If both flags are false or not set, events are not sent.
*/
interface IEvent {
export interface IPosthogEvent {
// The event name that will be used by PostHog. Event names should use camelCase.
eventName: string;
@ -272,7 +272,7 @@ export class PosthogAnalytics {
this.setAnonymity(Anonymity.Disabled);
}
public trackEvent<E extends IEvent>({ eventName, ...properties }: E): void {
public trackEvent<E extends IPosthogEvent>({ eventName, ...properties }: E): void {
if (this.anonymity == Anonymity.Disabled || this.anonymity == Anonymity.Anonymous) return;
this.capture(eventName, properties);
}