widgetViewerContext.tsx 768 B

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