@bbearai/react-native 0.3.11 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
- import React, { ReactNode } from 'react';
2
- import { BugBearConfig, BugBearClient, TesterInfo, TestAssignment, DeviceInfo, TesterThread, TesterMessage, QASession, QAFinding, StartSessionOptions, AddFindingOptions, TesterProfileUpdate, AppContext } from '@bbearai/core';
1
+ import React, { ReactNode, Component, ErrorInfo } from 'react';
2
+ import * as _bbearai_core from '@bbearai/core';
3
+ import { BugBearConfig, BugBearClient, TesterInfo, TestAssignment, DeviceInfo, TesterThread, TesterMessage, QASession, QAFinding, StartSessionOptions, AddFindingOptions, TesterProfileUpdate, AppContext, captureError } from '@bbearai/core';
3
4
  export { AppContext, BugBearConfig, BugBearReport, DeviceInfo, MessageSenderType, ReportType, Severity, TestAssignment, TesterInfo, TesterMessage, TesterThread, ThreadPriority, ThreadType } from '@bbearai/core';
4
5
 
5
6
  interface BugBearContextValue {
@@ -74,6 +75,8 @@ interface BugBearContextValue {
74
75
  refreshTesterInfo: () => Promise<void>;
75
76
  /** URL to the BugBear web dashboard (for linking testers to the full web experience) */
76
77
  dashboardUrl?: string;
78
+ /** Error handler from config — wire to your error reporting service */
79
+ onError?: (error: Error, context?: Record<string, unknown>) => void;
77
80
  }
78
81
  declare function useBugBear(): BugBearContextValue;
79
82
  interface BugBearProviderProps {
@@ -110,4 +113,36 @@ interface BugBearButtonProps {
110
113
  }
111
114
  declare function BugBearButton({ position, buttonStyle, draggable, initialX, initialY, minY, maxYOffset, }: BugBearButtonProps): React.JSX.Element | null;
112
115
 
113
- export { BugBearButton, BugBearProvider, useBugBear };
116
+ interface Props {
117
+ children: ReactNode;
118
+ /** Fallback UI to show when an error occurs */
119
+ fallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode);
120
+ /** Called when an error is captured (React ErrorInfo included) */
121
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
122
+ /** Error reporter from BugBearConfig — wire to Sentry.captureException etc. */
123
+ errorReporter?: (error: Error, context?: Record<string, unknown>) => void;
124
+ }
125
+ interface State {
126
+ hasError: boolean;
127
+ error: Error | null;
128
+ errorInfo: ErrorInfo | null;
129
+ }
130
+ /**
131
+ * Error boundary that captures React Native errors and integrates with BugBear
132
+ */
133
+ declare class BugBearErrorBoundary extends Component<Props, State> {
134
+ constructor(props: Props);
135
+ static getDerivedStateFromError(error: Error): Partial<State>;
136
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
137
+ reset: () => void;
138
+ render(): ReactNode;
139
+ }
140
+ /**
141
+ * Hook to get current error context for manual error reporting
142
+ */
143
+ declare function useErrorContext(): {
144
+ captureError: typeof captureError;
145
+ getEnhancedContext: () => _bbearai_core.EnhancedBugContext;
146
+ };
147
+
148
+ export { BugBearButton, BugBearErrorBoundary, BugBearProvider, useBugBear, useErrorContext };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import React, { ReactNode } from 'react';
2
- import { BugBearConfig, BugBearClient, TesterInfo, TestAssignment, DeviceInfo, TesterThread, TesterMessage, QASession, QAFinding, StartSessionOptions, AddFindingOptions, TesterProfileUpdate, AppContext } from '@bbearai/core';
1
+ import React, { ReactNode, Component, ErrorInfo } from 'react';
2
+ import * as _bbearai_core from '@bbearai/core';
3
+ import { BugBearConfig, BugBearClient, TesterInfo, TestAssignment, DeviceInfo, TesterThread, TesterMessage, QASession, QAFinding, StartSessionOptions, AddFindingOptions, TesterProfileUpdate, AppContext, captureError } from '@bbearai/core';
3
4
  export { AppContext, BugBearConfig, BugBearReport, DeviceInfo, MessageSenderType, ReportType, Severity, TestAssignment, TesterInfo, TesterMessage, TesterThread, ThreadPriority, ThreadType } from '@bbearai/core';
4
5
 
5
6
  interface BugBearContextValue {
@@ -74,6 +75,8 @@ interface BugBearContextValue {
74
75
  refreshTesterInfo: () => Promise<void>;
75
76
  /** URL to the BugBear web dashboard (for linking testers to the full web experience) */
76
77
  dashboardUrl?: string;
78
+ /** Error handler from config — wire to your error reporting service */
79
+ onError?: (error: Error, context?: Record<string, unknown>) => void;
77
80
  }
78
81
  declare function useBugBear(): BugBearContextValue;
79
82
  interface BugBearProviderProps {
@@ -110,4 +113,36 @@ interface BugBearButtonProps {
110
113
  }
111
114
  declare function BugBearButton({ position, buttonStyle, draggable, initialX, initialY, minY, maxYOffset, }: BugBearButtonProps): React.JSX.Element | null;
112
115
 
113
- export { BugBearButton, BugBearProvider, useBugBear };
116
+ interface Props {
117
+ children: ReactNode;
118
+ /** Fallback UI to show when an error occurs */
119
+ fallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode);
120
+ /** Called when an error is captured (React ErrorInfo included) */
121
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
122
+ /** Error reporter from BugBearConfig — wire to Sentry.captureException etc. */
123
+ errorReporter?: (error: Error, context?: Record<string, unknown>) => void;
124
+ }
125
+ interface State {
126
+ hasError: boolean;
127
+ error: Error | null;
128
+ errorInfo: ErrorInfo | null;
129
+ }
130
+ /**
131
+ * Error boundary that captures React Native errors and integrates with BugBear
132
+ */
133
+ declare class BugBearErrorBoundary extends Component<Props, State> {
134
+ constructor(props: Props);
135
+ static getDerivedStateFromError(error: Error): Partial<State>;
136
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
137
+ reset: () => void;
138
+ render(): ReactNode;
139
+ }
140
+ /**
141
+ * Hook to get current error context for manual error reporting
142
+ */
143
+ declare function useErrorContext(): {
144
+ captureError: typeof captureError;
145
+ getEnhancedContext: () => _bbearai_core.EnhancedBugContext;
146
+ };
147
+
148
+ export { BugBearButton, BugBearErrorBoundary, BugBearProvider, useBugBear, useErrorContext };