client-config.model.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. export interface ClientConfig {
  2. name: string;
  3. title?: string;
  4. summary: string;
  5. offlineMessage?: string;
  6. logo: string;
  7. tags: string[];
  8. version: string;
  9. nsfw: boolean;
  10. extraPageContent: string;
  11. socialHandles: SocialHandle[];
  12. chatDisabled: boolean;
  13. externalActions: any[];
  14. customStyles: string;
  15. appearanceVariables: Map<string, string>;
  16. maxSocketPayloadSize: number;
  17. federation: Federation;
  18. notifications: Notifications;
  19. authentication: Authentication;
  20. socketHostOverride?: string;
  21. }
  22. interface Authentication {
  23. indieAuthEnabled: boolean;
  24. }
  25. interface Federation {
  26. enabled: boolean;
  27. account: string;
  28. followerCount: number;
  29. }
  30. interface Notifications {
  31. browser: Browser;
  32. }
  33. interface Browser {
  34. enabled: boolean;
  35. publicKey: string;
  36. }
  37. interface SocialHandle {
  38. platform: string;
  39. url: string;
  40. icon: string;
  41. }
  42. export function makeEmptyClientConfig(): ClientConfig {
  43. return {
  44. name: '',
  45. summary: '',
  46. offlineMessage: '',
  47. logo: '',
  48. tags: [],
  49. version: '',
  50. nsfw: false,
  51. extraPageContent: '',
  52. socialHandles: [],
  53. chatDisabled: false,
  54. externalActions: [],
  55. customStyles: '',
  56. appearanceVariables: new Map(),
  57. maxSocketPayloadSize: 0,
  58. federation: {
  59. enabled: false,
  60. account: '',
  61. followerCount: 0,
  62. },
  63. notifications: {
  64. browser: {
  65. enabled: false,
  66. publicKey: '',
  67. },
  68. },
  69. authentication: {
  70. indieAuthEnabled: false,
  71. },
  72. };
  73. }