diff --git a/moment-timezone/moment-timezone.d.ts b/moment-timezone/moment-timezone.d.ts index 85d5b4707..c1d7e2d23 100644 --- a/moment-timezone/moment-timezone.d.ts +++ b/moment-timezone/moment-timezone.d.ts @@ -35,22 +35,10 @@ interface MomentTimezone { (date: number, timezone: string): moment.Moment; (date: number[], timezone: string): moment.Moment; (date: string, timezone: string): moment.Moment; - (date: string, format: string, timezone: string): moment.Moment; - (date: string, format: string, strict: boolean, timezone: string): moment.Moment; - (date: string, format: string, language: string, timezone: string): moment.Moment; - (date: string, format: string, language: string, strict: boolean, timezone: string): moment.Moment; - (date: string, formats: string[], timezone: string): moment.Moment; - (date: string, formats: string[], strict: boolean, timezone: string): moment.Moment; - (date: string, formats: string[], language: string, timezone: string): moment.Moment; - (date: string, formats: string[], language: string, strict: boolean, timezone: string): moment.Moment; - (date: string, specialFormat: () => void, timezone: string): moment.Moment; - (date: string, specialFormat: () => void, strict: boolean, timezone: string): moment.Moment; - (date: string, specialFormat: () => void, language: string, timezone: string): moment.Moment; - (date: string, specialFormat: () => void, language: string, strict: boolean, timezone: string): moment.Moment; - (date: string, formatsIncludingSpecial: any[], timezone: string): moment.Moment; - (date: string, formatsIncludingSpecial: any[], strict: boolean, timezone: string): moment.Moment; - (date: string, formatsIncludingSpecial: any[], language: string, timezone: string): moment.Moment; - (date: string, formatsIncludingSpecial: any[], language: string, strict: boolean, timezone: string): moment.Moment; + (date: string, format: moment.MomentFormatSpecification, timezone: string): moment.Moment; + (date: string, format: moment.MomentFormatSpecification, strict: boolean, timezone: string): moment.Moment; + (date: string, format: moment.MomentFormatSpecification, language: string, timezone: string): moment.Moment; + (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; diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index 13959bbf8..5199a64a2 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -571,6 +571,12 @@ declare namespace moment { yy: any; } + interface MomentBuiltinFormat { + __momentBuiltinFormatBrand: any; + } + + type MomentFormatSpecification = string | MomentBuiltinFormat | (string | MomentBuiltinFormat)[]; + interface MomentStatic { version: string; fn: Moment; @@ -578,14 +584,8 @@ declare namespace moment { (): Moment; (date: number): Moment; (date: number[]): Moment; - (date: string, format?: string, strict?: boolean): Moment; - (date: string, format?: string, language?: string, strict?: boolean): Moment; - (date: string, formats: string[], strict?: boolean): Moment; - (date: string, formats: string[], language?: string, strict?: boolean): Moment; - (date: string, specialFormat: () => void, strict?: boolean): Moment; - (date: string, specialFormat: () => void, language?: string, strict?: boolean): Moment; - (date: string, formatsIncludingSpecial: any[], strict?: boolean): Moment; - (date: string, formatsIncludingSpecial: any[], language?: string, strict?: boolean): Moment; + (date: string, format?: MomentFormatSpecification, strict?: boolean): Moment; + (date: string, format?: MomentFormatSpecification, language?: string, strict?: boolean): Moment; (date: Date): Moment; (date: Moment): Moment; (date: Object): Moment; @@ -675,7 +675,7 @@ declare namespace moment { /** * Constant used to enable explicit ISO_8601 format parsing. */ - ISO_8601(): void; + ISO_8601: MomentBuiltinFormat; defaultFormat: string; }