1
- import { convertIntegrationFnToClass , defineIntegration } from '@sentry/core' ;
2
- import type { Integration , IntegrationClass , IntegrationFn } from '@sentry/types' ;
3
- import { ScreenshotButton } from './screenshotButton' ;
4
- import { ScreenshotWidget } from './screenshotWidget' ;
5
- import { GLOBAL_OBJ } from '@sentry/utils' ;
6
- import { h , render } from 'preact' ;
1
+ import { convertIntegrationFnToClass , defineIntegration } from '@sentry/core' ;
2
+ import type { Integration , IntegrationClass , IntegrationFn } from '@sentry/types' ;
3
+ import { ScreenshotButton } from './screenshotButton' ;
4
+ import { ScreenshotWidget } from './screenshotWidget' ;
5
+ import { GLOBAL_OBJ } from '@sentry/utils' ;
6
+ import { h , render } from 'preact' ;
7
7
8
8
interface FeedbackScreenshotOptions {
9
9
el : Element ;
@@ -19,13 +19,18 @@ const INTEGRATION_NAME = 'FeedbackScreenshot';
19
19
const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window ;
20
20
21
21
/** Exported only for type safe tests. */
22
- export const _feedbackScreenshotIntegration = ( ( options : Partial < FeedbackScreenshotOptions > = { } ) => {
22
+ export const _feedbackScreenshotIntegration = ( (
23
+ options : Partial < FeedbackScreenshotOptions > = { }
24
+ ) => {
23
25
return {
24
26
name : INTEGRATION_NAME ,
25
27
// eslint-disable-next-line @typescript-eslint/no-empty-function
26
28
setupOnce ( ) { } ,
27
29
getOptions ( ) : FeedbackScreenshotIntegrationOptions {
28
- return { el : options . el || WINDOW . document . createElement ( 'div' ) , props : options . props || null } ;
30
+ return {
31
+ el : options . el || WINDOW . document . createElement ( 'div' ) ,
32
+ props : options . props || null ,
33
+ } ;
29
34
} ,
30
35
renderScreenshotWidget : ( options : FeedbackScreenshotOptions ) => {
31
36
return render ( < ScreenshotWidget /> , options . el ) ;
@@ -39,15 +44,17 @@ export const _feedbackScreenshotIntegration = ((options: Partial<FeedbackScreens
39
44
/**
40
45
* Add this in addition to `replayIntegration()` to enable canvas recording.
41
46
*/
42
- export const feedbackScreenshotIntegration = defineIntegration ( _feedbackScreenshotIntegration ) ;
47
+ export const feedbackScreenshotIntegration = defineIntegration (
48
+ _feedbackScreenshotIntegration
49
+ ) ;
43
50
44
51
/**
45
52
* @deprecated Use `feedbackScreenshotIntegration()` instead
46
53
*/
47
54
// eslint-disable-next-line deprecation/deprecation
48
55
export const FeedbackScreenshot = convertIntegrationFnToClass (
49
56
INTEGRATION_NAME ,
50
- feedbackScreenshotIntegration ,
57
+ feedbackScreenshotIntegration
51
58
) as IntegrationClass <
52
59
Integration & {
53
60
getOptions : ( ) => FeedbackScreenshotIntegrationOptions ;
0 commit comments