mirror of
				https://github.com/chartdb/chartdb.git
				synced 2025-11-03 21:43:23 +00:00 
			
		
		
		
	* feat(image-export): add watermark, transparent and pattern export image toggles * fix(export-image-provider): use pattern background enabling * add translations + small ui fixes * fix build --------- Co-authored-by: Guy Ben-Aharon <baguy3@gmail.com>
		
			
				
	
	
		
			19 lines
		
	
	
		
			465 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			465 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import { createContext } from 'react';
 | 
						|
import { emptyFn } from '@/lib/utils';
 | 
						|
 | 
						|
export type ImageType = 'png' | 'jpeg' | 'svg';
 | 
						|
export interface ExportImageContext {
 | 
						|
    exportImage: (
 | 
						|
        type: ImageType,
 | 
						|
        options: {
 | 
						|
            includePatternBG: boolean;
 | 
						|
            transparent: boolean;
 | 
						|
            scale: number;
 | 
						|
        }
 | 
						|
    ) => Promise<void>;
 | 
						|
}
 | 
						|
 | 
						|
export const exportImageContext = createContext<ExportImageContext>({
 | 
						|
    exportImage: emptyFn,
 | 
						|
});
 |