From 4bb54542fe6502597f50c762695fcd140a61fd89 Mon Sep 17 00:00:00 2001 From: Antonio Laguna Date: Wed, 16 Apr 2014 14:52:40 +0100 Subject: [PATCH 01/16] Adding calls interface to Jasmine --- jasmine/jasmine.d.ts | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index 794538ec55..d8132b4bcd 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -5,13 +5,13 @@ declare function describe(description: string, specDefinitions: () => void): void; -declare function ddescribe(description: string, specDefinitions: () => void): void; +declare function ddescribe(description: string, specDefinitions: () => void): void; declare function xdescribe(description: string, specDefinitions: () => void): void; declare function it(expectation: string, assertion?: () => void): void; declare function it(expectation: string, assertion?: (done: () => void) => void): void; -declare function iit(expectation: string, assertion?: () => void): void; -declare function iit(expectation: string, assertion?: (done: () => void) => void): void; +declare function iit(expectation: string, assertion?: () => void): void; +declare function iit(expectation: string, assertion?: (done: () => void) => void): void; declare function xit(expectation: string, assertion?: () => void): void; declare function xit(expectation: string, assertion?: (done: () => void) => void): void; @@ -98,13 +98,13 @@ declare module jasmine { addReporter(reporter: Reporter): void; execute(): void; describe(description: string, specDefinitions: () => void): Suite; - ddescribe(description: string, specDefinitions: () => void): Suite; + ddescribe(description: string, specDefinitions: () => void): Suite; beforeEach(beforeEachFunction: () => void): void; currentRunner(): Runner; afterEach(afterEachFunction: () => void): void; xdescribe(desc: string, specDefinitions: () => void): XSuite; it(description: string, func: () => void): Spec; - iit(description: string, func: () => void): Spec; + iit(description: string, func: () => void): Spec; xit(desc: string, func: () => void): XSpec; compareRegExps_(a: RegExp, b: RegExp, mismatchKeys: string[], mismatchValues: string[]): boolean; compareObjects_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; @@ -354,7 +354,7 @@ declare module jasmine { identity: string; and: SpyAnd; - calls: any; + calls: Calls; mostRecentCall: { args: any[]; }; argsForCall: any[]; wasCalled: boolean; @@ -367,13 +367,32 @@ declare module jasmine { /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ returnValue(val: any): void; /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */ - callFake(fn: Function): void; + callFake(fn: Function): void; /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */ throwError(msg: string): void; /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */ stub(): void; } + interface Calls { + /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/ + any(): boolean; + /** By chaining the spy with calls.count(), will return the number of times the spy was called **/ + count(): number; + /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/ + argsFor(index: number): any[]; + /** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/ + allArgs(): any[]; + /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/ + all(): any; + /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/ + mostRecent(): any; + /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/ + first(): any; + /** By chaining the spy with calls.reset(), will clears all tracking for a spy **/ + reset(): void; + } + interface Util { inherit(childClass: Function, parentClass: Function): any; formatException(e: any): any; From c5d83cb079e9ceae34c5d854ba4eefef28d2091e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20B=C3=BCrk?= Date: Mon, 21 Apr 2014 00:32:05 +0200 Subject: [PATCH 02/16] #1659: Added BigInteger.js (flattened commit) --- CONTRIBUTORS.md | 1 + bigInteger/bigInteger-tests.ts | 95 +++++++++++++++++++ bigInteger/bigInteger.d.ts | 161 +++++++++++++++++++++++++++++++++ 3 files changed, 257 insertions(+) create mode 100644 bigInteger/bigInteger-tests.ts create mode 100644 bigInteger/bigInteger.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 54ae0cdc8c..d68e3061cc 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -22,6 +22,7 @@ All definitions files include a header with the author and editors, so at some p * [Atom](https://atom.io/) (by [vvakame](https://github.com/vvakame)) * [Backbone.js](http://backbonejs.org/) (by [Boris Yankov](https://github.com/borisyankov)) * [Backbone Relational](http://backbonerelational.org/) (by [Eirik Hoem](https://github.com/eirikhm)) +* [BigInteger](https://github.com/peterolson/BigInteger.js) (by [Ingo Bürk](https://github.com/Airblader)) * [BigScreen](http://brad.is/coding/BigScreen/) (by [Douglas Eichelberger](https://github.com/dduugg)) * [Bluebird](https://github.com/petkaantonov/bluebird) (by [Bart van der Schoor](https://github.com/Bartvds)) * [Bootbox](https://github.com/makeusabrew/bootbox) (by [Vincent Bortone](https://github.com/vbortone/)) diff --git a/bigInteger/bigInteger-tests.ts b/bigInteger/bigInteger-tests.ts new file mode 100644 index 0000000000..7940b86296 --- /dev/null +++ b/bigInteger/bigInteger-tests.ts @@ -0,0 +1,95 @@ +/// + +// constructor tests +var noArgument = bigInt(), + numberArgument = bigInt( 93 ), + stringArgument = bigInt( "75643564363473453456342378564387956906736546456235345" ), + bigIntArgument = bigInt( noArgument ); + +// method tests +var x = bigInt(), + isBigInteger: BigInteger, + isNumber: number, + isBoolean: boolean, + isString: string, + isDivmod: { + quotient: BigInteger; + remainder: BigInteger; + }; + +isBigInteger = x.abs(); + +isBigInteger = x.add( 0 ); +isBigInteger = x.add( x ); + +isBigInteger = x.compare( 0 ); +isBigInteger = x.compare( x ); + +isBigInteger = x.compareAbs( 0 ); +isBigInteger = x.compareAbs( x ); + +isBigInteger = x.divide( 0 ); +isBigInteger = x.divide( x ); + +isDivmod = x.divmod( 0 ); +isDivmod = x.divmod( x ); + +isBoolean = x.equals( 0 ); +isBoolean = x.equals( x ); + +isBoolean = x.greater( 0 ); +isBoolean = x.greater( x ); + +isBoolean = x.greaterOrEquals( 0 ); +isBoolean = x.greaterOrEquals( x ); + +isBoolean = x.isEven(); + +isBoolean = x.isNegative(); + +isBoolean = x.isOdd(); + +isBoolean = x.isPositive(); + +isBoolean = x.lesser( 0 ); +isBoolean = x.lesser( x ); + +isBoolean = x.lesserOrEquals( 0 ); +isBoolean = x.lesserOrEquals( x ); + +isBigInteger = x.minus( 0 ); +isBigInteger = x.minus( x ); + +isBigInteger = x.mod( 0 ); +isBigInteger = x.mod( x ); + +isBigInteger = x.multiply( 0 ); +isBigInteger = x.multiply( x ); + +isBigInteger = x.next(); + +isBoolean = x.notEquals( 0 ); +isBoolean = x.notEquals( x ); + +isBigInteger = x.over( 0 ); +isBigInteger = x.over( x ); + +isBigInteger = x.plus( 0 ); +isBigInteger = x.plus( x ); + +isBigInteger = x.pow( 0 ); +isBigInteger = x.pow( x ); + +isBigInteger = x.prev(); + +isBigInteger = x.subtract( 0 ); +isBigInteger = x.subtract( x ); + +isBigInteger = x.times( 0 ); +isBigInteger = x.times( x ); + +isNumber = x.toJSNumber(); + +isString = x.toString(); + +isNumber = x.valueOf(); \ No newline at end of file diff --git a/bigInteger/bigInteger.d.ts b/bigInteger/bigInteger.d.ts new file mode 100644 index 0000000000..ed03fc5ea1 --- /dev/null +++ b/bigInteger/bigInteger.d.ts @@ -0,0 +1,161 @@ +// Type definitions for BigInteger.js +// Project: https://github.com/peterolson/BigInteger.js +// Definitions by: Ingo Bürk +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface BigInteger { + /** Returns the absolute value of a bigInt. */ + abs(): BigInteger; + + /** Performs addition */ + add( number: number ): BigInteger; + /** Performs addition */ + add( number: BigInteger ): BigInteger; + + /** Alias for the add method. */ + plus( number: number ): BigInteger; + /** Alias for the add method. */ + plus( number: BigInteger ): BigInteger; + + /** Alias for the subtract method. */ + minus( number: number ): BigInteger; + /** Alias for the subtract method. */ + minus( number: BigInteger ): BigInteger; + + /** Performs subtraction. */ + subtract( number: number ): BigInteger; + /** Performs subtraction. */ + subtract( number: BigInteger ): BigInteger; + + /** Performs multiplication. */ + multiply( number: number ): BigInteger; + /** Performs multiplication. */ + multiply( number: BigInteger ): BigInteger; + + /** Alias for the multiply method. */ + times( number: number ): BigInteger; + /** Alias for the multiply method. */ + times( number: BigInteger ): BigInteger; + + /** Performs integer division, disregarding the remainder. */ + divide( number: number ): BigInteger; + /** Performs integer division, disregarding the remainder. */ + divide( number: BigInteger ): BigInteger; + + /** Alias for the divide method. */ + over( number: number ): BigInteger; + /** Alias for the divide method. */ + over( number: BigInteger ): BigInteger; + + /** Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1. */ + pow( number: number ): BigInteger; + /** Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1. */ + pow( number: BigInteger ): BigInteger; + + /** Adds one to the number. */ + next(): BigInteger; + + /** Subtracts one from the number. */ + prev(): BigInteger; + + /** Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. */ + mod( number: number ): BigInteger; + /** Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. */ + mod( number: BigInteger ): BigInteger; + + /** Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend. */ + divmod( number: number ): { quotient: BigInteger; remainder: BigInteger }; + /** Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend. */ + divmod( number: BigInteger ): { quotient: BigInteger; remainder: BigInteger }; + + /** Checks if the first number is greater than the second. */ + greater( number: number ): boolean; + /** Checks if the first number is greater than the second. */ + greater( number: BigInteger ): boolean; + + /** Checks if the first number is greater than or equal to the second. */ + greaterOrEquals( number: number ): boolean; + /** Checks if the first number is greater than or equal to the second. */ + greaterOrEquals( number: BigInteger ): boolean; + + /** Checks if the first number is lesser than the second. */ + lesser( number: number ): boolean; + /** Checks if the first number is lesser than the second. */ + lesser( number: BigInteger ): boolean; + + /** Checks if the first number is less than or equal to the second. */ + lesserOrEquals( number: number ): boolean; + /** Checks if the first number is less than or equal to the second. */ + lesserOrEquals( number: BigInteger ): boolean; + + /** Returns true if the number is even, false otherwise. */ + isEven(): boolean; + + /** Returns true if the number is odd, false otherwise. */ + isOdd(): boolean; + + /** Return true if the number is positive, false otherwise. Returns true for 0 and false for -0. */ + isPositive(): boolean; + + /** Returns true if the number is negative, false otherwise. Returns false for 0 and true for -0. */ + isNegative(): boolean; + + /** + * Performs a comparison between two numbers. If the numbers are equal, it returns 0. + * If the first number is greater, it returns 1. If the first number is lesser, it returns -1. + */ + compare( number: number ): BigInteger; + /** + * Performs a comparison between two numbers. If the numbers are equal, it returns 0. + * If the first number is greater, it returns 1. If the first number is lesser, it returns -1. + */ + compare( number: BigInteger ): BigInteger; + + /** Performs a comparison between the absolute value of two numbers. */ + compareAbs( number: number ): BigInteger; + /** Performs a comparison between the absolute value of two numbers. */ + compareAbs( number: BigInteger ): BigInteger; + + /** Checks if two numbers are equal. */ + equals( number: number ): boolean; + /** Checks if two numbers are equal. */ + equals( number: BigInteger ): boolean; + + /** Checks if two numbers are not equal. */ + notEquals( number: number ): boolean; + /** Checks if two numbers are not equal. */ + notEquals( number: BigInteger ): boolean; + + /** Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range. */ + toJSNumber(): number; + + /** Converts a bigInt to a string. */ + toString(): string; + + /** Converts a bigInt to a native Javascript number. This override allows you to use native arithmetic operators without explicit conversion. */ + valueOf(): number; +} + +interface BigIntegerStatic { + /** Equivalent to bigInt(1) */ + one: BigInteger; + /** Equivalent to bigInt(0) */ + zero: BigInteger; + /** Equivalent to bigInt(-1) */ + minusOne: BigInteger; + + /** Equivalent to bigInt(0) */ + (): BigInteger; + /** Parse a Javascript number into a bigInt */ + ( number: number ): BigInteger; + /** Parse a string into a bigInt */ + ( string: string ): BigInteger; + /** no-op */ + ( bigInt: BigInteger ): BigInteger; +} + +declare var bigInt: BigIntegerStatic; + +declare module "BigInteger" { + export = bigInt; +} \ No newline at end of file From 6416531210d6a22e582214a5f683334469c0970d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20B=C3=BCrk?= Date: Mon, 21 Apr 2014 00:42:58 +0200 Subject: [PATCH 03/16] #2073 BigInteger.js: added string signatures for all methods --- bigInteger/bigInteger-tests.ts | 19 ++++++++++++++++ bigInteger/bigInteger.d.ts | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/bigInteger/bigInteger-tests.ts b/bigInteger/bigInteger-tests.ts index 7940b86296..225b2118de 100644 --- a/bigInteger/bigInteger-tests.ts +++ b/bigInteger/bigInteger-tests.ts @@ -21,27 +21,35 @@ isBigInteger = x.abs(); isBigInteger = x.add( 0 ); isBigInteger = x.add( x ); +isBigInteger = x.add( "100" ); isBigInteger = x.compare( 0 ); isBigInteger = x.compare( x ); +isBigInteger = x.compare( "100" ); isBigInteger = x.compareAbs( 0 ); isBigInteger = x.compareAbs( x ); +isBigInteger = x.compareAbs( "100" ); isBigInteger = x.divide( 0 ); isBigInteger = x.divide( x ); +isBigInteger = x.divide( "100" ); isDivmod = x.divmod( 0 ); isDivmod = x.divmod( x ); +isDivmod = x.divmod( "100" ); isBoolean = x.equals( 0 ); isBoolean = x.equals( x ); +isBoolean = x.equals( "100" ); isBoolean = x.greater( 0 ); isBoolean = x.greater( x ); +isBoolean = x.greater( "100" ); isBoolean = x.greaterOrEquals( 0 ); isBoolean = x.greaterOrEquals( x ); +isBoolean = x.greaterOrEquals( "100" ); isBoolean = x.isEven(); @@ -53,40 +61,51 @@ isBoolean = x.isPositive(); isBoolean = x.lesser( 0 ); isBoolean = x.lesser( x ); +isBoolean = x.lesser( "100" ); isBoolean = x.lesserOrEquals( 0 ); isBoolean = x.lesserOrEquals( x ); +isBoolean = x.lesserOrEquals( "100" ); isBigInteger = x.minus( 0 ); isBigInteger = x.minus( x ); +isBigInteger = x.minus( "100" ); isBigInteger = x.mod( 0 ); isBigInteger = x.mod( x ); +isBigInteger = x.mod( "100" ); isBigInteger = x.multiply( 0 ); isBigInteger = x.multiply( x ); +isBigInteger = x.multiply( "100" ); isBigInteger = x.next(); isBoolean = x.notEquals( 0 ); isBoolean = x.notEquals( x ); +isBoolean = x.notEquals( "100" ); isBigInteger = x.over( 0 ); isBigInteger = x.over( x ); +isBigInteger = x.over( "100" ); isBigInteger = x.plus( 0 ); isBigInteger = x.plus( x ); +isBigInteger = x.plus( "100" ); isBigInteger = x.pow( 0 ); isBigInteger = x.pow( x ); +isBigInteger = x.pow( "100" ); isBigInteger = x.prev(); isBigInteger = x.subtract( 0 ); isBigInteger = x.subtract( x ); +isBigInteger = x.subtract( "100" ); isBigInteger = x.times( 0 ); isBigInteger = x.times( x ); +isBigInteger = x.times( "100" ); isNumber = x.toJSNumber(); diff --git a/bigInteger/bigInteger.d.ts b/bigInteger/bigInteger.d.ts index ed03fc5ea1..a98fad7e79 100644 --- a/bigInteger/bigInteger.d.ts +++ b/bigInteger/bigInteger.d.ts @@ -11,46 +11,64 @@ interface BigInteger { add( number: number ): BigInteger; /** Performs addition */ add( number: BigInteger ): BigInteger; + /** Performs addition */ + add( number: string ): BigInteger; /** Alias for the add method. */ plus( number: number ): BigInteger; /** Alias for the add method. */ plus( number: BigInteger ): BigInteger; + /** Alias for the add method. */ + plus( number: string ): BigInteger; /** Alias for the subtract method. */ minus( number: number ): BigInteger; /** Alias for the subtract method. */ minus( number: BigInteger ): BigInteger; + /** Alias for the subtract method. */ + minus( number: string ): BigInteger; /** Performs subtraction. */ subtract( number: number ): BigInteger; /** Performs subtraction. */ subtract( number: BigInteger ): BigInteger; + /** Performs subtraction. */ + subtract( number: string ): BigInteger; /** Performs multiplication. */ multiply( number: number ): BigInteger; /** Performs multiplication. */ multiply( number: BigInteger ): BigInteger; + /** Performs multiplication. */ + multiply( number: string ): BigInteger; /** Alias for the multiply method. */ times( number: number ): BigInteger; /** Alias for the multiply method. */ times( number: BigInteger ): BigInteger; + /** Alias for the multiply method. */ + times( number: string ): BigInteger; /** Performs integer division, disregarding the remainder. */ divide( number: number ): BigInteger; /** Performs integer division, disregarding the remainder. */ divide( number: BigInteger ): BigInteger; + /** Performs integer division, disregarding the remainder. */ + divide( number: string ): BigInteger; /** Alias for the divide method. */ over( number: number ): BigInteger; /** Alias for the divide method. */ over( number: BigInteger ): BigInteger; + /** Alias for the divide method. */ + over( number: string ): BigInteger; /** Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1. */ pow( number: number ): BigInteger; /** Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1. */ pow( number: BigInteger ): BigInteger; + /** Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1. */ + pow( number: string ): BigInteger; /** Adds one to the number. */ next(): BigInteger; @@ -62,31 +80,43 @@ interface BigInteger { mod( number: number ): BigInteger; /** Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. */ mod( number: BigInteger ): BigInteger; + /** Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. */ + mod( number: string ): BigInteger; /** Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend. */ divmod( number: number ): { quotient: BigInteger; remainder: BigInteger }; /** Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend. */ divmod( number: BigInteger ): { quotient: BigInteger; remainder: BigInteger }; + /** Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend. */ + divmod( number: string ): { quotient: BigInteger; remainder: BigInteger }; /** Checks if the first number is greater than the second. */ greater( number: number ): boolean; /** Checks if the first number is greater than the second. */ greater( number: BigInteger ): boolean; + /** Checks if the first number is greater than the second. */ + greater( number: string ): boolean; /** Checks if the first number is greater than or equal to the second. */ greaterOrEquals( number: number ): boolean; /** Checks if the first number is greater than or equal to the second. */ greaterOrEquals( number: BigInteger ): boolean; + /** Checks if the first number is greater than or equal to the second. */ + greaterOrEquals( number: string ): boolean; /** Checks if the first number is lesser than the second. */ lesser( number: number ): boolean; /** Checks if the first number is lesser than the second. */ lesser( number: BigInteger ): boolean; + /** Checks if the first number is lesser than the second. */ + lesser( number: string ): boolean; /** Checks if the first number is less than or equal to the second. */ lesserOrEquals( number: number ): boolean; /** Checks if the first number is less than or equal to the second. */ lesserOrEquals( number: BigInteger ): boolean; + /** Checks if the first number is less than or equal to the second. */ + lesserOrEquals( number: string ): boolean; /** Returns true if the number is even, false otherwise. */ isEven(): boolean; @@ -110,21 +140,32 @@ interface BigInteger { * If the first number is greater, it returns 1. If the first number is lesser, it returns -1. */ compare( number: BigInteger ): BigInteger; + /** + * Performs a comparison between two numbers. If the numbers are equal, it returns 0. + * If the first number is greater, it returns 1. If the first number is lesser, it returns -1. + */ + compare( number: string ): BigInteger; /** Performs a comparison between the absolute value of two numbers. */ compareAbs( number: number ): BigInteger; /** Performs a comparison between the absolute value of two numbers. */ compareAbs( number: BigInteger ): BigInteger; + /** Performs a comparison between the absolute value of two numbers. */ + compareAbs( number: string ): BigInteger; /** Checks if two numbers are equal. */ equals( number: number ): boolean; /** Checks if two numbers are equal. */ equals( number: BigInteger ): boolean; + /** Checks if two numbers are equal. */ + equals( number: string ): boolean; /** Checks if two numbers are not equal. */ notEquals( number: number ): boolean; /** Checks if two numbers are not equal. */ notEquals( number: BigInteger ): boolean; + /** Checks if two numbers are not equal. */ + notEquals( number: string ): boolean; /** Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range. */ toJSNumber(): number; From f723f78dc43ee468aa9c3d69975a6e511b3efb3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20B=C3=BCrk?= Date: Mon, 21 Apr 2014 01:52:28 +0200 Subject: [PATCH 04/16] #2073: fix spelling --- .../bigInteger-tests.ts => big-integer/big-integer-tests.ts | 2 +- bigInteger/bigInteger.d.ts => big-integer/big-integer.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename bigInteger/bigInteger-tests.ts => big-integer/big-integer-tests.ts (98%) rename bigInteger/bigInteger.d.ts => big-integer/big-integer.d.ts (99%) diff --git a/bigInteger/bigInteger-tests.ts b/big-integer/big-integer-tests.ts similarity index 98% rename from bigInteger/bigInteger-tests.ts rename to big-integer/big-integer-tests.ts index 225b2118de..3b9fb8745f 100644 --- a/bigInteger/bigInteger-tests.ts +++ b/big-integer/big-integer-tests.ts @@ -1,4 +1,4 @@ -/// +/// // constructor tests var noArgument = bigInt(), diff --git a/bigInteger/bigInteger.d.ts b/big-integer/big-integer.d.ts similarity index 99% rename from bigInteger/bigInteger.d.ts rename to big-integer/big-integer.d.ts index a98fad7e79..dfadc49629 100644 --- a/bigInteger/bigInteger.d.ts +++ b/big-integer/big-integer.d.ts @@ -197,6 +197,6 @@ interface BigIntegerStatic { declare var bigInt: BigIntegerStatic; -declare module "BigInteger" { +declare module "big-integer" { export = bigInt; } \ No newline at end of file From b03204e6f034d0962cd9a459642f17b8f02fd5d8 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 23 Apr 2014 09:50:10 +0100 Subject: [PATCH 05/16] jQuery UI: changeMonth and changeYear JSDoc --- jqueryui/jqueryui-tests.ts | 18 ++++++++++++++++++ jqueryui/jqueryui.d.ts | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index c922ec161a..e2aac42a09 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1270,6 +1270,24 @@ function test_datepicker() { // setter var $set: JQuery = $(".selector").datepicker("option", "calculateWeek", myWeekCalc); } + + function changeMonth() { + $(".selector").datepicker({ changeMonth: true }); + + var changeMonth: boolean = $(".selector").datepicker("option", "changeMonth"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "changeMonth", true); + } + + function changeYear() { + $(".selector").datepicker({ changeYear: true }); + + var changeYear: boolean = $(".selector").datepicker("option", "changeYear"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "changeYear", true); + } } diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index 083df7b463..2ccd2c262e 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -1287,10 +1287,41 @@ interface JQuery { * @param methodName 'option' * @param optionName 'buttonText' * @param calculateWeekValue A function to calculate the week of the year for a given date. The default implementation uses the ISO 8601 definition: weeks start on a Monday; the first week of the year contains the first Thursday of the year. - */ datepicker(methodName: 'option', optionName: 'calculateWeek', calculateWeekValue: (date: Date) => string): JQuery; + /** + * Get the changeMonth option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + */ + datepicker(methodName: 'option', optionName: 'changeMonth'): boolean; + /** + * Set the changeMonth option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + * @param changeMonthValue Whether the month should be rendered as a dropdown instead of text. + */ + datepicker(methodName: 'option', optionName: 'changeMonth', changeMonthValue: boolean): JQuery; + + /** + * Get the changeYear option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + */ + datepicker(methodName: 'option', optionName: 'changeYear'): boolean; + /** + * Set the changeYear option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + * @param changeYearValue Whether the year should be rendered as a dropdown instead of text. Use the yearRange option to control which years are made available for selection. + */ + datepicker(methodName: 'option', optionName: 'changeYear', changeYearValue: boolean): JQuery; + /** * Gets the value currently associated with the specified optionName. * From a71f0ee0f91e681c729c9c717f701a477168614b Mon Sep 17 00:00:00 2001 From: Bart van der Schoor Date: Wed, 23 Apr 2014 13:45:09 +0200 Subject: [PATCH 06/16] added Google Analytics beacon so we have some github stats in the GA account to compare to the sites --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4671d37859..479e04cc89 100755 --- a/README.md +++ b/README.md @@ -37,3 +37,5 @@ Here is an updated list of [definitions people have requested](https://github.co This project is licensed under the MIT license. Copyrights on the definition files are respective of each contributor listed at the beginning of each definition file. + +[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) \ No newline at end of file From f1d0dcabb728013aa5dbbbc82f5f603de7d977e0 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 23 Apr 2014 17:08:19 +0100 Subject: [PATCH 07/16] jQueryUI: Finished the c's --- jqueryui/jqueryui-tests.ts | 27 +++++++++++++++++++++ jqueryui/jqueryui.d.ts | 48 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index e2aac42a09..136bb2c962 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1288,6 +1288,33 @@ function test_datepicker() { // setter var $set: JQuery = $(".selector").datepicker("option", "changeYear", true); } + + function closeText() { + $(".selector").datepicker({ closeText: "Close" }); + + var closeText: string = $(".selector").datepicker("option", "closeText"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "closeText", "Close"); + } + + function constrainInput() { + $(".selector").datepicker({ constrainInput: false }); + + var constrainInput: boolean = $(".selector").datepicker("option", "constrainInput"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "constrainInput", false); + } + + function currentText() { + $(".selector").datepicker({ currentText: "Now" }); + + var currentText: string = $(".selector").datepicker("option", "currentText"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "currentText", "Now"); + } } diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index 2ccd2c262e..57f10c08ee 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -1322,6 +1322,54 @@ interface JQuery { */ datepicker(methodName: 'option', optionName: 'changeYear', changeYearValue: boolean): JQuery; + /** + * Get the closeText option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + */ + datepicker(methodName: 'option', optionName: 'closeText'): string; + /** + * Set the closeText option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + * @param closeTextValue The text to display for the close link. Use the showButtonPanel option to display this button. + */ + datepicker(methodName: 'option', optionName: 'closeText', closeTextValue: string): JQuery; + + /** + * Get the constrainInput option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + */ + datepicker(methodName: 'option', optionName: 'constrainInput'): boolean; + /** + * Set the constrainInput option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + * @param constrainInputValue When true, entry in the input field is constrained to those characters allowed by the current dateFormat option. + */ + datepicker(methodName: 'option', optionName: 'constrainInput', constrainInputValue: boolean): JQuery; + + /** + * Get the currentText option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + */ + datepicker(methodName: 'option', optionName: 'currentText'): string; + /** + * Set the currentText option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + * @param currentTextValue The text to display for the current day link. Use the showButtonPanel option to display this button. + */ + datepicker(methodName: 'option', optionName: 'currentText', currentTextValue: string): JQuery; + /** * Gets the value currently associated with the specified optionName. * From e3c20e7aca12cb54e5b66d7bd03218805dfc0a00 Mon Sep 17 00:00:00 2001 From: Santi Albo Date: Thu, 24 Apr 2014 11:35:12 +0100 Subject: [PATCH 08/16] (restangular) Fix argument order in custom methods The arguments were in the wrong order for custom methods --- restangular/restangular.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/restangular/restangular.d.ts b/restangular/restangular.d.ts index a5b7de20d9..0cc4321afb 100644 --- a/restangular/restangular.d.ts +++ b/restangular/restangular.d.ts @@ -60,8 +60,8 @@ interface RestangularCustom { customGET(path: string, params?: any, headers?: any): ng.IPromise; customGETLIST(path: string, params?: any, headers?: any): ng.IPromise; customDELETE(path: string, params?: any, headers?: any): ng.IPromise; - customPOST(path: string, params?: any, headers?: any, elem?: any): ng.IPromise; - customPUT(path: string, params?: any, headers?: any, elem?: any): ng.IPromise; + customPOST(elem?: any, path?: string, params?: any, headers?: any): ng.IPromise; + customPUT(elem?: any, path?: string, params?: any, headers?: any): ng.IPromise; customOperation(operation: string, path: string, params?: any, headers?: any, elem?: any): ng.IPromise; addRestangularMethod(name: string, operation: string, path?: string, params?: any, headers?: any, elem?: any): ng.IPromise; } From e3d8e5fe91cfe0111686da53bf50ba8303d6102f Mon Sep 17 00:00:00 2001 From: Santi Albo Date: Thu, 24 Apr 2014 11:42:09 +0100 Subject: [PATCH 09/16] fix restangular test --- restangular/restangular-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restangular/restangular-tests.ts b/restangular/restangular-tests.ts index 22473e13e2..9643c9e6b3 100644 --- a/restangular/restangular-tests.ts +++ b/restangular/restangular-tests.ts @@ -75,7 +75,7 @@ function test_basic() { $scope.account = account.get({ single: true }); - account.customPOST("messages", { param: "myParam" }, {}, { name: "My Message" }) + account.customPOST({ name: "My Message" }, "messages", { param: "myParam" }, {}) } function test_config() { From 79a48d8772e6b677ad0e2bc471e0724909c7a0ab Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 24 Apr 2014 15:47:53 +0100 Subject: [PATCH 10/16] jQueryUI: now the d's --- jqueryui/jqueryui-tests.ts | 47 ++++++++++++++++++ jqueryui/jqueryui.d.ts | 98 +++++++++++++++++++++++++++++++++++++- 2 files changed, 144 insertions(+), 1 deletion(-) diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index 136bb2c962..b83006c3a8 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1315,6 +1315,53 @@ function test_datepicker() { // setter var $set: JQuery = $(".selector").datepicker("option", "currentText", "Now"); } + + function dateFormat() { + $(".selector").datepicker({ dateFormat: "yy-mm-dd" }); + + var dateFormat: string = $(".selector").datepicker("option", "dateFormat"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "dateFormat", "yy-mm-dd"); + } + + function dayNames() { + $(".selector").datepicker({ dayNames: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"] }); + + var dayNames: string[] = $(".selector").datepicker("option", "dayNames"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "dayNames", ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"]); + } + + function dayNamesMin() { + $(".selector").datepicker({ dayNamesMin: ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"] }); + + var dayNamesMin: string[] = $(".selector").datepicker("option", "dayNamesMin"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "dayNamesMin", ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"]); + } + + function dayNamesShort() { + $(".selector").datepicker({ dayNamesShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"] }); + + var dayNamesShort: string[] = $(".selector").datepicker("option", "dayNamesShort"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "dayNamesShort", ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"]); + } + + function defaultDate() { + $(".selector").datepicker({ defaultDate: +7 }); + + var defaultDate: any = $(".selector").datepicker("option", "defaultDate"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "defaultDate", +7); + $set = $(".selector").datepicker("option", "defaultDate", new Date()); + $set = $(".selector").datepicker("option", "defaultDate", "+1m +7d"); + } } diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index 57f10c08ee..5019a99504 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -180,7 +180,7 @@ declare module JQueryUI { * Number: A number of days from today. For example 2 represents two days from today and -1 represents yesterday. * String: A string in the format defined by the dateFormat option, or a relative date. Relative dates must contain value and period pairs; valid periods are "y" for years, "m" for months, "w" for weeks, and "d" for days. For example, "+1m +7d" represents one month and seven days from today. */ - defaultDateType?: any; // Date, number or string + defaultDate?: any; // Date, number or string /** * Control the speed at which the datepicker appears, it may be a time in milliseconds or a string representing one of the three predefined speeds ("slow", "normal", "fast"). */ @@ -1370,6 +1370,102 @@ interface JQuery { */ datepicker(methodName: 'option', optionName: 'currentText', currentTextValue: string): JQuery; + /** + * Get the dateFormat option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + */ + datepicker(methodName: 'option', optionName: 'dateFormat'): string; + /** + * Set the dateFormat option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + * @param dateFormatValue The format for parsed and displayed dates. For a full list of the possible formats see the formatDate function. + */ + datepicker(methodName: 'option', optionName: 'dateFormat', dateFormatValue: string): JQuery; + + /** + * Get the dayNames option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + */ + datepicker(methodName: 'option', optionName: 'dayNames'): string[]; + /** + * Set the dayNames option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + * @param dayNamesValue The list of long day names, starting from Sunday, for use as requested via the dateFormat option. + */ + datepicker(methodName: 'option', optionName: 'dayNames', dayNamesValue: string[]): JQuery; + + /** + * Get the dayNamesMin option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + */ + datepicker(methodName: 'option', optionName: 'dayNamesMin'): string[]; + /** + * Set the dayNamesMin option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + * @param dayNamesMinValue The list of minimised day names, starting from Sunday, for use as column headers within the datepicker. + */ + datepicker(methodName: 'option', optionName: 'dayNamesMin', dayNamesMinValue: string[]): JQuery; + + /** + * Get the dayNamesShort option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + */ + datepicker(methodName: 'option', optionName: 'dayNamesShort'): string[]; + /** + * Set the dayNamesShort option, after initialization + * + * @param methodName 'option' + * @param optionName 'buttonText' + * @param dayNamesShortValue The list of abbreviated day names, starting from Sunday, for use as requested via the dateFormat option. + */ + datepicker(methodName: 'option', optionName: 'dayNamesShort', dayNamesShortValue: string[]): JQuery; + + /** + * Get the defaultDate option, after initialization + * + * @param methodName 'option' + * @param optionName 'defaultDate' + */ + datepicker(methodName: 'option', optionName: 'defaultDate'): any; + /** + * Set the defaultDate option, after initialization + * + * @param methodName 'option' + * @param optionName 'defaultDate' + * @param defaultDateValue A date object containing the default date. + */ + datepicker(methodName: 'option', optionName: 'defaultDate', defaultDateValue: Date): JQuery; + /** + * Set the defaultDate option, after initialization + * + * @param methodName 'option' + * @param optionName 'defaultDate' + * @param defaultDateValue A number of days from today. For example 2 represents two days from today and -1 represents yesterday. + */ + datepicker(methodName: 'option', optionName: 'defaultDate', defaultDateValue: number): JQuery; + /** + * Set the defaultDate option, after initialization + * + * @param methodName 'option' + * @param optionName 'defaultDate' + * @param defaultDateValue A string in the format defined by the dateFormat option, or a relative date. Relative dates must contain value and period pairs; valid periods are "y" for years, "m" for months, "w" for weeks, and "d" for days. For example, "+1m +7d" represents one month and seven days from today. + */ + datepicker(methodName: 'option', optionName: 'defaultDate', defaultDateValue: string): JQuery; + /** * Gets the value currently associated with the specified optionName. * From 45b1c617ad3979914fb407398440b37a42f4bb4b Mon Sep 17 00:00:00 2001 From: Bart van der Schoor Date: Thu, 24 Apr 2014 17:41:01 +0200 Subject: [PATCH 11/16] changed joi header to v4.0.0 --- joi/joi.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joi/joi.d.ts b/joi/joi.d.ts index 344738e891..10bc7225e7 100644 --- a/joi/joi.d.ts +++ b/joi/joi.d.ts @@ -1,4 +1,4 @@ -// Type definitions for joi v3.1.0 +// Type definitions for joi v4.0.0 // Project: https://github.com/spumko/joi // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped From 4d233b71518a91c4e65bf03dbe4a8d8709412040 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 25 Apr 2014 09:57:57 +0100 Subject: [PATCH 12/16] jQueryUI: Tidy up and up to gotoCurrent --- jqueryui/jqueryui-tests.ts | 27 ++++++++++++ jqueryui/jqueryui.d.ts | 88 +++++++++++++++++++++++++++++--------- 2 files changed, 95 insertions(+), 20 deletions(-) diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index b83006c3a8..79263027fe 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1362,6 +1362,33 @@ function test_datepicker() { $set = $(".selector").datepicker("option", "defaultDate", new Date()); $set = $(".selector").datepicker("option", "defaultDate", "+1m +7d"); } + + function duration() { + $(".selector").datepicker({ duration: "slow" }); + + var duration: string = $(".selector").datepicker("option", "duration"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "duration", "slow"); + } + + function firstDay() { + $(".selector").datepicker({ firstDay: 1 }); + + var firstDay: number = $(".selector").datepicker("option", "firstDay"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "firstDay", 1); + } + + function gotoCurrent() { + $(".selector").datepicker({ gotoCurrent: true }); + + var gotoCurrent: boolean = $(".selector").datepicker("option", "gotoCurrent"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "gotoCurrent", true); + } } diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index 5019a99504..26492bf200 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -1278,14 +1278,14 @@ interface JQuery { * Get the calculateWeek option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'calculateWeek' */ datepicker(methodName: 'option', optionName: 'calculateWeek'): (date: Date) => string; /** * Set the calculateWeek option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'calculateWeek' * @param calculateWeekValue A function to calculate the week of the year for a given date. The default implementation uses the ISO 8601 definition: weeks start on a Monday; the first week of the year contains the first Thursday of the year. */ datepicker(methodName: 'option', optionName: 'calculateWeek', calculateWeekValue: (date: Date) => string): JQuery; @@ -1294,14 +1294,14 @@ interface JQuery { * Get the changeMonth option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'changeMonth' */ datepicker(methodName: 'option', optionName: 'changeMonth'): boolean; /** * Set the changeMonth option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'changeMonth' * @param changeMonthValue Whether the month should be rendered as a dropdown instead of text. */ datepicker(methodName: 'option', optionName: 'changeMonth', changeMonthValue: boolean): JQuery; @@ -1310,14 +1310,14 @@ interface JQuery { * Get the changeYear option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'changeYear' */ datepicker(methodName: 'option', optionName: 'changeYear'): boolean; /** * Set the changeYear option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'changeYear' * @param changeYearValue Whether the year should be rendered as a dropdown instead of text. Use the yearRange option to control which years are made available for selection. */ datepicker(methodName: 'option', optionName: 'changeYear', changeYearValue: boolean): JQuery; @@ -1326,14 +1326,14 @@ interface JQuery { * Get the closeText option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'closeText' */ datepicker(methodName: 'option', optionName: 'closeText'): string; /** * Set the closeText option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'closeText' * @param closeTextValue The text to display for the close link. Use the showButtonPanel option to display this button. */ datepicker(methodName: 'option', optionName: 'closeText', closeTextValue: string): JQuery; @@ -1342,14 +1342,14 @@ interface JQuery { * Get the constrainInput option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'constrainInput' */ datepicker(methodName: 'option', optionName: 'constrainInput'): boolean; /** * Set the constrainInput option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'constrainInput' * @param constrainInputValue When true, entry in the input field is constrained to those characters allowed by the current dateFormat option. */ datepicker(methodName: 'option', optionName: 'constrainInput', constrainInputValue: boolean): JQuery; @@ -1358,14 +1358,14 @@ interface JQuery { * Get the currentText option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'currentText' */ datepicker(methodName: 'option', optionName: 'currentText'): string; /** * Set the currentText option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'currentText' * @param currentTextValue The text to display for the current day link. Use the showButtonPanel option to display this button. */ datepicker(methodName: 'option', optionName: 'currentText', currentTextValue: string): JQuery; @@ -1374,14 +1374,14 @@ interface JQuery { * Get the dateFormat option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'dateFormat' */ datepicker(methodName: 'option', optionName: 'dateFormat'): string; /** * Set the dateFormat option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'dateFormat' * @param dateFormatValue The format for parsed and displayed dates. For a full list of the possible formats see the formatDate function. */ datepicker(methodName: 'option', optionName: 'dateFormat', dateFormatValue: string): JQuery; @@ -1390,14 +1390,14 @@ interface JQuery { * Get the dayNames option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'dayNames' */ datepicker(methodName: 'option', optionName: 'dayNames'): string[]; /** * Set the dayNames option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'dayNames' * @param dayNamesValue The list of long day names, starting from Sunday, for use as requested via the dateFormat option. */ datepicker(methodName: 'option', optionName: 'dayNames', dayNamesValue: string[]): JQuery; @@ -1406,14 +1406,14 @@ interface JQuery { * Get the dayNamesMin option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'dayNamesMin' */ datepicker(methodName: 'option', optionName: 'dayNamesMin'): string[]; /** * Set the dayNamesMin option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'dayNamesMin' * @param dayNamesMinValue The list of minimised day names, starting from Sunday, for use as column headers within the datepicker. */ datepicker(methodName: 'option', optionName: 'dayNamesMin', dayNamesMinValue: string[]): JQuery; @@ -1422,14 +1422,14 @@ interface JQuery { * Get the dayNamesShort option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'dayNamesShort' */ datepicker(methodName: 'option', optionName: 'dayNamesShort'): string[]; /** * Set the dayNamesShort option, after initialization * * @param methodName 'option' - * @param optionName 'buttonText' + * @param optionName 'dayNamesShort' * @param dayNamesShortValue The list of abbreviated day names, starting from Sunday, for use as requested via the dateFormat option. */ datepicker(methodName: 'option', optionName: 'dayNamesShort', dayNamesShortValue: string[]): JQuery; @@ -1466,6 +1466,54 @@ interface JQuery { */ datepicker(methodName: 'option', optionName: 'defaultDate', defaultDateValue: string): JQuery; + /** + * Get the duration option, after initialization + * + * @param methodName 'option' + * @param optionName 'duration' + */ + datepicker(methodName: 'option', optionName: 'duration'): string; + /** + * Set the duration option, after initialization + * + * @param methodName 'option' + * @param optionName 'duration' + * @param durationValue Control the speed at which the datepicker appears, it may be a time in milliseconds or a string representing one of the three predefined speeds ("slow", "normal", "fast"). + */ + datepicker(methodName: 'option', optionName: 'duration', durationValue: string): JQuery; + + /** + * Get the firstDay option, after initialization + * + * @param methodName 'option' + * @param optionName 'firstDay' + */ + datepicker(methodName: 'option', optionName: 'firstDay'): number; + /** + * Set the firstDay option, after initialization + * + * @param methodName 'option' + * @param optionName 'firstDay' + * @param firstDayValue Set the first day of the week: Sunday is 0, Monday is 1, etc. + */ + datepicker(methodName: 'option', optionName: 'firstDay', firstDayValue: number): JQuery; + + /** + * Get the gotoCurrent option, after initialization + * + * @param methodName 'option' + * @param optionName 'gotoCurrent' + */ + datepicker(methodName: 'option', optionName: 'gotoCurrent'): boolean; + /** + * Set the gotoCurrent option, after initialization + * + * @param methodName 'option' + * @param optionName 'gotoCurrent' + * @param gotoCurrentValue When true, the current day link moves to the currently selected date instead of today. + */ + datepicker(methodName: 'option', optionName: 'gotoCurrent', gotoCurrentValue: boolean): JQuery; + /** * Gets the value currently associated with the specified optionName. * From 4fa6f7c29bec19e0d6420d91e2131d17c2a4570e Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Sat, 26 Apr 2014 08:59:37 +1000 Subject: [PATCH 13/16] gruntjs: added node.js support --- gruntjs/gruntjs.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gruntjs/gruntjs.d.ts b/gruntjs/gruntjs.d.ts index f646bcbf21..fb971a0997 100644 --- a/gruntjs/gruntjs.d.ts +++ b/gruntjs/gruntjs.d.ts @@ -1293,3 +1293,8 @@ interface IGrunt extends grunt.IConfigComponents, grunt.fail.FailModule, grunt.I */ version: string } + +// NodeJS Support +declare module 'grunt' { + export = IGrunt; +} From 87e0cf355331f726ee0169aabdaaef8754d3d83f Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Sat, 26 Apr 2014 09:07:07 +1000 Subject: [PATCH 14/16] Update gruntjs.d.ts --- gruntjs/gruntjs.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gruntjs/gruntjs.d.ts b/gruntjs/gruntjs.d.ts index fb971a0997..2bf0d91b47 100644 --- a/gruntjs/gruntjs.d.ts +++ b/gruntjs/gruntjs.d.ts @@ -1296,5 +1296,6 @@ interface IGrunt extends grunt.IConfigComponents, grunt.fail.FailModule, grunt.I // NodeJS Support declare module 'grunt' { - export = IGrunt; + var grunt: IGrunt; + export = grunt; } From 2b05c7787265ed95c79d6d8400bcc46d141e82af Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Sat, 26 Apr 2014 09:08:53 +1000 Subject: [PATCH 15/16] fix underscore string module declaration --- underscore.string/underscore.string.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/underscore.string/underscore.string.d.ts b/underscore.string/underscore.string.d.ts index db9ec042d4..9c828fdf7b 100644 --- a/underscore.string/underscore.string.d.ts +++ b/underscore.string/underscore.string.d.ts @@ -562,7 +562,8 @@ interface UnderscoreStringStaticExports { toBoolean(str: string, trueValues?: any[], falseValues?: any[]): boolean; } -declare module "underscore.string" { -export = UnderscoreStringStatic; +declare module 'underscore.string' { + var underscoreString: UnderscoreStringStatic; + export = underscoreString; } // TODO interface UnderscoreString extends Underscore From 3963c4498b7208e0591af6a7873e1aab0afee488 Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Sat, 26 Apr 2014 10:37:50 +0900 Subject: [PATCH 16/16] Add url --- CONTRIBUTORS.md | 1 + js-url/js-url-test.ts | 9 +++++++++ js-url/js-url.d.ts | 14 ++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 js-url/js-url-test.ts create mode 100644 js-url/js-url.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d68e3061cc..7806a004a8 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -156,6 +156,7 @@ All definitions files include a header with the author and editors, so at some p * [jQuery.Watermark](http://jquery-watermark.googlecode.com) (by [Anwar Javed](https://github.com/anwarjaved)) * [jQuery.base64](https://github.com/yatt/jquery.base64) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki)) * [js-git](https://github.com/creationix/js-git) (by [Bart van der Schoor](https://github.com/Bartvds)) +* [js-url](https://github.com/websanova/js-url) (by [MIZUNE Pine](https://github.com/pine613)) * [js-yaml](https://github.com/nodeca/js-yaml) (by [Bart van der Schoor](https://github.com/Bartvds/)) * [jScrollPane](http://jscrollpane.kelvinluck.com) (by [Dániel Tar](https://github.com/qcz)) * [JSDeferred](http://cho45.stfuawsc.com/jsdeferred/) (by [Daisuke Mino](https://github.com/minodisk)) diff --git a/js-url/js-url-test.ts b/js-url/js-url-test.ts new file mode 100644 index 0000000000..0b26f6175b --- /dev/null +++ b/js-url/js-url-test.ts @@ -0,0 +1,9 @@ +/// + +url(); + +url('domain'); +url(1); + +url('domain', 'test.www.example.com/path/here'); +url(-1, 'test.www.example.com/path/here'); diff --git a/js-url/js-url.d.ts b/js-url/js-url.d.ts new file mode 100644 index 0000000000..ff974f15e2 --- /dev/null +++ b/js-url/js-url.d.ts @@ -0,0 +1,14 @@ +// Type definitions for url() v1.8.6 +// Project: https://github.com/websanova/js-url +// Definitions by: MIZUNE Pine +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface UrlStatic { + (): string; + (pattern: string): string; + (pattern: number): string; + (pattern: string, url: string): string; + (pattern: number, url: string): string; +} + +declare var url: UrlStatic;