overleaf/services/web/frontend/js/features/editor-left-menu/utils/api.ts
M Fahru 09b1974a3d Migrate updating overallTheme to react
GitOrigin-RevId: 024ceb3c32c8d90ac0067fbb72d6e7d327b869f0
2023-01-11 09:06:12 +00:00

26 lines
675 B
TypeScript

import {
FontFamily,
LineHeight,
OverallTheme,
} from '../../../../../modules/source-editor/frontend/js/extensions/theme'
import { Keybindings, PdfViewer } from '../../../../../types/project-settings'
import { postJSON } from '../../../infrastructure/fetch-json'
export type UserSettingsScope = {
pdfViewer: PdfViewer
autoComplete: boolean
autoPairDelimiters: boolean
syntaxValidation: boolean
editorTheme: string
overallTheme: OverallTheme
mode: Keybindings
fontSize: string
fontFamily: FontFamily
lineHeight: LineHeight
}
export function saveUserSettings(data: Partial<UserSettingsScope>) {
postJSON('/user/settings', {
body: data,
})
}