diff --git a/index.d.ts b/index.d.ts index 758d6a08..40d1cc14 100644 --- a/index.d.ts +++ b/index.d.ts @@ -103,7 +103,21 @@ export interface Flags { } export class Autocapture { + /** + * Track a screen view event. + * + * @param screenName The name of the screen being viewed. Must be non-empty; + * if an empty or whitespace-only string is passed, the event is silently dropped. + * @param properties Optional additional properties to include with the event + */ trackScreenView(screenName: string, properties?: MixpanelProperties): void; + /** + * Track a screen leave event. + * + * @param screenName The name of the screen being left. Must be non-empty; + * if an empty or whitespace-only string is passed, the event is silently dropped. + * @param properties Optional additional properties to include with the event + */ trackScreenLeave(screenName: string, properties?: MixpanelProperties): void; } diff --git a/index.js b/index.js index 2c0106c7..f355ccde 100644 --- a/index.js +++ b/index.js @@ -726,7 +726,8 @@ export class Autocapture { /** * Track a screen view event. * - * @param {string} screenName The name of the screen being viewed + * @param {string} screenName The name of the screen being viewed. Must be non-empty; + * if an empty or whitespace-only string is passed, the event is silently dropped. * @param {object} properties Optional additional properties to include with the event */ trackScreenView(screenName, properties) { @@ -750,7 +751,8 @@ export class Autocapture { /** * Track a screen leave event. * - * @param {string} screenName The name of the screen being left + * @param {string} screenName The name of the screen being left. Must be non-empty; + * if an empty or whitespace-only string is passed, the event is silently dropped. * @param {object} properties Optional additional properties to include with the event */ trackScreenLeave(screenName, properties) {