| 
									
										
										
										
											2025-01-09 18:36:24 +02:00
										 |  |  | import type { KeyboardActionNames } from "./keyboard_actions_interface.js"; | 
					
						
							| 
									
										
										
										
											2025-01-03 18:40:52 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * A dictionary where the keys are the option keys (e.g. `theme`) and their corresponding values. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export type OptionMap = Record<OptionNames, string>; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * For each keyboard action, there is a corresponding option which identifies the key combination defined by the user. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | type KeyboardShortcutsOptions<T extends KeyboardActionNames> = { | 
					
						
							| 
									
										
										
										
											2025-01-09 18:07:02 +02:00
										 |  |  |     [key in T as `keyboardShortcuts${Capitalize<key>}`]: string; | 
					
						
							| 
									
										
										
										
											2025-01-03 18:40:52 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-03 20:08:58 +02:00
										 |  |  | export type FontFamily = "theme" | "serif" | "sans-serif" | "monospace" | string; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-03 18:40:52 +02:00
										 |  |  | export interface OptionDefinitions extends KeyboardShortcutsOptions<KeyboardActionNames> { | 
					
						
							| 
									
										
										
										
											2025-01-09 18:07:02 +02:00
										 |  |  |     openNoteContexts: string; | 
					
						
							|  |  |  |     lastDailyBackupDate: string; | 
					
						
							|  |  |  |     lastWeeklyBackupDate: string; | 
					
						
							|  |  |  |     lastMonthlyBackupDate: string; | 
					
						
							|  |  |  |     dbVersion: string; | 
					
						
							|  |  |  |     theme: string; | 
					
						
							|  |  |  |     syncServerHost: string; | 
					
						
							|  |  |  |     syncServerTimeout: string; | 
					
						
							|  |  |  |     syncProxy: string; | 
					
						
							|  |  |  |     mainFontFamily: FontFamily; | 
					
						
							|  |  |  |     treeFontFamily: FontFamily; | 
					
						
							|  |  |  |     detailFontFamily: FontFamily; | 
					
						
							|  |  |  |     monospaceFontFamily: FontFamily; | 
					
						
							|  |  |  |     spellCheckLanguageCode: string; | 
					
						
							|  |  |  |     codeNotesMimeTypes: string; | 
					
						
							|  |  |  |     headingStyle: string; | 
					
						
							|  |  |  |     highlightsList: string; | 
					
						
							|  |  |  |     customSearchEngineName: string; | 
					
						
							|  |  |  |     customSearchEngineUrl: string; | 
					
						
							|  |  |  |     locale: string; | 
					
						
							|  |  |  |     codeBlockTheme: string; | 
					
						
							|  |  |  |     textNoteEditorType: string; | 
					
						
							|  |  |  |     layoutOrientation: string; | 
					
						
							|  |  |  |     allowedHtmlTags: string; | 
					
						
							|  |  |  |     documentId: string; | 
					
						
							|  |  |  |     documentSecret: string; | 
					
						
							|  |  |  |     passwordVerificationHash: string; | 
					
						
							|  |  |  |     passwordVerificationSalt: string; | 
					
						
							|  |  |  |     passwordDerivedKeySalt: string; | 
					
						
							|  |  |  |     encryptedDataKey: string; | 
					
						
							| 
									
										
										
										
											2025-01-03 18:40:52 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-02 18:58:25 -08:00
										 |  |  |     // AI/LLM integration options
 | 
					
						
							| 
									
										
										
										
											2025-03-08 22:04:31 +00:00
										 |  |  |     aiEnabled: boolean; | 
					
						
							| 
									
										
										
										
											2025-03-02 18:58:25 -08:00
										 |  |  |     openaiApiKey: string; | 
					
						
							|  |  |  |     openaiDefaultModel: string; | 
					
						
							|  |  |  |     openaiBaseUrl: string; | 
					
						
							|  |  |  |     anthropicApiKey: string; | 
					
						
							|  |  |  |     anthropicDefaultModel: string; | 
					
						
							|  |  |  |     anthropicBaseUrl: string; | 
					
						
							| 
									
										
										
										
											2025-03-08 22:04:31 +00:00
										 |  |  |     ollamaEnabled: boolean; | 
					
						
							| 
									
										
										
										
											2025-03-02 18:58:25 -08:00
										 |  |  |     ollamaBaseUrl: string; | 
					
						
							|  |  |  |     ollamaDefaultModel: string; | 
					
						
							| 
									
										
										
										
											2025-03-08 22:23:50 +00:00
										 |  |  |     ollamaEmbeddingModel: string; | 
					
						
							| 
									
										
										
										
											2025-03-02 18:58:25 -08:00
										 |  |  |     aiProviderPrecedence: string; | 
					
						
							|  |  |  |     aiTemperature: string; | 
					
						
							|  |  |  |     aiSystemPrompt: string; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-08 22:04:31 +00:00
										 |  |  |     // Embedding-related options
 | 
					
						
							|  |  |  |     embeddingAutoUpdateEnabled: boolean; | 
					
						
							|  |  |  |     embeddingUpdateInterval: number; | 
					
						
							|  |  |  |     embeddingBatchSize: number; | 
					
						
							|  |  |  |     embeddingDefaultDimension: number; | 
					
						
							| 
									
										
										
										
											2025-03-08 22:23:50 +00:00
										 |  |  |     embeddingAutoUpdate: boolean; | 
					
						
							| 
									
										
										
										
											2025-03-09 02:19:26 +00:00
										 |  |  |     embeddingsDefaultProvider: string; | 
					
						
							| 
									
										
										
										
											2025-03-11 23:26:39 +00:00
										 |  |  |     enableAutomaticIndexing: boolean; | 
					
						
							|  |  |  |     embeddingSimilarityThreshold: string; | 
					
						
							|  |  |  |     maxNotesPerLlmQuery: string; | 
					
						
							| 
									
										
										
										
											2025-03-08 22:04:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 18:07:02 +02:00
										 |  |  |     lastSyncedPull: number; | 
					
						
							|  |  |  |     lastSyncedPush: number; | 
					
						
							|  |  |  |     revisionSnapshotTimeInterval: number; | 
					
						
							| 
									
										
										
										
											2025-02-18 08:57:58 +01:00
										 |  |  |     revisionSnapshotTimeIntervalTimeScale: number; | 
					
						
							| 
									
										
										
										
											2025-01-09 18:07:02 +02:00
										 |  |  |     revisionSnapshotNumberLimit: number; | 
					
						
							|  |  |  |     protectedSessionTimeout: number; | 
					
						
							| 
									
										
										
										
											2025-02-18 09:20:57 +01:00
										 |  |  |     protectedSessionTimeoutTimeScale: number; | 
					
						
							| 
									
										
										
										
											2025-01-09 18:07:02 +02:00
										 |  |  |     zoomFactor: number; | 
					
						
							|  |  |  |     mainFontSize: number; | 
					
						
							|  |  |  |     treeFontSize: number; | 
					
						
							|  |  |  |     detailFontSize: number; | 
					
						
							|  |  |  |     monospaceFontSize: number; | 
					
						
							|  |  |  |     imageMaxWidthHeight: number; | 
					
						
							|  |  |  |     imageJpegQuality: number; | 
					
						
							|  |  |  |     leftPaneWidth: number; | 
					
						
							|  |  |  |     rightPaneWidth: number; | 
					
						
							|  |  |  |     eraseEntitiesAfterTimeInSeconds: number; | 
					
						
							| 
									
										
										
										
											2025-02-08 11:55:16 +01:00
										 |  |  |     eraseEntitiesAfterTimeScale: number; | 
					
						
							| 
									
										
										
										
											2025-01-09 18:07:02 +02:00
										 |  |  |     autoReadonlySizeText: number; | 
					
						
							|  |  |  |     autoReadonlySizeCode: number; | 
					
						
							|  |  |  |     maxContentWidth: number; | 
					
						
							|  |  |  |     minTocHeadings: number; | 
					
						
							|  |  |  |     eraseUnusedAttachmentsAfterSeconds: number; | 
					
						
							| 
									
										
										
										
											2025-02-16 14:00:28 +01:00
										 |  |  |     eraseUnusedAttachmentsAfterTimeScale: number; | 
					
						
							| 
									
										
										
										
											2025-01-09 18:07:02 +02:00
										 |  |  |     firstDayOfWeek: number; | 
					
						
							| 
									
										
										
										
											2025-03-02 21:58:40 +02:00
										 |  |  |     languages: string; | 
					
						
							| 
									
										
										
										
											2025-01-03 18:40:52 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 18:07:02 +02:00
										 |  |  |     initialized: boolean; | 
					
						
							| 
									
										
										
										
											2025-01-11 11:40:22 +02:00
										 |  |  |     isPasswordSet: boolean; | 
					
						
							| 
									
										
										
										
											2025-01-09 18:07:02 +02:00
										 |  |  |     overrideThemeFonts: boolean; | 
					
						
							|  |  |  |     spellCheckEnabled: boolean; | 
					
						
							|  |  |  |     autoFixConsistencyIssues: boolean; | 
					
						
							|  |  |  |     vimKeymapEnabled: boolean; | 
					
						
							|  |  |  |     codeLineWrapEnabled: boolean; | 
					
						
							|  |  |  |     leftPaneVisible: boolean; | 
					
						
							|  |  |  |     rightPaneVisible: boolean; | 
					
						
							|  |  |  |     nativeTitleBarVisible: boolean; | 
					
						
							|  |  |  |     hideArchivedNotes_main: boolean; | 
					
						
							|  |  |  |     debugModeEnabled: boolean; | 
					
						
							|  |  |  |     autoCollapseNoteTree: boolean; | 
					
						
							|  |  |  |     dailyBackupEnabled: boolean; | 
					
						
							|  |  |  |     weeklyBackupEnabled: boolean; | 
					
						
							|  |  |  |     monthlyBackupEnabled: boolean; | 
					
						
							|  |  |  |     compressImages: boolean; | 
					
						
							|  |  |  |     downloadImagesAutomatically: boolean; | 
					
						
							|  |  |  |     checkForUpdates: boolean; | 
					
						
							|  |  |  |     disableTray: boolean; | 
					
						
							|  |  |  |     promotedAttributesOpenInRibbon: boolean; | 
					
						
							|  |  |  |     editedNotesOpenInRibbon: boolean; | 
					
						
							|  |  |  |     codeBlockWordWrap: boolean; | 
					
						
							|  |  |  |     textNoteEditorMultilineToolbar: boolean; | 
					
						
							|  |  |  |     backgroundEffects: boolean; | 
					
						
							| 
									
										
										
										
											2025-02-17 13:46:03 -07:00
										 |  |  |     // Share settings
 | 
					
						
							|  |  |  |     redirectBareDomain: boolean; | 
					
						
							|  |  |  |     showLoginInShareTheme: boolean; | 
					
						
							| 
									
										
										
										
											2025-01-09 18:07:02 +02:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2025-01-03 18:40:52 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | export type OptionNames = keyof OptionDefinitions; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export type FilterOptionsByType<U> = { | 
					
						
							|  |  |  |     [K in keyof OptionDefinitions]: OptionDefinitions[K] extends U ? K : never; | 
					
						
							|  |  |  | }[keyof OptionDefinitions]; |