mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	chore(client/ts): port services/mermaid
This commit is contained in:
		
							parent
							
								
									f4c73d45c7
								
							
						
					
					
						commit
						c93fcc6988
					
				| @ -11,7 +11,7 @@ let elkLoaded = false; | |||||||
|  *  |  *  | ||||||
|  * @param mermaidContent the plain text of the mermaid diagram, potentially including a frontmatter. |  * @param mermaidContent the plain text of the mermaid diagram, potentially including a frontmatter. | ||||||
|  */ |  */ | ||||||
| export async function loadElkIfNeeded(mermaidContent) { | export async function loadElkIfNeeded(mermaidContent: string) { | ||||||
|     if (elkLoaded) { |     if (elkLoaded) { | ||||||
|         // Exit immediately since the ELK library is already loaded.
 |         // Exit immediately since the ELK library is already loaded.
 | ||||||
|         return; |         return; | ||||||
							
								
								
									
										12
									
								
								src/public/app/types.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								src/public/app/types.d.ts
									
									
									
									
										vendored
									
									
								
							| @ -128,8 +128,20 @@ declare global { | |||||||
|             securityLevel: "antiscript" |             securityLevel: "antiscript" | ||||||
|         }): void; |         }): void; | ||||||
|         render(selector: string, data: string); |         render(selector: string, data: string); | ||||||
|  |     } | ||||||
|  |     interface MermaidLoader { | ||||||
|  | 
 | ||||||
|     } |     } | ||||||
|     var mermaid: {         |     var mermaid: {         | ||||||
|         mermaidAPI: MermaidApi; |         mermaidAPI: MermaidApi; | ||||||
|  |         registerLayoutLoaders(loader: MermaidLoader); | ||||||
|  |         parse(content: string, opts: { | ||||||
|  |             suppressErrors: true | ||||||
|  |         }): { | ||||||
|  |             config: { | ||||||
|  |                 layout: string; | ||||||
|  |             }             | ||||||
|  |         } | ||||||
|     }; |     }; | ||||||
|  |     var MERMAID_ELK: MermaidLoader; | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran