From d5f73604917cd89a2efcb1844b8f10875a706688 Mon Sep 17 00:00:00 2001 From: Vaclav Mlejnsky Date: Fri, 5 Oct 2018 20:09:52 +0200 Subject: [PATCH] Add missing `in()`, `out()` & `command()` method definitions for gm package (#29475) Definitions for [gm](https://github.com/aheckmann/gm) package are missing 3 methods - `command()`, `in()` and `out()`. Usage of these methods is described [here](https://github.com/aheckmann/gm#custom-arguments). Also, this should resolve #24795 --- types/gm/gm-tests.ts | 6 ++++++ types/gm/index.d.ts | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/types/gm/gm-tests.ts b/types/gm/gm-tests.ts index b2efd9505a..9ff16940b7 100644 --- a/types/gm/gm-tests.ts +++ b/types/gm/gm-tests.ts @@ -63,6 +63,9 @@ declare const quality: number; declare const align: string; declare const depth: number; declare const defineValue: string; +declare const customCommand: string; +declare const customInArguments: string[]; +declare const customOutArguments: string[]; let readStream: stream.PassThrough; gm(src) @@ -95,6 +98,7 @@ gm(src) .colorMap(type) .colors(numColors) .colorspace(type) + .command(customCommand) .compose(operator) .compress(type) .contrast(multiplier) @@ -147,6 +151,7 @@ gm(src) .iconGeometry(geometry) .implode() .implode(factor) + .in(...customInArguments) .intent(type) .interlace(type) .label(name) @@ -192,6 +197,7 @@ gm(src) .operator(channel, operator, factor) .operator(channel, operator, factor, usePercent) .orderedDither(channel, NxN) + .out(...customOutArguments) .outputDirectory(dest) .page(width, height) .page(width, height, options) diff --git a/types/gm/index.d.ts b/types/gm/index.d.ts index 5e8853efce..6a5214d8a1 100644 --- a/types/gm/index.d.ts +++ b/types/gm/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for gm 1.18 // Project: https://github.com/aheckmann/gm -// Definitions by: Joel Spadin , Maarten van Vliet +// Definitions by: Joel Spadin +// Maarten van Vliet +// Vaclav Mlejnsky // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -115,6 +117,7 @@ declare namespace m { colorMap(type: 'shared' | 'private' | string): State; colors(colors: number): State; colorspace(space: ColorSpace | string): State; + command(customCommand: string): State; compose(operator: ComposeOperator | string): State; compress(type: CompressionType | string): State; contrast(multiplier: number): State; @@ -157,6 +160,7 @@ declare namespace m { highlightStyle(style: HighlightStyle | string): State; iconGeometry(geometry: string): State; implode(factor?: number): State; + in(...customArguments: string[]): State; intent(type: IntentType | string): State; interlace(type: InterlaceType | string): State; label(name: string): State; @@ -190,6 +194,7 @@ declare namespace m { opaque(color: string): State; operator(channel: string, operator: ChannelOperator | string, rvalue: number, percent?: boolean): State; orderedDither(channelType: ChannelType | string, NxN: string): State; + out(...customArguments: string[]): State; outputDirectory(directory: string): State; page(width: number, height: number, arg?: '%' | '!' | '<' | '>' |string): State; pause(seconds: number): State;