@slithy/prim-interface 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ type Background = string | [png: string, jpeg: string];
|
|
|
55
55
|
declare function saveRaster(canvas: HTMLCanvasElement, format?: 'png' | 'jpeg', quality?: number, options?: SaveOptions): void;
|
|
56
56
|
declare function saveRasterFromVector(svgString: string, width: number, height: number, format?: 'png' | 'jpeg', quality?: number, options?: SaveOptions, background?: Background): Promise<void>;
|
|
57
57
|
declare function copyRasterFromVector(svgString: string, width: number, height: number): Promise<void>;
|
|
58
|
-
declare function shareFromVector(svgString: string, width: number, height: number, options?: SaveOptions): Promise<void>;
|
|
58
|
+
declare function shareFromVector(svgString: string, width: number, height: number, options?: SaveOptions, background?: Background): Promise<void>;
|
|
59
59
|
declare function saveVector(svgString: string, options?: SaveOptions): void;
|
|
60
60
|
declare function copyVector(svgString: string): Promise<void>;
|
|
61
61
|
declare function copyRaster(canvas: HTMLCanvasElement): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -217,8 +217,8 @@ async function copyRasterFromVector(svgString, width, height) {
|
|
|
217
217
|
const canvas = await svgToCanvas(svgString, width, height);
|
|
218
218
|
return copyRaster(canvas);
|
|
219
219
|
}
|
|
220
|
-
async function shareFromVector(svgString, width, height, options) {
|
|
221
|
-
const canvas = await svgToCanvas(svgString, width, height);
|
|
220
|
+
async function shareFromVector(svgString, width, height, options, background) {
|
|
221
|
+
const canvas = await svgToCanvas(svgString, width, height, resolveBackground(background, "png"));
|
|
222
222
|
return share(canvas, options);
|
|
223
223
|
}
|
|
224
224
|
function saveVector(svgString, options) {
|