Skip to content

Commit f8c9870

Browse files
committed
fix(types): add EditorSettings interface and update tsconfig
1 parent dbd7368 commit f8c9870

4 files changed

Lines changed: 15 additions & 14 deletions

File tree

src/main/store/types/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type ElectronStore from 'electron-store'
2-
import type { Settings as EditorSettings } from '../../../renderer/composables/types/editor'
32

43
export interface AppStore {
54
bounds: object
@@ -18,6 +17,18 @@ export interface AppStore {
1817
isAutoMigratedFromJson: boolean
1918
}
2019

20+
export interface EditorSettings {
21+
fontSize: number
22+
fontFamily: string
23+
wrap: boolean
24+
tabSize: number
25+
trailingComma: 'all' | 'none' | 'es5'
26+
semi: boolean
27+
singleQuote: boolean
28+
highlightLine: boolean
29+
matchBrackets: boolean
30+
}
31+
2132
export interface PreferencesStore {
2233
storagePath: string
2334
backupPath: string

src/renderer/composables/types/editor.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/renderer/composables/useEditor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import type { Settings } from './types/editor'
1+
import type { EditorSettings } from '~/main/store/types'
22
import { store } from '@/electron'
33

44
const cursorPosition = reactive({
55
row: 0,
66
column: 0,
77
})
88

9-
const settings = reactive<Settings>(store.preferences.get('editor'))
9+
const settings = reactive<EditorSettings>(store.preferences.get('editor'))
1010

1111
watch(
1212
settings,

tsconfig.main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "ES2023",
4+
"rootDir": "src/main",
45
"module": "CommonJS",
56
"strict": true,
67
"inlineSources": true,

0 commit comments

Comments
 (0)