This commit is contained in:
hansrwindhoff
2015-01-24 08:22:08 -07:00
parent 43bb6a0ef4
commit d4fc0810bf
2 changed files with 55 additions and 0 deletions

43
svg2png/svg2png-test.ts Normal file
View File

@@ -0,0 +1,43 @@
/// <reference path="./svg2png.d.ts" />
"use strict";
import svg2png = require("svg2png");
svg2png("./1.svg", "./tiger.png", err => {
if (err) {
console.log("didnt work");
} else {
console.log("ok");
}
});
svg2png("./index.svg", "./dest.png", err => {
if (err) {
console.log("didnt work");
} else {
console.log("ok");
}
});
for (var i = 0.1; i < 4; i += 0.2) {
svg2png("./tiger.svg", "./tigerzoom" + i.toString() + ".png", i, err => {
if (err) {
console.log("didnt work");
} else {
console.log("ok");
}
});
svg2png("./index.svg", "./index" + i.toString() + ".png", i, err => {
if (err) {
console.log("didnt work");
} else {
console.log("ok");
}
});
}
console.log("done");

12
svg2png/svg2png.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
// Type definitions for svg2png node package
// Project: https://github.com/domenic/svg2png
// Definitions by: hans windhoff <https://github.com/hansrwindhoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare function svg2png(srcFile: string, destFile: string, scale: number, cb: (err:Error) => void):void;
declare function svg2png(srcFile: string, destFile: string, cb: (err:Error) => void):void;
declare module "svg2png" {
export = svg2png;
}