From 2160e7b86f8ab70daf07f7bac3ad0dfcc1982fdf Mon Sep 17 00:00:00 2001 From: rzymek Date: Mon, 26 Jun 2017 18:12:46 +0200 Subject: [PATCH] lodash - Add _.divide --- types/lodash/divide/index.d.ts | 2 ++ types/lodash/index.d.ts | 29 +++++++++++++++++++++++++++++ types/lodash/lodash-tests.ts | 17 +++++++++++++++++ types/lodash/tsconfig.json | 1 + 4 files changed, 49 insertions(+) create mode 100644 types/lodash/divide/index.d.ts diff --git a/types/lodash/divide/index.d.ts b/types/lodash/divide/index.d.ts new file mode 100644 index 0000000000..2df6f40e3a --- /dev/null +++ b/types/lodash/divide/index.d.ts @@ -0,0 +1,2 @@ +import { divide } from "../index"; +export = divide; diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index 6326773899..5d203ebb6d 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -13198,6 +13198,35 @@ declare namespace _ { ceil(precision?: number): LoDashExplicitWrapper; } + //_.divide + interface LoDashStatic { + /** + * Divide two numbers. + * + * @param dividend The first number in a division. + * @param divisor The second number in a division. + * @returns Returns the quotient. + */ + divide( + dividend: number, + divisor: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.divide + */ + divide(divisor: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.divide + */ + divide(divisor: number): LoDashExplicitWrapper; + } + //_.floor interface LoDashStatic { /** diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index b260df8ee5..f3c1b22495 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -7789,6 +7789,23 @@ namespace TestCeil { } } +// _.divide +namespace TestDivide { + { + let result: number; + + result = _.divide(6, 4); + + result = _(6).divide(4); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(6).chain().floor(4); + } +} + // _.floor namespace TestFloor { { diff --git a/types/lodash/tsconfig.json b/types/lodash/tsconfig.json index 419b6142b1..864cc03249 100644 --- a/types/lodash/tsconfig.json +++ b/types/lodash/tsconfig.json @@ -19,6 +19,7 @@ "capitalize/index.d.ts", "castArray/index.d.ts", "ceil/index.d.ts", + "divide/index.d.ts", "chain/index.d.ts", "chunk/index.d.ts", "clamp/index.d.ts",