mirror of
				https://github.com/Ionaru/easy-markdown-editor
				synced 2025-10-31 00:32:16 -06:00 
			
		
		
		
	Stricter typings for the onSuccess and onError calls
This commit is contained in:
		
							parent
							
								
									0a5b0d3ac4
								
							
						
					
					
						commit
						509763f3b2
					
				| @ -92,8 +92,10 @@ const editorImagesCustom = new EasyMDE({ | |||||||
|     imageAccept: 'image/png, image/bmp', |     imageAccept: 'image/png, image/bmp', | ||||||
|     imageCSRFToken: undefined, |     imageCSRFToken: undefined, | ||||||
|     imageMaxSize: 10485760, |     imageMaxSize: 10485760, | ||||||
|     imageUploadFunction: (file: File, onSuccess: Function, onError: Function) => { |     imageUploadFunction: (file: File, onSuccess, onError) => { | ||||||
|         console.log(file) |         console.log(file); | ||||||
|  |         onSuccess('http://image.url/9.png'); | ||||||
|  |         onError('Failed because reasons.'); | ||||||
|     }, |     }, | ||||||
|     imageTexts: { |     imageTexts: { | ||||||
|         sbInit: 'Drag & drop images!', |         sbInit: 'Drag & drop images!', | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								types/easymde.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								types/easymde.d.ts
									
									
									
									
										vendored
									
									
								
							| @ -134,7 +134,7 @@ declare namespace EasyMDE { | |||||||
|         uploadImage?: boolean; |         uploadImage?: boolean; | ||||||
|         imageMaxSize?: number; |         imageMaxSize?: number; | ||||||
|         imageAccept?: string; |         imageAccept?: string; | ||||||
|         imageUploadFunction?: (file: File, onSuccess: Function, onError: Function) => void; |         imageUploadFunction?: (file: File, onSuccess: (url: string) => void, onError: (error: string) => void) => void; | ||||||
|         imageUploadEndpoint?: string; |         imageUploadEndpoint?: string; | ||||||
|         imageCSRFToken?: string; |         imageCSRFToken?: string; | ||||||
|         imageTexts?: ImageTextsOptions; |         imageTexts?: ImageTextsOptions; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user