widgetViewerContext.tsx 898 B

123456789101112131415161718192021222324252627
  1. import {createContext} from 'react';
  2. import type {Series} from 'sentry/types/echarts';
  3. import type {Confidence} from 'sentry/types/organization';
  4. import type {TableDataWithTitle} from 'sentry/utils/discover/discoverQuery';
  5. import type {AggregationOutputType} from 'sentry/utils/discover/fields';
  6. export type WidgetViewerContextProps = {
  7. setData: (data: {
  8. confidence?: Confidence;
  9. pageLinks?: string;
  10. seriesData?: Series[];
  11. seriesResultsType?: Record<string, AggregationOutputType>;
  12. tableData?: TableDataWithTitle[];
  13. totalIssuesCount?: string;
  14. }) => void;
  15. confidence?: Confidence;
  16. pageLinks?: string;
  17. seriesData?: Series[];
  18. seriesResultsType?: Record<string, AggregationOutputType>;
  19. tableData?: TableDataWithTitle[];
  20. totalIssuesCount?: string;
  21. };
  22. export const WidgetViewerContext = createContext<WidgetViewerContextProps>({
  23. setData: () => undefined,
  24. });