types.tsx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. Organization: OverridableStub;
  34. PageFilters: OverridableStub;
  35. PlatformExternalIssue: OverridableStub;
  36. Plugin: OverridableStub;
  37. Plugins: OverridableStubList;
  38. Project: OverridableStub;
  39. ProjectAlertRule: OverridableStub;
  40. ProjectKeys: OverridableStubList;
  41. Release: (params?: any, healthParams?: any) => any;
  42. Repository: OverridableStub;
  43. SentryApp: OverridableStub;
  44. SentryAppComponent: OverridableStub;
  45. SentryAppComponentAsync: OverridableStub;
  46. SentryAppComponentDependent: OverridableStub;
  47. SentryAppInstallation: OverridableStub;
  48. Team: OverridableStub;
  49. User: OverridableStub;
  50. Widget: OverridableVariadicStub;
  51. // TODO: These need propertly typed still
  52. // Widget(queries = {...DEFAULT_QUERIES}, options)
  53. // Dashboard(widgets = DEFAULT_WIDGETS, props = {})
  54. };
  55. export default TestStubFixtures;