api.ts 675 B

1234567891011121314151617181920212223242526
  1. import {
  2. FontFamily,
  3. LineHeight,
  4. OverallTheme,
  5. } from '../../../../../modules/source-editor/frontend/js/extensions/theme'
  6. import { Keybindings, PdfViewer } from '../../../../../types/project-settings'
  7. import { postJSON } from '../../../infrastructure/fetch-json'
  8. export type UserSettingsScope = {
  9. pdfViewer: PdfViewer
  10. autoComplete: boolean
  11. autoPairDelimiters: boolean
  12. syntaxValidation: boolean
  13. editorTheme: string
  14. overallTheme: OverallTheme
  15. mode: Keybindings
  16. fontSize: string
  17. fontFamily: FontFamily
  18. lineHeight: LineHeight
  19. }
  20. export function saveUserSettings(data: Partial<UserSettingsScope>) {
  21. postJSON('/user/settings', {
  22. body: data,
  23. })
  24. }