diff --git a/.idea/dictionaries/develar.xml b/.idea/dictionaries/develar.xml index 81c5504169e..3d240d16e2d 100644 --- a/.idea/dictionaries/develar.xml +++ b/.idea/dictionaries/develar.xml @@ -34,6 +34,7 @@ rimraf testapp tsconfig + userprofile veyor winstaller diff --git a/.travis.yml b/.travis.yml old mode 100644 new mode 100755 index 2a367cb1493..c54f52a98cd --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ addons: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gnu-tar dpkg libicns; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gnu-tar dpkg libicns homebrew/science/vips; fi - gem install --no-rdoc --no-ri fpm install: diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 687cd4032d7..0c3ddf77500 --- a/README.md +++ b/README.md @@ -35,22 +35,23 @@ Why the two package.json structure is ideal and how it solves a lot of issues # Configuration ## In short - 1. Ensure that required fields are specified in the application `package.json`: +1. Ensure that required fields are specified in the application `package.json`: - Standard `name`, `description`, `version` and `author`. + Standard `name`, `description`, `version` and `author`. - Custom `build` field must be specified: - ```json - "build": { - "app-bundle-id": "your.id", - "app-category-type": "your.app.category.type", - "iconUrl": "(windows only) A URL to an ICO file to use as the application icon, see details below" - } - ``` - This object will be used as a source of [electron-packager](https://www.npmjs.com/package/electron-packager#packageropts-callback) options. You can specify any other options here. + Custom `build` field must be specified: + ```json + "build": { + "app-bundle-id": "your.id", + "app-category-type": "your.app.category.type", + "iconUrl": "(windows only) A URL to an ICO file to use as the application icon, see details below" + } + ``` + This object will be used as a source of [electron-packager](https://www.npmjs.com/package/electron-packager#packageropts-callback) options. You can specify any other options here. 2. Create directory `build` in the root of the project and put your `background.png` (OS X DMG background), `icon.icns` (OS X app icon) and `icon.ico` (Windows app icon). - Linux icon set will be generated automatically on the fly from the OS X `icns` file. + + Linux icon set will be generated automatically on the fly from the OS X `icns` file (or you can put them into the `build/icons` directory — filename must contains size (e.g. `32x32.png`)). 3. Add [scripts](https://docs.npmjs.com/cli/run-script) to the development `package.json`: ```json @@ -64,11 +65,6 @@ Why the two package.json structure is ideal and how it solves a lot of issues 4. Install [required system packages](./docs/multi-platform-build.md). -## iconUrl -Please note — [local icon file url is not accepted](https://github.com/atom/grunt-electron-installer/issues/73), must be https/http. -* If you don't plan to build windows installer, you can omit it. -* If your project repository is public on GitHub, it will be `https://raw.githubusercontent.com/${info.user}/${info.project}/master/build/icon.ico` by default. - ## Distributable Format Configuration In the development `package.json` custom `build` field can be specified to customize distributable format: ```json @@ -100,7 +96,12 @@ In the development `package.json` custom `build` field can be specified to custo As you can see, you need to customize OS X options only if you want to provide custom `x, y`. Don't customize paths to background and icon, — just follow conventions (if you don't want to use `build` as directory of resources — please create issue to ask ability to customize it). -See [OS X options](https://www.npmjs.com/package/appdmg#json-specification) and [Windows options](https://github.com/electronjs/windows-installer#usage). +See [OS X options](https://www.npmjs.com/package/appdmg#json-specification) and [Windows options](https://github.com/electronjs/windows-installer#usage). Here documented only `electron-builder` specific options: + +| Name | Description +| --- | --- +| iconUrl
|

*windows-only.* A URL to an ICO file to use as the application icon (displayed in Control Panel > Programs and Features). Defaults to the Atom icon.

Please note — [local icon file url is not accepted](https://github.com/atom/grunt-electron-installer/issues/73), must be https/http.

+| extraResources |

A [glob expression](https://www.npmjs.com/package/glob#glob-primer), when specified, copy the file or directory with matching names directly into the app's directory (`Contents/Resources` for OS X).

You can use `${os}` (expanded to osx, linux, win according to current platform) and `${arch}` in the pattern.

If directory matched, all contents are copied. So, you can just specify `foo` to copy `/foo` directory.

May be specified in the platform options (i.e. in the `build.osx`). # Auto Update `electron-builder` produces all required artifacts: diff --git a/appveyor.yml b/appveyor.yml index 2276c19ccb3..4d3a2c09f33 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,7 @@ cache: - '%USERPROFILE%\.electron' init: - - git config --global core.autocrlf input + - git config --global core.autocrlf false install: - choco install nsis -y diff --git a/docs/multi-platform-build.md b/docs/multi-platform-build.md old mode 100644 new mode 100755 index df88b22c8a8..0b97ae12e79 --- a/docs/multi-platform-build.md +++ b/docs/multi-platform-build.md @@ -24,14 +24,14 @@ brew install Caskroom/cask/xquartz wine mono To build app in distributable format for Linux on OS X: ``` -brew install ruby gnu-tar libicns imagemagick graphicsmagick +brew install ruby gnu-tar libicns homebrew/science/vips gem install fpm ``` ## Linux To build app in distributable format for Linux: ``` -sudo apt-get install icnsutils graphicsmagick +sudo apt-get install icnsutils ``` ## Windows diff --git a/package.json b/package.json old mode 100644 new mode 100755 index 6db8cf74a94..b9f258f36a8 --- a/package.json +++ b/package.json @@ -53,11 +53,10 @@ "bluebird": "^3.3.4", "command-line-args": "^2.1.6", "electron-packager-tf": "^5.2.3", - "electron-winstaller-fixed": "^2.0.5-beta.7", - "fs-extra": "^0.26.5", + "electron-winstaller-fixed": "^2.0.6-beta.1", + "fs-extra": "^0.26.6", "fs-extra-p": "^0.1.0", "globby": "^4.0.0", - "gm": "^1.21.1", "hosted-git-info": "^2.1.4", "lodash.template": "^4.2.2", "meow": "^3.7.0", @@ -69,7 +68,8 @@ "tmp": "0.0.28" }, "optionalDependencies": { - "appdmg": "^0.3.6" + "appdmg": "^0.3.6", + "sharp": "^0.13.1" }, "devDependencies": { "ava-tf": "^0.12.4-beta.6", diff --git a/src/linuxPackager.ts b/src/linuxPackager.ts old mode 100644 new mode 100755 index c2e4c004555..a12fb8efea6 --- a/src/linuxPackager.ts +++ b/src/linuxPackager.ts @@ -4,8 +4,8 @@ import { PlatformPackager, BuildInfo } from "./platformPackager" import { Platform } from "./metadata" import { dir as _tpmDir, TmpOptions } from "tmp" import { exec, log } from "./util" -import { State as Gm } from "gm" -import { outputFile, readFile, stat } from "fs-extra-p" +import { outputFile, readFile, readdir } from "fs-extra-p" +import Sharp = require("sharp") const template = require("lodash.template") //noinspection JSUnusedLocalSymbols @@ -67,45 +67,77 @@ Icon=${this.metadata.name} return [`${tempFile}=/usr/share/applications/${this.appName}.desktop`] } + // must be name without spaces and other special characters, but not product name used private async computeDesktopIconPath(tempDir: string): Promise> { - const outputs = await exec("icns2png", ["-x", "-o", tempDir, path.join(this.buildResourcesDir, "icon.icns")]) - log(outputs[0].toString()) - if (!outputs[0].toString().includes("ih32")) { - log("48x48 is not found in the icns, 128x128 or 256x256 will be resized") - - const gm = require("gm") - - // icns doesn't contain required 48x48, use gm to resize - function resize(imagePath: string, size: number): BluebirdPromise { - return new BluebirdPromise((resolve, reject) => { - (gm(imagePath)) - .resize(size, size) - .write(path.join(tempDir, `icon_${size}x${size}x32.png`), error => error == null ? resolve() : reject(error)) - }) + try { + const mappings: Array = [] + const pngIconsDir = path.join(this.buildResourcesDir, "icons") + for (let file of (await readdir(pngIconsDir))) { + if (file.endsWith(".png") || file.endsWith(".PNG")) { + // If parseInt encounters a character that is not a numeral in the specified radix, + // it returns the integer value parsed up to that point + try { + const size = parseInt(file, 10) + if (size > 0) { + mappings.push(`${pngIconsDir}/${file}=/usr/share/icons/hicolor/${size}x${size}/apps/${this.metadata.name}.png`) + } + } + catch (e) { + console.error(e) + } + } } - let imagePath = path.join(tempDir, "icon_128x128x32.png") - try { - await stat(imagePath) - } - catch (e) { - imagePath = path.join(tempDir, "icon_256x256x32.png") - // 128 should be in any case - await resize(imagePath, 128) - } - await resize(imagePath, 48) + return mappings } + catch (e) { + return this.createFromIcns(tempDir) + } + } + + private async createFromIcns(tempDir: string): Promise> { + const outputs = await exec("icns2png", ["-x", "-o", tempDir, path.join(this.buildResourcesDir, "icon.icns")]) + const output = outputs[0].toString() + log(output) + + const sharp: Sharp = require("sharp") + + const imagePath = path.join(tempDir, "icon_256x256x32.png") + + function resize(size: number): BluebirdPromise { + return new BluebirdPromise((resolve, reject) => { + sharp(imagePath) + .resize(size, size) + .toFile(path.join(tempDir, `icon_${size}x${size}x32.png`), error => error == null ? resolve() : reject(error)) + }) + } + + const promises: Array> = [resize(24), resize(96)] + if (!output.includes("ih32")) { + promises.push(resize(48)) + } + if (!output.toString().includes("icp6")) { + promises.push(resize(64)) + } + if (!output.includes("it32")) { + promises.push(resize(128)) + } + + await BluebirdPromise.all(promises) - const name = this.metadata.name + const appName = this.metadata.name function createMapping(size: string) { - return `${tempDir}/icon_${size}x${size}x32.png=/usr/share/icons/hicolor/${size}x${size}/apps/${name}.png` + return `${tempDir}/icon_${size}x${size}x32.png=/usr/share/icons/hicolor/${size}x${size}/apps/${appName}.png` } return [ createMapping("16"), + createMapping("24"), createMapping("32"), createMapping("48"), + createMapping("64"), + createMapping("96"), createMapping("128"), createMapping("256"), createMapping("512"), diff --git a/src/metadata.ts b/src/metadata.ts old mode 100644 new mode 100755 index 46d81c1dfa0..fa7f3e0a630 --- a/src/metadata.ts +++ b/src/metadata.ts @@ -1,7 +1,9 @@ export interface AppMetadata extends Metadata { readonly version: string - /** The application name */ + /** + * The application name + **/ readonly name: string /** diff --git a/test/README.md b/test/README.md old mode 100644 new mode 100755 index 0aa2c73add3..6f8cee3db5c --- a/test/README.md +++ b/test/README.md @@ -8,7 +8,7 @@ brew install Caskroom/cask/xquartz wine mono Do not use OS X bundled Ruby. Install using `brew`. ``` -brew install ruby gnu-tar dpkg libicns +brew install ruby gnu-tar dpkg libicns homebrew/science/vips gem install fpm ``` diff --git a/test/fixtures/no-author-email/package.json b/test/fixtures/no-author-email/package.json old mode 100644 new mode 100755 index 2b0a385713c..176ec1495b1 --- a/test/fixtures/no-author-email/package.json +++ b/test/fixtures/no-author-email/package.json @@ -5,7 +5,7 @@ "description": "Test Application", "author": "Foo Bar", "devDependencies": { - "electron-prebuilt": "^0.37.1" + "electron-prebuilt": "^0.37.2" }, "build": { "app-bundle-id": "your.id", diff --git a/test/fixtures/test-app-one/build/background.png b/test/fixtures/test-app-one/build/background.png index 28d36132eb6..29817752129 100644 Binary files a/test/fixtures/test-app-one/build/background.png and b/test/fixtures/test-app-one/build/background.png differ diff --git a/test/fixtures/test-app-one/package.json b/test/fixtures/test-app-one/package.json old mode 100644 new mode 100755 index b9738928a59..4af77ac3218 --- a/test/fixtures/test-app-one/package.json +++ b/test/fixtures/test-app-one/package.json @@ -8,7 +8,7 @@ }, "author": "Foo Bar ", "devDependencies": { - "electron-prebuilt": "^0.37.1" + "electron-prebuilt": "^0.37.2" }, "build": { "app-bundle-id": "your.id", diff --git a/test/fixtures/test-app/build/background.png b/test/fixtures/test-app/build/background.png index 28d36132eb6..29817752129 100644 Binary files a/test/fixtures/test-app/build/background.png and b/test/fixtures/test-app/build/background.png differ diff --git a/test/fixtures/test-app/package.json b/test/fixtures/test-app/package.json old mode 100644 new mode 100755 index b833a8c70d7..d0adef52161 --- a/test/fixtures/test-app/package.json +++ b/test/fixtures/test-app/package.json @@ -4,6 +4,6 @@ "start": "electron ." }, "devDependencies": { - "electron-prebuilt": "^0.37.1" + "electron-prebuilt": "^0.37.2" } } diff --git a/test/src/BuildTest.ts b/test/src/BuildTest.ts old mode 100644 new mode 100755 index f3dbe366795..90d97e72433 --- a/test/src/BuildTest.ts +++ b/test/src/BuildTest.ts @@ -23,7 +23,7 @@ test.ifOsx("mac: one-package.json", async () => { }) test("custom app dir", async () => { - await assertPack("test-app-one", allPlatformsAndCurrentArch(), true, (projectDir) => { + await assertPack("test-app-one", allPlatformsAndCurrentArch(), (projectDir) => { return BluebirdPromise.all([ modifyPackageJson(projectDir, data => { data.directories = { @@ -36,7 +36,7 @@ test("custom app dir", async () => { }) test("productName with space", async () => { - await assertPack("test-app-one", allPlatformsAndCurrentArch(), true, (projectDir) => { + await assertPack("test-app-one", allPlatformsAndCurrentArch(), (projectDir) => { return modifyPackageJson(projectDir, data => { data.productName = "Test App" }) @@ -51,7 +51,7 @@ test("copy extra resource", async () => { platform: [platform], arch: process.arch, dist: false - }, true, (projectDir) => { + }, (projectDir) => { return BluebirdPromise.all([ modifyPackageJson(projectDir, data => { if (data.build == null) { diff --git a/test/src/helpers/expectedContents.ts b/test/src/helpers/expectedContents.ts old mode 100644 new mode 100755 index bf6067e6415..45f613f3781 --- a/test/src/helpers/expectedContents.ts +++ b/test/src/helpers/expectedContents.ts @@ -26,14 +26,19 @@ export const expectedLinuxContents = [ "/usr/share/icons/hicolor/", "/usr/share/icons/hicolor/128x128/", "/usr/share/icons/hicolor/16x16/", + "/usr/share/icons/hicolor/24x24/", "/usr/share/icons/hicolor/256x256/", "/usr/share/icons/hicolor/32x32/", "/usr/share/icons/hicolor/48x48/", "/usr/share/icons/hicolor/512x512/", + "/usr/share/icons/hicolor/64x64/", + "/usr/share/icons/hicolor/96x96/", "/usr/share/icons/hicolor/128x128/apps/", "/usr/share/icons/hicolor/128x128/apps/TestApp.png", "/usr/share/icons/hicolor/16x16/apps/", "/usr/share/icons/hicolor/16x16/apps/TestApp.png", + "/usr/share/icons/hicolor/24x24/apps/", + "/usr/share/icons/hicolor/24x24/apps/TestApp.png", "/usr/share/icons/hicolor/256x256/apps/", "/usr/share/icons/hicolor/256x256/apps/TestApp.png", "/usr/share/icons/hicolor/32x32/apps/", @@ -41,5 +46,9 @@ export const expectedLinuxContents = [ "/usr/share/icons/hicolor/48x48/apps/", "/usr/share/icons/hicolor/48x48/apps/TestApp.png", "/usr/share/icons/hicolor/512x512/apps/", - "/usr/share/icons/hicolor/512x512/apps/TestApp.png" + "/usr/share/icons/hicolor/512x512/apps/TestApp.png", + "/usr/share/icons/hicolor/64x64/apps/", + "/usr/share/icons/hicolor/64x64/apps/TestApp.png", + "/usr/share/icons/hicolor/96x96/apps/", + "/usr/share/icons/hicolor/96x96/apps/TestApp.png" ] \ No newline at end of file diff --git a/test/src/helpers/packTester.ts b/test/src/helpers/packTester.ts old mode 100644 new mode 100755 index e53d5197f8a..cdc3eb06470 --- a/test/src/helpers/packTester.ts +++ b/test/src/helpers/packTester.ts @@ -19,9 +19,10 @@ let tmpDirCounter = 0 export async function assertPack(fixtureName: string, packagerOptions: PackagerOptions, - useTempDir?: boolean, tempDirCreated?: (projectDir: string) => Promise, packed?: (projectDir: string) => Promise) { + const useTempDir = tempDirCreated != null || (packagerOptions != null && packagerOptions.target != null) + let projectDir = path.join(__dirname, "..", "..", "fixtures", fixtureName) // const isDoNotUseTempDir = platform === "darwin" const customTmpDir = process.env.TEST_APP_TMP_DIR @@ -110,16 +111,14 @@ async function packAndCheck(projectDir: string, packagerOptions: PackagerOptions return it.replace(new RegExp("/opt/TestApp/", "g"), `/opt/${productName}/`) } }) - // let normalizedAppName = getProductName(packager.metadata).toLowerCase().replace(/ /g, '-') - // expectedContents[expectedContents.indexOf("/usr/share/doc/testapp/")] = "/usr/share/doc/" + normalizedAppName + "/" - // expectedContents[expectedContents.indexOf("/usr/share/doc/testapp/changelog.Debian.gz")] = "/usr/share/doc/" + normalizedAppName + "/changelog.Debian.gz" + + // console.log(JSON.stringify(await getContents(projectDir + "/dist/TestApp-1.0.0-amd64.deb", productName), null, 2)) + // console.log(JSON.stringify(await getContents(projectDir + "/dist/TestApp-1.0.0-i386.deb", productName), null, 2)) assertThat(await getContents(projectDir + "/dist/TestApp-1.0.0-amd64.deb", productName)).deepEqual(expectedContents) if (packagerOptions == null || packagerOptions.arch === null || packagerOptions.arch === "ia32") { assertThat(await getContents(projectDir + "/dist/TestApp-1.0.0-i386.deb", productName)).deepEqual(expectedContents) } - // console.log(JSON.stringify(await getContents(projectDir + "/dist/TestApp-1.0.0-amd64.deb"), null, 2)) - // console.log(JSON.stringify(await getContents(projectDir + "/dist/TestApp-1.0.0-i386.deb"), null, 2)) } else if (expandedPlatforms.includes("win32") && (packagerOptions == null || packagerOptions.target == null)) { await checkWindowsResult(packagerOptions, artifacts.get(Platform.WINDOWS)) diff --git a/test/src/helpers/runTests.ts b/test/src/helpers/runTests.ts old mode 100644 new mode 100755 index 42cbf837dbd..78ac84d3612 --- a/test/src/helpers/runTests.ts +++ b/test/src/helpers/runTests.ts @@ -14,7 +14,7 @@ const rootDir = path.join(__dirname, "..", "..", "..") const testPackageDir = path.join(require("os").tmpdir(), "electron_builder_published") const testNodeModules = path.join(testPackageDir, "node_modules") -const electronVersion = "0.37.1" +const electronVersion = "0.37.2" BluebirdPromise.all([ deleteOldElectronVersion(), diff --git a/test/src/linuxPackagerTest.ts b/test/src/linuxPackagerTest.ts old mode 100644 new mode 100755 index 18113986eea..6145a93d0a1 --- a/test/src/linuxPackagerTest.ts +++ b/test/src/linuxPackagerTest.ts @@ -1,5 +1,7 @@ import test from "./helpers/avaEx" import { assertPack, platform } from "./helpers/packTester" +import { remove } from "fs-extra-p" +import * as path from "path" //noinspection JSUnusedLocalSymbols const __awaiter = require("out/awaiter") @@ -8,6 +10,13 @@ test.ifNotWindows("linux", async () => { await assertPack("test-app-one", platform("linux")) }) +test.ifNotWindows("linux - icons from ICNS", async () => { + await assertPack("test-app-one", { + platform: ["linux"], + arch: process.arch, + }, (projectDir) => remove(path.join(projectDir, "build", "icons"))) +}) + test.ifNotWindows("no-author-email", async (t) => { t.throws(assertPack("no-author-email", platform("linux")), /Please specify author 'email' in .*/) }) diff --git a/test/src/winPackagerTest.ts b/test/src/winPackagerTest.ts old mode 100644 new mode 100755 index efa721562c0..9568b523784 --- a/test/src/winPackagerTest.ts +++ b/test/src/winPackagerTest.ts @@ -14,5 +14,5 @@ test.ifNotCi.serial("win: nsis", async () => { platform: ["win32"], target: ["nsis"], arch: process.arch - }, true) + }) }) \ No newline at end of file diff --git a/test/tsconfig.json b/test/tsconfig.json old mode 100644 new mode 100755 index 2f2e7cf7bc6..4123345a78c --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -33,7 +33,6 @@ "../typings/gh-api.d.ts", "../typings/globby.d.ts", "../typings/hosted-git-info.d.ts", - "../typings/main/ambient/gm/gm.d.ts", "../typings/main/ambient/mime/mime.d.ts", "../typings/main/ambient/progress/progress.d.ts", "../typings/main/ambient/tmp/tmp.d.ts", @@ -41,6 +40,7 @@ "../typings/node.d.ts", "../typings/progress-stream.d.ts", "../typings/read-package-json.d.ts", + "../typings/sharp.d.ts", "typings/ava.d.ts", "typings/json-parse-helpfulerror.d.ts", "typings/path-sort.d.ts", diff --git a/tsconfig.json b/tsconfig.json old mode 100644 new mode 100755 index e0902ff03c3..5982233bba0 --- a/tsconfig.json +++ b/tsconfig.json @@ -35,7 +35,6 @@ "typings/gh-api.d.ts", "typings/globby.d.ts", "typings/hosted-git-info.d.ts", - "typings/main/ambient/gm/gm.d.ts", "typings/main/ambient/mime/mime.d.ts", "typings/main/ambient/progress/progress.d.ts", "typings/main/ambient/tmp/tmp.d.ts", @@ -43,6 +42,7 @@ "typings/node.d.ts", "typings/progress-stream.d.ts", "typings/read-package-json.d.ts", + "typings/sharp.d.ts", "node_modules/typescript/lib/lib.es7.d.ts", "node_modules/fs-extra-p/index.d.ts", "node_modules/fs-extra-p/bluebird.d.ts", diff --git a/typings.json b/typings.json old mode 100644 new mode 100755 index 01bbaff4cb0..15bc2a0c3f9 --- a/typings.json +++ b/typings.json @@ -1,10 +1,7 @@ { "ambientDependencies": { - "fs-extra": "github:DefinitelyTyped/DefinitelyTyped/fs-extra/fs-extra.d.ts#72d95b38f008fed506c6cbf3af8a693bd7c3363a", - "gm": "github:DefinitelyTyped/DefinitelyTyped/gm/gm.d.ts#71545cc025fee8da192cbe6db6e6d2b24aca814f", "mime": "github:DefinitelyTyped/DefinitelyTyped/mime/mime.d.ts#cb5206a8ac1c9a3ddfd126f5ecea6729b2361452", "progress": "github:DefinitelyTyped/DefinitelyTyped/progress/progress.d.ts#d54b18e0ac3277376700b6026ef9e9e3f380df50", - "should": "github:DefinitelyTyped/DefinitelyTyped/should/should.d.ts#5aa6dff6990465c7fb41504538ad7aa133ab01d3", "tmp": "github:DefinitelyTyped/DefinitelyTyped/tmp/tmp.d.ts#48f20e97bfaf70fc1a9537b38aed98e9749be0ae" }, "dependencies": { diff --git a/typings/main/ambient/gm/gm.d.ts b/typings/main/ambient/gm/gm.d.ts deleted file mode 100644 index 7001413848d..00000000000 --- a/typings/main/ambient/gm/gm.d.ts +++ /dev/null @@ -1,625 +0,0 @@ -// Compiled using typings@0.6.8 -// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/71545cc025fee8da192cbe6db6e6d2b24aca814f/gm/gm.d.ts -// Type definitions for gm 1.17.0 -// Project: https://github.com/aheckmann/gm -// Definitions by: Joel Spadin -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -declare module "gm" { - import stream = require('stream'); - - function m(image: string): m.State; - - module m { - export interface ClassOptions { - imageMagick?: boolean; - nativeAutoOrient?: boolean; - } - - export interface CompareCallback { - (err: Error, isEqual: boolean, equality: number, raw: number): any; - } - - export interface GetterCallback { - (err: Error, value: T): any; - } - - export interface WriteCallback { - (err: Error, stdout: string, stderr: string, cmd: string): any; - } - - export interface ChannelInfo { - Red: T; - Green: T; - Blue: T; - } - - export interface CompareOptions { - file?: string; - highlightColor?: string; - highlightStyle?: string; - tolerance?: number; - } - - export interface ColorStatistics { - Minimum: string; - Maximum: string; - Mean: string; - 'Standard Deviation': string; - } - - export interface Dimensions { - width: number; - height: number; - } - - export interface ImageInfo { - 'Background Color': string; - 'Border Color': string; - 'Channel Depths': ChannelInfo; - 'Channel Statistics': ChannelInfo; - Class: string; - color: number; - Compose: string; - Compression: string; - depth: number; - Depth: string; - Dispose: string; - Filesize: string; - format: string; - Format: string; - Geometry: string; - Interlace: string; - Iterations: string; - 'JPEG-Quality'?: string; - 'JPEG-Colorspace'?: string; - 'JPEG-Colorspace-Name'?: string; - 'JPEG-Sampling-factors'?: string; - 'Matte Color': string; - Orientation: string; - 'Page geometry': string; - path: string; - - 'Profile-color'?: string; - 'Profile-iptc'?: { - [key: string]: string; - }; - 'Profile-EXIF'?: { - [key: string]: string; - }; - 'Profile-XMP'?: string; - Resolution?: string; - size: Dimensions; - Signature: string; - Software: string; - Tainted: string; - Type: string; - } - - export interface State { - // Image Operations - adjoin(): State; - affine(matrix: string): State; - antialias(enable: boolean): State; - append(image: string, ltr?: boolean): State; - authenticate(password: string): State; - autoOrient(): State; - backdrop(): State; - bitdepth(bits: number): State; - blackThreshold(intensity: number): State; - blackThreshold(red: number, green: number, blue: number, opacity?: number): State; - bluePrimary(x: number, y: number): State; - blur(radius: number, sigma?: number): State; - border(width: number, height: number): State; - borderColor(color: string): State; - box(color: string): State; - channel(type: 'Red'): State; - channel(type: 'Green'): State; - channel(type: 'Blue'): State; - channel(type: 'Opacity'): State; - channel(type: 'Matte'): State; - channel(type: 'Cyan'): State; - channel(type: 'Magenta'): State; - channel(type: 'Yellow'): State; - channel(type: 'Black'): State; - channel(type: 'Gray'): State; - channel(type: string): State; - charcoal(factor: number): State; - chop(width: number, height: number, x?: number, y?: number): State; - clip(): State; - coalesce(): State; - colorize(red: number, green: number, blue: number): State; - colorMap(type: 'shared'): State; - colorMap(type: 'private'): State; - colorMap(type: string): State; - colors(colors: number): State; - colorspace(space: 'CineonLog'): State; - colorspace(space: 'CMYK'): State; - colorspace(space: 'GRAY'): State; - colorspace(space: 'HSL'): State; - colorspace(space: 'HSB'): State; - colorspace(space: 'OHTA'): State; - colorspace(space: 'RGB'): State; - colorspace(space: 'Rec601Luma'): State; - colorspace(space: 'Rec709Luma'): State; - colorspace(space: 'Rec601YCbCr'): State; - colorspace(space: 'Rec709YCbCr'): State; - colorspace(space: 'Transparent'): State; - colorspace(space: 'XYZ'): State; - colorspace(space: 'YCbCr'): State; - colorspace(space: 'YIQ'): State; - colorspace(space: 'YPbPr'): State; - colorspace(space: 'YUV'): State; - colorspace(space: string): State; - compose(operator: 'Over'): State; - compose(operator: 'In'): State; - compose(operator: 'Out'): State; - compose(operator: 'Atop'): State; - compose(operator: 'Xor'): State; - compose(operator: 'Plus'): State; - compose(operator: 'Minus'): State; - compose(operator: 'Add'): State; - compose(operator: 'Subtract'): State; - compose(operator: 'Difference'): State; - compose(operator: 'Divide'): State; - compose(operator: 'Multiply'): State; - compose(operator: 'Bumpmap'): State; - compose(operator: 'Copy'): State; - compose(operator: 'CopyRed'): State; - compose(operator: 'CopyGreen'): State; - compose(operator: 'CopyBlue'): State; - compose(operator: 'CopyOpacity'): State; - compose(operator: 'CopyCyan'): State; - compose(operator: 'CopyMagenta'): State; - compose(operator: 'CopyYellow'): State; - compose(operator: 'CopyBlack'): State; - compose(operator: string): State; - compress(type: 'None'): State; - compress(type: 'BZip'): State; - compress(type: 'Fax'): State; - compress(type: 'Group4'): State; - compress(type: 'JPEG'): State; - compress(type: 'Lossless'): State; - compress(type: 'LZW'): State; - compress(type: 'RLE'): State; - compress(type: 'Zip'): State; - compress(type: 'LZMA'): State; - compress(type: string): State; - contrast(multiplier: number): State; - convolve(kernel: string): State; - createDirectories(): State; - crop(width: number, height: number, x?: number, y?: number, percent?: boolean): State; - cycle(amount: number): State; - deconstruct(): State; - define(): State; - delay(milliseconds: number): State; - density(width: number, height: number): State; - despeckle(): State; - displace(horizontal: number, vertical: number): State; - display(xServer: string): State; - dispose(method: 'Undefined'): State; - dispose(method: 'None'): State; - dispose(method: 'Background'): State; - dispose(method: 'Previous'): State; - dispose(method: string): State; - dissolve(percent: number): State; - dither(enable?: boolean): State; - edge(radius?: number): State; - emboss(radius?: number): State; - encoding(encoding: 'AdobeCustom'): State; - encoding(encoding: 'AdobeExpert'): State; - encoding(encoding: 'AdobeStandard'): State; - encoding(encoding: 'AppleRoman'): State; - encoding(encoding: 'BIG5'): State; - encoding(encoding: 'GB2312'): State; - encoding(encoding: 'Latin 2'): State; - encoding(encoding: 'None'): State; - encoding(encoding: 'SJIScode'): State; - encoding(encoding: 'Symbol'): State; - encoding(encoding: 'Unicode'): State; - encoding(encoding: 'Wansung'): State; - encoding(encoding: string): State; - endian(type: 'MSB'): State; - endian(type: 'LSB'): State; - endian(type: 'Native'): State; - endian(type: string): State; - enhance(): State; - equalize(): State; - extent(width: number, height: number, options?: string): State; - file(filename: string): State; - filter(type: 'Point'): State; - filter(type: 'Box'): State; - filter(type: 'Triangle'): State; - filter(type: 'Hermite'): State; - filter(type: 'Hanning'): State; - filter(type: 'Hamming'): State; - filter(type: 'Blackman'): State; - filter(type: 'Gaussian'): State; - filter(type: 'Quadratic'): State; - filter(type: 'Cubic'): State; - filter(type: 'Catrom'): State; - filter(type: 'Mitchell'): State; - filter(type: 'Lanczos'): State; - filter(type: 'Bessel'): State; - filter(type: 'Sinc'): State; - filter(type: string): State; - flatten(): State; - flip(): State; - flop(): State; - foreground(color: string): State; - frame(width: number, height: number, outerBevelWidth: number, outBevelHeight: number): State; - fuzz(distance: number, percent?: boolean): State; - gamma(r: number, g: number, b: number): State; - gaussian(radius: number, sigma?: number): State; - /** Width and height are specified in percents */ - geometry(width: number, height: number, option: '%'): State; - /** Specify maximum area in pixels */ - geometry(width: number, height: number, option: '@'): State; - /** Ignore aspect ratio */ - geometry(width: number, height: number, option: '!'): State; - /** Width and height are minimum values */ - geometry(width: number, height: number, option: '^'): State; - /** Change dimensions only if image is smaller than width or height */ - geometry(width: number, height: number, option: '<'): State; - /** Change dimensions only if image is larger than width or height */ - geometry(width: number, height: number, option: '>'): State; - geometry(width: number, height?: number, option?: string): State; - geometry(geometry: string): State; - greenPrimary(x: number, y: number): State; - gravity(direction: 'NorthWest'): State; - gravity(direction: 'North'): State; - gravity(direction: 'NorthEast'): State; - gravity(direction: 'West'): State; - gravity(direction: 'Center'): State; - gravity(direction: 'East'): State; - gravity(direction: 'SouthWest'): State; - gravity(direction: 'South'): State; - gravity(direction: 'SouthEast'): State; - gravity(direction: string): State; - highlightColor(color: string): State; - highlightStyle(style: 'Assign'): State; - highlightStyle(style: 'Threshold'): State; - highlightStyle(style: 'Tint'): State; - highlightStyle(style: 'XOR'): State; - highlightStyle(style: string): State; - iconGeometry(geometry: string): State; - implode(factor?: number): State; - intent(type: 'Absolute'): State; - intent(type: 'Perceptual'): State; - intent(type: 'Relative'): State; - intent(type: 'Saturation'): State; - intent(type: string): State; - interlace(type: 'None'): State; - interlace(type: 'Line'): State; - interlace(type: 'Plane'): State; - interlace(type: 'Partition'): State; - interlace(type: string): State; - label(name: string): State; - lat(width: number, height: number, offset: number, percent?: boolean): State; - level(blackPoint: number, gamma: number, whitePoint: number, percent?: boolean): State; - limit(type: 'disk', val: string): State; - limit(type: 'file', val: string): State; - limit(type: 'map', val: string): State; - limit(type: 'memory', val: string): State; - limit(type: 'pixels', val: string): State; - limit(type: 'threads', val: string): State; - limit(type: string, val: string): State; - list(type: string): State; - list(type: 'Color'): State; - list(type: 'Delegate'): State; - list(type: 'Format'): State; - list(type: 'Magic'): State; - list(type: 'Module'): State; - list(type: 'Resource'): State; - list(type: 'Type'): State; - log(format: string): State; - loop(iterations: number): State; - lower(width: number, height: number): State; - magnify(factor: number): State; - map(filename: string): State; - mask(filename: string): State; - matte(): State; - matteColor(color: string): State; - maximumError(limit: number): State; - median(radius?: number): State; - minify(factor: number): State; - mode(mode: 'frame'): State; - mode(mode: 'unframe'): State; - mode(mode: 'concatenate'): State; - mode(mode: string): State; - modulate(b: number, s: number, h: number): State; - monitor(): State; - monochrome(): State; - morph(otherImg: string, outName: string, callback?: WriteCallback): State; - morph(otherImg: string[], outName: string, callback?: WriteCallback): State; - mosaic(): State; - motionBlur(radius: number, sigma?: number, angle?: number): State; - name(): State; - negative(): State; - noise(type: 'uniform'): State; - noise(type: 'gaussian'): State; - noise(type: 'multiplicative'): State; - noise(type: 'impulse'): State; - noise(type: 'laplacian'): State; - noise(type: 'poisson'): State; - noise(type: string): State; - noise(radius: number): State; - noop(): State; - normalize(): State; - opaque(color: string): State; - operator(channel: string, operator: 'Add', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'And', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Assign', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Depth', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Divide', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Gamma', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Negate', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'LShift', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Log', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Max', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Min', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Multiply', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Or', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Pow', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'RShift', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Subtract', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Threshold', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Threshold-White', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Threshold-White-Negate', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Threshold-Black', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Threshold-Black-Negate', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Xor', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Noise-Gaussian', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Noise-Impulse', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Noise-Laplacian', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Noise-Multiplicative', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Noise-Poisson', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Noise-Random', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: 'Noise-Uniform', rvalue: number, percent?: boolean): State; - operator(channel: string, operator: string, rvalue: number, percent?: boolean): State; - orderedDither(channelType: 'All', NxN: string): State; - orderedDither(channelType: 'Intensity', NxN: string): State; - orderedDither(channelType: 'Red', NxN: string): State; - orderedDither(channelType: 'Green', NxN: string): State; - orderedDither(channelType: 'Blue', NxN: string): State; - orderedDither(channelType: 'Cyan', NxN: string): State; - orderedDither(channelType: 'Magenta', NxN: string): State; - orderedDither(channelType: 'Yellow', NxN: string): State; - orderedDither(channelType: 'Black', NxN: string): State; - orderedDither(channelType: 'Opacity', NxN: string): State; - orderedDither(channelType: string, NxN: string): State; - outputDirectory(directory: string): State; - page(width: number, height: number, arg?: '%'): State; - page(width: number, height: number, arg?: '!'): State; - page(width: number, height: number, arg?: '<'): State; - page(width: number, height: number, arg?: '>'): State; - page(width: number, height: number, arg?: string): State; - pause(seconds: number): State; - pen(color: string): State; - ping(): State; - pointSize(size: number): State; - noProfile(): State; - preview(type: 'Rotate'): State; - preview(type: 'Shear'): State; - preview(type: 'Roll'): State; - preview(type: 'Hue'): State; - preview(type: 'Saturation'): State; - preview(type: 'Brightness'): State; - preview(type: 'Gamma'): State; - preview(type: 'Spiff'): State; - preview(type: 'Dull'): State; - preview(type: 'Grayscale'): State; - preview(type: 'Quantize'): State; - preview(type: 'Despeckle'): State; - preview(type: 'ReduceNoise'): State; - preview(type: 'AddNoise'): State; - preview(type: 'Sharpen'): State; - preview(type: 'Blur'): State; - preview(type: 'Threshold'): State; - preview(type: 'EdgeDetect'): State; - preview(type: 'Spread'): State; - preview(type: 'Shade'): State; - preview(type: 'Raise'): State; - preview(type: 'Segment'): State; - preview(type: 'Solarize'): State; - preview(type: 'Swirl'): State; - preview(type: 'Implode'): State; - preview(type: 'Wave'): State; - preview(type: 'OilPaint'): State; - preview(type: 'CharcoalDrawing'): State; - preview(type: 'JPEG'): State; - preview(type: string): State; - paint(radius: number): State; - process(command: string): State; - profile(filename: string): State; - progress(): State; - randomThreshold(channelType: 'All', LOWxHIGH: string): State; - randomThreshold(channelType: 'Intensity', LOWxHIGH: string): State; - randomThreshold(channelType: 'Red', LOWxHIGH: string): State; - randomThreshold(channelType: 'Green', LOWxHIGH: string): State; - randomThreshold(channelType: 'Blue', LOWxHIGH: string): State; - randomThreshold(channelType: 'Cyan', LOWxHIGH: string): State; - randomThreshold(channelType: 'Magenta', LOWxHIGH: string): State; - randomThreshold(channelType: 'Yellow', LOWxHIGH: string): State; - randomThreshold(channelType: 'Black', LOWxHIGH: string): State; - randomThreshold(channelType: 'Opacity', LOWxHIGH: string): State; - randomThreshold(channelType: string, LOWxHIGH: string): State; - quality(level: number): State; - raise(width: number, height: number): State; - recolor(matrix: string): State; - redPrimary(x: number, y: number): State; - region(width: number, height: number, x?: number, y?: number): State; - remote(): State; - render(): State; - repage(reset: '+'): State; - repage(reset: string): State; - repage(width: number, height: number, xoff: number, yoff: number, arg?: string): State; - sample(geometry: string): State; - samplingFactor(horizontalFactor: number, verticalFactor: number): State; - rawSize(width: number, height: number, offset?: number): State; - resample(horizontal: number, vertical: number): State; - /** Width and height are specified in percents */ - resize(width: number, height: number, option: '%'): State; - /** Specify maximum area in pixels */ - resize(width: number, height: number, option: '@'): State; - /** Ignore aspect ratio */ - resize(width: number, height: number, option: '!'): State; - /** Width and height are minimum values */ - resize(width: number, height: number, option: '^'): State; - /** Change dimensions only if image is smaller than width or height */ - resize(width: number, height: number, option: '<'): State; - /** Change dimensions only if image is larger than width or height */ - resize(width: number, height: number, option: '>'): State; - resize(width: number, height?: number, option?: string): State; - roll(horizontal: number, vertical: number): State; - rotate(backgroundColor: string, degrees: number): State; - scene(index: number): State; - scenes(start: number, end: number): State; - scale(width: number, height: number): State; - screen(): State; - segment(clustherThreshold: number, smoothingThreshold: number): State; - sepia(): State; - set(attribute: string, value: string): State; - setFormat(format: string): State; - shade(azimuth: number, elevation: number): State; - shadow(radius: number, sigma?: number): State; - sharedMemory(): State; - shave(width: number, height: number, percent?: boolean): State; - sharpen(radius: number, sigma?: number): State; - shear(xDegrees: number, yDegress: number): State; - silent(): State; - snaps(count: number): State; - solarize(threshold: number): State; - spread(amount: number): State; - stegano(offset: number): State; - stereo(): State; - strip(): State; - swirl(degrees: number): State; - textFont(font: string): State; - threshold(value: number, percent?: boolean): State; - thumb(width: number, height: number, outName: string, callback: WriteCallback): State; - thumb(width: number, height: number, outName: string, quality: number, callback: WriteCallback): State; - thumb(width: number, height: number, outName: string, quality: number, align: 'topleft', callback: WriteCallback): State; - thumb(width: number, height: number, outName: string, quality: number, align: 'center', callback: WriteCallback): State; - thumb(width: number, height: number, outName: string, quality: number, align: string, callback: WriteCallback): State; - tile(filename: string): State; - title(title: string): State; - transform(color: string): State; - transparent(color: string): State; - treeDepth(depth: number): State; - trim(): State; - type(type: 'Bilevel'): State; - type(type: 'Grayscale'): State; - type(type: 'Palette'): State; - type(type: 'PaletteMatte'): State; - type(type: 'TrueColor'): State; - type(type: 'TrueColorMatte'): State; - type(type: 'ColorSeparation'): State; - type(type: 'ColorSeparationMatte'): State; - type(type: 'Optimize'): State; - type(type: string): State; - update(seconds: number): State; - units(type: 'Undefined'): State; - units(type: 'PixelsPerInch'): State; - units(type: 'PixelsPerCentimeter'): State; - units(type: string): State; - unsharp(radius: number, sigma?: number, amount?: number, threshold?: number): State; - usePixmap(): State; - view(): State; - virtualPixel(method: 'Constant'): State; - virtualPixel(method: 'Edge'): State; - virtualPixel(method: 'Mirror'): State; - virtualPixel(method: 'Tile'): State; - virtualPixel(method: string): State; - visual(type: 'StaticGray'): State; - visual(type: 'GrayScale'): State; - visual(type: 'StaticColor'): State; - visual(type: 'PseudoColor'): State; - visual(type: 'TrueColor'): State; - visual(type: 'DirectColor'): State; - visual(type: 'default'): State; - visual(type: string): State; - watermark(brightness: number, saturation: number): State; - wave(amplitude: number, wavelength: number): State; - whitePoint(x: number, y: number): State; - whiteThreshold(intensity: number): State; - whiteThreshold(red: number, green: number, blue: number, opacity?: number): State; - window(id: string): State; - windowGroup(): State; - - // Getters - color(callback: GetterCallback): State; - depth(callback: GetterCallback): State; - filesize(callback: GetterCallback): State; - format(callback: GetterCallback): State; - identify(callback: GetterCallback): State; - res(callback: GetterCallback): State; - size(callback: GetterCallback): State; - orientation(callback: GetterCallback): State; - - // Drawing Operations - draw(args: string): State; - drawArc(x0: number, y0: number, x1: number, y1: number, r0: number, r1: number): State; - drawBezier(x0: number, y0: number, x1: number, y1: number): State; - drawBezier(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number): State; - drawBezier(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, ...coords: number[]): State; - drawCircle(x0: number, y0: number, x1: number, y1: number): State; - drawEllipse(x0: number, y0: number, rx: number, ry: number, a0: number, a1: number): State; - drawLine(x0: number, y0: number, x1: number, y1: number): State; - drawPoint(x: number, y: number): State; - drawPolygon(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number): State; - drawPolygon(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, ...coords: number[]): State; - drawPolyline(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number): State; - drawPolyline(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, ...coords: number[]): State; - drawRectangle(x0: number, y0: number, x1: number, y1: number): State; - drawRectangle(x0: number, y0: number, x1: number, y1: number, rc: number): State; - drawRectangle(x0: number, y0: number, x1: number, y1: number, wc: number, hc: number): State; - drawText(x: number, y: number, text: string, gravity: 'NorthWest'): State; - drawText(x: number, y: number, text: string, gravity: 'North'): State; - drawText(x: number, y: number, text: string, gravity: 'NorthEast'): State; - drawText(x: number, y: number, text: string, gravity: 'West'): State; - drawText(x: number, y: number, text: string, gravity: 'Center'): State; - drawText(x: number, y: number, text: string, gravity: 'East'): State; - drawText(x: number, y: number, text: string, gravity: 'SouthWest'): State; - drawText(x: number, y: number, text: string, gravity: 'South'): State; - drawText(x: number, y: number, text: string, gravity: 'SouthEast'): State; - drawText(x: number, y: number, text: string, gravity?: string): State; - fill(color: string): State; - font(name: string, size?: number): State; - fontSize(size: number): State; - stroke(color: string, width?: number): State; - strokeWidth(width: number): State; - setDraw(property: 'color', x: number, y: number, method: 'point'): State; - setDraw(property: 'color', x: number, y: number, method: 'replace'): State; - setDraw(property: 'color', x: number, y: number, method: 'floodfill'): State; - setDraw(property: 'color', x: number, y: number, method: 'filltoborder'): State; - setDraw(property: 'color', x: number, y: number, method: 'reset'): State; - setDraw(property: 'matte', x: number, y: number, method: 'point'): State; - setDraw(property: 'matte', x: number, y: number, method: 'replace'): State; - setDraw(property: 'matte', x: number, y: number, method: 'floodfill'): State; - setDraw(property: 'matte', x: number, y: number, method: 'filltoborder'): State; - setDraw(property: 'matte', x: number, y: number, method: 'reset'): State; - setDraw(property: string, x: number, y: number, method: string): State; - - // Commands - stream(callback?: WriteCallback): stream.PassThrough; - stream(format: string, callback?: WriteCallback): stream.PassThrough; - toBuffer(callback: (err: Error, buffer: Buffer) => any): stream.PassThrough; - toBuffer(format: string, callback: (err: Error, buffer: Buffer) => any): stream.PassThrough; - write(filename: string, callback: WriteCallback): void; - } - - export interface SubClass { - (image: string): State; - } - - export function compare(filename1: string, filename2: string, callback: CompareCallback): void; - export function compare(filename1: string, filename2: string, tolerance: number, callback: CompareCallback): void; - export function compare(filename1: string, filename2: string, options: CompareOptions, callback: CompareCallback): void; - - export function subClass(options: ClassOptions): SubClass; - } - - export = m; -} \ No newline at end of file