diff --git a/types/icon-gen/icon-gen-tests.ts b/types/icon-gen/icon-gen-tests.ts new file mode 100644 index 0000000000..ca02834c04 --- /dev/null +++ b/types/icon-gen/icon-gen-tests.ts @@ -0,0 +1,43 @@ +import icongen = require('icon-gen'); + +icongen('./sample.svg', './icons', { report: true }) + .then(results => { + results[0]; + }) + .catch(err => { + throw err; + }); + +icongen('./sample.svg', './icons') + .then(results => { + results[0]; + }) + .catch(err => { + throw err; + }); + +icongen('./sample.svg', './icons', { + favicon: { + ico: [16, 24, 32, 48, 64], + name: 'favicon-', + sizes: [32, 57, 72, 96, 120, 128, 144, 152, 195, 228], + }, + report: false, +}) + .then(results => { + results[0]; + }) + .catch(err => { + throw err; + }); + +icongen('./sample.svg', './icons', { + favicon: {}, + report: false, +}) + .then(results => { + results[0]; + }) + .catch(err => { + throw err; + }); diff --git a/types/icon-gen/index.d.ts b/types/icon-gen/index.d.ts new file mode 100644 index 0000000000..e7bd6aaa69 --- /dev/null +++ b/types/icon-gen/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for icon-gen 2.0 +// Project: https://github.com/akabekobeko/npm-icon-gen#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace icongen { + interface Options { + favicon?: { + ico: number[]; + name: string; + sizes: number[]; + } | {}; + icns?: { + name: string; + sizes: number[]; + } | {}; + ico?: { + name: string; + sizes: number[]; + } | {}; + report?: boolean; + } +} + +declare function icongen(src: string, dest: string, options?: icongen.Options): Promise; + +export = icongen; diff --git a/types/icon-gen/tsconfig.json b/types/icon-gen/tsconfig.json new file mode 100644 index 0000000000..6b83993922 --- /dev/null +++ b/types/icon-gen/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "icon-gen-tests.ts" + ] +} diff --git a/types/icon-gen/tslint.json b/types/icon-gen/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/icon-gen/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }