]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Replace null/undefined with void in moment.d.ts to fix pre 2.0 typescript users
authorIskren Chernev <iskren.chernev@gmail.com>
Sun, 27 Nov 2016 14:48:05 +0000 (16:48 +0200)
committerIskren Chernev <iskren.chernev@gmail.com>
Sun, 4 Dec 2016 05:07:59 +0000 (21:07 -0800)
moment.d.ts

index 01aa7324b8d8905b361965f4ca2e34a4f22544fd..2234ea7318f542a8609c32040765dc536294883f 100644 (file)
@@ -68,7 +68,7 @@ declare namespace moment {
     sameElse?: CalendarSpecVal;
 
     // any additional properties might be used with moment.calendarFormat
-    [x: string]: CalendarSpecVal | undefined;
+    [x: string]: CalendarSpecVal | void; // undefined
   }
 
   type RelativeTimeSpecVal = (
@@ -248,12 +248,12 @@ declare namespace moment {
     overflow: number;
     charsLeftOver: number;
     nullInput: boolean;
-    invalidMonth: string | null;
+    invalidMonth: string | void; // null
     invalidFormat: boolean;
     userInvalidated: boolean;
     iso: boolean;
     parsedDateParts: any[];
-    meridiem: string | null;
+    meridiem: string | void; // null
   }
 
   interface MomentParsingFlagsOpt {
@@ -389,8 +389,8 @@ declare namespace moment {
     to: MomentInput;
   }
 
-  type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | null | undefined;
-  type DurationInputArg1 = Duration | number | string | FromTo | DurationInputObject | null | undefined;
+  type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
+  type DurationInputArg1 = Duration | number | string | FromTo | DurationInputObject | void; // null | undefined
   type DurationInputArg2 = unitOfTime.DurationConstructor;
   type LocaleSpecifier = string | Moment | Duration | string[];
 
@@ -632,7 +632,7 @@ declare namespace moment {
 
   export function locale(language?: string): string;
   export function locale(language?: string[]): string;
-  export function locale(language?: string, definition?: LocaleSpecification | null | undefined): string;
+  export function locale(language?: string, definition?: LocaleSpecification | void): string; // null | undefined
 
   export function localeData(key?: string | string[]): Locale;
 
@@ -684,8 +684,8 @@ declare namespace moment {
    */
   export function now(): number;
 
-  export function defineLocale(language: string, localeSpec: LocaleSpecification | null): Locale;
-  export function updateLocale(language: string, localeSpec: LocaleSpecification | null): Locale;
+  export function defineLocale(language: string, localeSpec: LocaleSpecification | void): Locale; // null
+  export function updateLocale(language: string, localeSpec: LocaleSpecification | void): Locale; // null
 
   export function locales(): string[];