Home Reference Source

lib6/notification-filter.js

  1. /**
  2. * @typedef {'WARNING' | 'INFORMATION' | 'OFF'} NotificationFilterMinimumSeverityLevel
  3. */
  4. /**
  5. * Constants that represents the minimum Severity level in the {@link NotificationFilter}
  6. */
  7. const notificationFilterMinimumSeverityLevel = {
  8. OFF: 'OFF',
  9. WARNING: 'WARNING',
  10. INFORMATION: 'INFORMATION'
  11. };
  12. Object.freeze(notificationFilterMinimumSeverityLevel);
  13. /**
  14. * @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC'} NotificationFilterDisabledCategory
  15. */
  16. /**
  17. * Constants that represents the disabled categories in the {@link NotificationFilter}
  18. */
  19. const notificationFilterDisabledCategory = {
  20. HINT: 'HINT',
  21. UNRECOGNIZED: 'UNRECOGNIZED',
  22. UNSUPPORTED: 'UNSUPPORTED',
  23. PERFORMANCE: 'PERFORMANCE',
  24. TOPOLOGY: 'TOPOLOGY',
  25. SECURITY: 'SECURITY',
  26. DEPRECATION: 'DEPRECATION',
  27. GENERIC: 'GENERIC'
  28. };
  29. Object.freeze(notificationFilterDisabledCategory);
  30. /**
  31. * @typedef {NotificationFilterDisabledCategory} NotificationFilterDisabledClassification
  32. * @experimental
  33. */
  34. /**
  35. * Constants that represents the disabled classifications in the {@link NotificationFilter}
  36. *
  37. * @type {notificationFilterDisabledCategory}
  38. * @experimental
  39. */
  40. const notificationFilterDisabledClassification = notificationFilterDisabledCategory;
  41. /**
  42. * The notification filter object which can be configured in
  43. * the session and driver creation.
  44. *
  45. * Values not defined are interpreted as default.
  46. *
  47. * @interface
  48. */
  49. class NotificationFilter {
  50. /**
  51. * @constructor
  52. * @private
  53. */
  54. constructor() {
  55. /**
  56. * The minimum level of all notifications to receive.
  57. *
  58. * @public
  59. * @type {?NotificationFilterMinimumSeverityLevel}
  60. */
  61. this.minimumSeverityLevel = undefined;
  62. /**
  63. * Categories the user would like to opt-out of receiving.
  64. *
  65. *
  66. * This property is equivalent to {@link NotificationFilter#disabledClassifications}
  67. * and it must not be enabled at same time.
  68. *
  69. * @type {?NotificationFilterDisabledCategory[]}
  70. */
  71. this.disabledCategories = undefined;
  72. /**
  73. * Classifications the user would like to opt-out of receiving.
  74. *
  75. * This property is equivalent to {@link NotificationFilter#disabledCategories}
  76. * and it must not be enabled at same time.
  77. *
  78. * @type {?NotificationFilterDisabledClassification[]}
  79. * @experimental
  80. */
  81. this.disabledClassifications = undefined;
  82. throw new Error('Not implemented');
  83. }
  84. }
  85. export default NotificationFilter;
  86. export { notificationFilterMinimumSeverityLevel, notificationFilterDisabledCategory, notificationFilterDisabledClassification };