types.tsx 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import {EntryException} from 'sentry/types';
  2. import type {ReplayError, ReplayRecord} from 'sentry/views/replays/types';
  3. import type {Replay} from './replay';
  4. type SimpleStub<T = any> = () => T;
  5. type OverridableStub<Params = any, Result = Params> = (
  6. params?: Partial<Params>
  7. ) => Result;
  8. type OverridableVariadicStub<Params = any, Result = Params> = (
  9. ...params: Array<Partial<Params>>
  10. ) => Result;
  11. type OverridableStubList<Params = any, Result = Params> = (
  12. params?: Array<Partial<Params>>
  13. ) => Result[];
  14. type TestStubFixtures = {
  15. ApiToken: OverridableStub;
  16. AvailableNotificationActions: OverridableStub;
  17. CodeOwner: OverridableStub;
  18. Config: OverridableStub;
  19. Dashboard: OverridableVariadicStub;
  20. DocIntegration: OverridableStub;
  21. Environments: SimpleStub;
  22. Event: OverridableStub;
  23. EventEntry: OverridableStub;
  24. EventEntryDebugMeta: OverridableStub;
  25. EventEntryExceptionGroup: SimpleStub<EntryException>;
  26. EventStacktraceException: OverridableStub;
  27. Frame: OverridableStub;
  28. GitHubIntegration: OverridableStub;
  29. Group: OverridableStub;
  30. Incident: OverridableStub;
  31. Member: OverridableStub;
  32. Members: OverridableStubList;
  33. MetricRule: OverridableStub;
  34. OrgRoleList: OverridableStub;
  35. Organization: OverridableStub;
  36. PageFilters: OverridableStub;
  37. PlatformExternalIssue: OverridableStub;
  38. Plugin: OverridableStub;
  39. Plugins: OverridableStubList;
  40. Project: OverridableStub;
  41. ProjectAlertRule: OverridableStub;
  42. ProjectKeys: OverridableStubList;
  43. Release: (params?: any, healthParams?: any) => any;
  44. Replay: typeof Replay;
  45. ReplayError: OverridableStub<ReplayError>;
  46. ReplayRecord: OverridableStub<ReplayRecord>;
  47. Repository: OverridableStub;
  48. SentryApp: OverridableStub;
  49. SentryAppComponent: OverridableStub;
  50. SentryAppComponentAsync: OverridableStub;
  51. SentryAppComponentDependent: OverridableStub;
  52. SentryAppInstallation: OverridableStub;
  53. Team: OverridableStub;
  54. User: OverridableStub;
  55. Widget: OverridableVariadicStub;
  56. // TODO: These need propertly typed still
  57. // Widget(queries = {...DEFAULT_QUERIES}, options)
  58. // Dashboard(widgets = DEFAULT_WIDGETS, props = {})
  59. };
  60. export default TestStubFixtures;