update to use static methods.

add missing Date.create(number)
This commit is contained in:
Jean-Philippe HAUTIN
2016-07-04 18:01:59 +02:00
parent 0bdc1385e3
commit d63782563f

17
sugar/sugar.d.ts vendored
View File

@@ -907,7 +907,7 @@ interface String {
}
// Todo: fix when TypeScript supports adding static functions to native types.
interface NumberStatic {
interface NumberConstructor {
/**
* Returns a random integer between [n1] and [n2].
@@ -1963,8 +1963,8 @@ interface Number {
upto(num: number, fn?: Function, step?: number): number[];
}
// Todo: Fix when TypeScript supports static members on native types.
interface ArrayStatic {
//Static members on native types.
interface ArrayConstructor {
/**
* Alternate array constructor.
@@ -2918,7 +2918,7 @@ interface Array<T> {
//zip(...arrays: T[]): T[][];
}
interface ObjectStatic {
interface ObjectConstructor {
/**
* Creates a new object, equivalent to %new Object()% or %{}%, but with extended methods.
@@ -4003,7 +4003,7 @@ interface Function {
throttle(ms: number): Function;
}
interface RegExpStatic {
interface RegExpConstructor {
/**
* Escapes all RegExp tokens in a string.
@@ -4080,7 +4080,7 @@ interface Locale {
timeParse: string[];
}
interface DateStatic {
interface DateConstructor {
/**
* Adds a locale <set> to the locales understood by Sugar.
@@ -4125,6 +4125,11 @@ interface DateStatic {
**/
create(d: string, locale?: string): Date;
/**
* @see create
* @param timestamp
create(timestamp:number): Date;
/**
* @see create
* @param year Year YYYY