config-section.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. // TS types for elements on the Config pages
  2. // for dropdown
  3. export interface SocialHandleDropdownItem {
  4. icon: string;
  5. platform: string;
  6. key: string;
  7. }
  8. export type FieldUpdaterFunc = (args: UpdateArgs) => void;
  9. export interface UpdateArgs {
  10. value: any;
  11. fieldName?: string;
  12. path?: string;
  13. }
  14. export interface ApiPostArgs {
  15. apiPath: string;
  16. data: object;
  17. onSuccess?: (arg: any) => void;
  18. onError?: (arg: any) => void;
  19. }
  20. export interface ConfigDirectoryFields {
  21. enabled: boolean;
  22. instanceUrl: string;
  23. }
  24. export interface ConfigInstanceDetailsFields {
  25. customStyles: string;
  26. customJavascript: string;
  27. extraPageContent: string;
  28. logo: string;
  29. name: string;
  30. nsfw: boolean;
  31. socialHandles: SocialHandle[];
  32. streamTitle: string;
  33. summary: string;
  34. offlineMessage: string;
  35. tags: string[];
  36. title: string;
  37. welcomeMessage: string;
  38. appearanceVariables: AppearanceVariables;
  39. }
  40. export type CpuUsageLevel = 1 | 2 | 3 | 4 | 5;
  41. // from data
  42. export interface SocialHandle {
  43. platform: string;
  44. url: string;
  45. }
  46. export interface VideoVariant {
  47. key?: number; // unique identifier generated on client side just for ant table rendering
  48. cpuUsageLevel: CpuUsageLevel;
  49. framerate: number;
  50. audioPassthrough: boolean;
  51. audioBitrate: number;
  52. videoPassthrough: boolean;
  53. videoBitrate: number;
  54. scaledWidth: number;
  55. scaledHeight: number;
  56. name: string;
  57. }
  58. export interface VideoSettingsFields {
  59. latencyLevel: number;
  60. videoQualityVariants: VideoVariant[];
  61. cpuUsageLevel: CpuUsageLevel;
  62. }
  63. export interface S3Field {
  64. acl?: string;
  65. accessKey: string;
  66. bucket: string;
  67. enabled: boolean;
  68. endpoint: string;
  69. region: string;
  70. secret: string;
  71. pathPrefix: string;
  72. forcePathStyle: boolean;
  73. }
  74. type AppearanceVariables = {
  75. [key: string]: string;
  76. };
  77. export interface ExternalAction {
  78. title: string;
  79. description: string;
  80. url: string;
  81. openExternally: boolean;
  82. }
  83. export interface Federation {
  84. enabled: boolean;
  85. isPrivate: boolean;
  86. username: string;
  87. goLiveMessage: string;
  88. showEngagement: boolean;
  89. blockedDomains: string[];
  90. }
  91. export interface BrowserNotification {
  92. enabled: boolean;
  93. goLiveMessage: string;
  94. }
  95. export interface DiscordNotification {
  96. enabled: boolean;
  97. webhook: string;
  98. goLiveMessage: string;
  99. }
  100. export interface NotificationsConfig {
  101. browser: BrowserNotification;
  102. discord: DiscordNotification;
  103. }
  104. export interface Health {
  105. healthy: boolean;
  106. healthyPercentage: number;
  107. message: string;
  108. representation: number;
  109. }
  110. export interface StreamKey {
  111. key: string;
  112. comment: string;
  113. }
  114. export interface ConfigDetails {
  115. externalActions: ExternalAction[];
  116. ffmpegPath: string;
  117. instanceDetails: ConfigInstanceDetailsFields;
  118. rtmpServerPort: string;
  119. s3: S3Field;
  120. streamKeys: StreamKey[];
  121. streamKeyOverridden: boolean;
  122. adminPassword: string;
  123. videoSettings: VideoSettingsFields;
  124. webServerPort: string;
  125. socketHostOverride: string;
  126. videoServingEndpoint: string;
  127. yp: ConfigDirectoryFields;
  128. supportedCodecs: string[];
  129. videoCodec: string;
  130. forbiddenUsernames: string[];
  131. suggestedUsernames: string[];
  132. chatDisabled: boolean;
  133. chatSpamProtectionEnabled: boolean;
  134. chatSlurFilterEnabled: boolean;
  135. federation: Federation;
  136. notifications: NotificationsConfig;
  137. chatJoinMessagesEnabled: boolean;
  138. chatEstablishedUserMode: boolean;
  139. hideViewerCount: boolean;
  140. disableSearchIndexing: boolean;
  141. }