ts-browser-helpers
Version:
A collection of utility classes, functions and decorators for javascript/typescript projects, for use in the browser.
39 lines • 1.15 kB
TypeScript
import { ImageCanvasOptions } from './image';
/**
* Returns a data url for a 16x16 svg rectangle with the given color.
* @param c - color
*
* @category SVGs
*/
export declare const makeColorSvg: (c: string) => string;
/**
* Returns a data url for a 16x16 svg circle with the given color.
* @param c - color
*
* @category SVGs
*/
export declare const makeColorSvgCircle: (c: string) => string;
/**
* Returns a data url for a svg with the given text.
* @param text
*
* @category SVGs
*/
export declare const makeTextSvg: (text: string) => string;
/**
* Renders an SVG to a canvas.
* @param svgDataUrl - data url of the svg. Can be created with {@link svgUrl}
* @param options - options
*
* @category SVGs
*/
export declare const svgToCanvas: (svgDataUrl: string, options: ImageCanvasOptions) => Promise<HTMLCanvasElement>;
/**
* Renders an SVG to a png data url.
* @param svgDataUrl - data url of the svg. Can be created with {@link svgUrl}
* @param options - options
*
* @category SVGs
*/
export declare const svgToPng: (svgDataUrl: string, options: ImageCanvasOptions) => Promise<string>;
//# sourceMappingURL=svg.d.ts.map