types.tsx 1.9 KB

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