From b8610fa972b0b73c72025a1389b7a13da2d0bcb4 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Fri, 30 Dec 2016 15:21:58 -0800 Subject: [PATCH] moment-timezone: Move all types into augmentation --- moment-timezone/index.d.ts | 15 ++++++--------- moment-timezone/tslint.json | 6 ++++++ 2 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 moment-timezone/tslint.json diff --git a/moment-timezone/index.d.ts b/moment-timezone/index.d.ts index 991af87fea..49c068a211 100644 --- a/moment-timezone/index.d.ts +++ b/moment-timezone/index.d.ts @@ -1,14 +1,14 @@ -// Type definitions for moment-timezone.js 0.2.5 +// Type definitions for moment-timezone.js 0.2 // Project: http://momentjs.com/timezone/ // Definitions by: Michel Salib // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as moment from 'moment'; -export as namespace MomentTimezone; +// require("moment-timezone") === require("moment") export = moment; -declare namespace MomentTimezone { +declare module "moment" { interface MomentZone { name: string; abbrs: string[]; @@ -17,7 +17,7 @@ declare namespace MomentTimezone { abbr(timestamp: number): string; offset(timestamp: number): number; - parse(timestamp: number): number + parse(timestamp: number): number; } interface MomentTimezone { @@ -32,7 +32,7 @@ declare namespace MomentTimezone { (date: string, format: moment.MomentFormatSpecification, language: string, strict: boolean, timezone: string): moment.Moment; (date: Date, timezone: string): moment.Moment; (date: moment.Moment, timezone: string): moment.Moment; - (date: Object, timezone: string): moment.Moment; + (date: any, timezone: string): moment.Moment; zone(timezone: string): MomentZone; @@ -54,9 +54,6 @@ declare namespace MomentTimezone { setDefault(timezone: string): void; } -} - -declare module "moment" { interface Moment { tz(): string; tz(timezone: string): Moment; @@ -64,5 +61,5 @@ declare module "moment" { zoneName(): string; } - const tz: MomentTimezone.MomentTimezone; + const tz: MomentTimezone; } diff --git a/moment-timezone/tslint.json b/moment-timezone/tslint.json new file mode 100644 index 0000000000..012ccb0889 --- /dev/null +++ b/moment-timezone/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "unified-signatures": false + } +} \ No newline at end of file