Skip to content

Conversation

admbradford
Copy link

This PR updates the TypeScript type definitions for session recording
options:

  • record_block_class?: string | RegExp
  • record_mask_text_class?: string | RegExp

Background:

  • Defaults in mixpanel-core.js are regexes, so runtime already supports
    RegExp.
  • Documentation states both string and regex are valid.
  • Current defs only allow string, forcing TS users to use any or
    declaration merging.

Fix:

  • Updated src/index.d.ts to accept string | RegExp.

Closes #521

@jakewski
Copy link
Contributor

jakewski commented Oct 6, 2025

Sorry I missed this PR, we ended up merging this fix in with a broader types change

@jakewski jakewski closed this Oct 6, 2025
@admbradford
Copy link
Author

@jakewski all good! I'm happy as long as I can remove my hack around 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type defs: record_block_class & record_mask_text_class should accept string | RegExp (not string only)
2 participants