mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 19:19:03 +01:00 
			
		
		
		
	chore(ckeditor5): type errors due to augmentation
This commit is contained in:
		
							parent
							
								
									26c1cbeff1
								
							
						
					
					
						commit
						395bc372ce
					
				| @ -97,7 +97,7 @@ export function loadHighlightingTheme(themeName: string) { | |||||||
|  */ |  */ | ||||||
| export function isSyntaxHighlightEnabled() { | export function isSyntaxHighlightEnabled() { | ||||||
|     const theme = options.get("codeBlockTheme"); |     const theme = options.get("codeBlockTheme"); | ||||||
|     return theme && theme !== "none"; |     return !!theme && theme !== "none"; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | |||||||
| @ -111,7 +111,7 @@ export function buildConfig(): EditorConfig { | |||||||
|             }, |             }, | ||||||
|             mapLanguageName: getHighlightJsNameForMime, |             mapLanguageName: getHighlightJsNameForMime, | ||||||
|             defaultMimeType: MIME_TYPE_AUTO, |             defaultMimeType: MIME_TYPE_AUTO, | ||||||
|             enabled: isSyntaxHighlightEnabled |             enabled: isSyntaxHighlightEnabled() | ||||||
|         }, |         }, | ||||||
|         clipboard: { |         clipboard: { | ||||||
|             copy: copyText |             copy: copyText | ||||||
|  | |||||||
| @ -22,28 +22,3 @@ declare global { | |||||||
|         importMarkdownInline(): void; |         importMarkdownInline(): void; | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 |  | ||||||
| declare module "ckeditor5" { |  | ||||||
|     interface Editor { |  | ||||||
|         getSelectedHtml(): string; |  | ||||||
|         removeSelection(): Promise<void>; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     interface EditorConfig { |  | ||||||
|         syntaxHighlighting?: { |  | ||||||
|             loadHighlightJs: () => Promise<any>; |  | ||||||
|             mapLanguageName(mimeType: string): string; |  | ||||||
|             defaultMimeType: string; |  | ||||||
|             enabled: boolean; |  | ||||||
|         }, |  | ||||||
|         moveBlockUp?: { |  | ||||||
|             keystroke: string[]; |  | ||||||
|         }, |  | ||||||
|         moveBlockDown?: { |  | ||||||
|             keystroke: string[]; |  | ||||||
|         }, |  | ||||||
|         clipboard?: { |  | ||||||
|             copy(text: string): void; |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| } |  | ||||||
|  | |||||||
| @ -43,3 +43,28 @@ export class PopupEditor extends BalloonEditor { | |||||||
|         return POPUP_EDITOR_PLUGINS; |         return POPUP_EDITOR_PLUGINS; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | declare module "ckeditor5" { | ||||||
|  |     interface Editor { | ||||||
|  |         getSelectedHtml(): string; | ||||||
|  |         removeSelection(): Promise<void>; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     interface EditorConfig { | ||||||
|  |         syntaxHighlighting?: { | ||||||
|  |             loadHighlightJs: () => Promise<any>; | ||||||
|  |             mapLanguageName(mimeType: string): string; | ||||||
|  |             defaultMimeType: string; | ||||||
|  |             enabled: boolean; | ||||||
|  |         }, | ||||||
|  |         moveBlockUp?: { | ||||||
|  |             keystroke: string[]; | ||||||
|  |         }, | ||||||
|  |         moveBlockDown?: { | ||||||
|  |             keystroke: string[]; | ||||||
|  |         }, | ||||||
|  |         clipboard?: { | ||||||
|  |             copy(text: string): void; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran