import InstrumentationModule from '../../native/InstrumentationModule'; enum BreadcrumbVisibility { CRASHES_ONLY = InstrumentationModule.getConstants().BREADCRUMB_VISIBILITY_CRASHES_ONLY, CRASHES_AND_SESSIONS = InstrumentationModule.getConstants().BREADCRUMB_VISIBILITY_CRASHES_AND_SESSIONS, } /** * Leaves a breadcrumb that will appear in crash report and sessions depending * on the `mode`. * * Call this when to track important events throughout your app. Each crash * report displays the most recent 99 breadcrumbs. * * If you would like it to appear also in sessions, use {@link BreadcrumbVisibility.CRASHES_AND_SESSIONS}. * * @param {string} breadcrumb The string to include with the breadcrumb. If it's * longer than 2048 characters, it will be truncated. If it's empty, no * breadcrumb will be recorded. * @param {BreadcrumbVisibility} mode Value of {@link BreadcrumbVisibility}. * If not set, defaults to {@link BreadcrumbVisibility.CRASHES_ONLY}. */ async function leaveBreadcrumb( breadcrumb: string, mode: BreadcrumbVisibility = BreadcrumbVisibility.CRASHES_ONLY, ): Promise { await InstrumentationModule.leaveBreadcrumb(breadcrumb, mode); } export {leaveBreadcrumb, BreadcrumbVisibility};