mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 19:09:18 +08:00
definitions for https://github.com/domenic/svg2png
This commit is contained in:
43
svg2png/svg2png-test.ts
Normal file
43
svg2png/svg2png-test.ts
Normal 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
12
svg2png/svg2png.d.ts
vendored
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user