1- // Type definitions for moment-timezone.js 0.5
1+ // Type definitions for moment-timezone.js
22// Project: http://momentjs.com/timezone/
33// Definitions by: Michel Salib <https://github.com/michelsalib>
44// Alan Brazil Lins <https://github.com/alanblins>
55// Agustin Carrasco <https://github.com/asermax>
66// Borys Kupar <https://github.com/borys-kupar>
77// Anthony Rainer <https://github.com/pristinesource>
8- // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
9- // Migrated here from DefinitelyTyped in release moment-timezone@0.5.30
8+ // Original source: https://github.com/DefinitelyTyped/DefinitelyTyped
9+ // Migrated here from DefinitelyTyped in release moment-timezone@0.5.30,
10+ // then maintained by the Moment team
1011
1112import moment = require( 'moment' ) ;
1213
1314declare module 'moment' {
15+ /** Parsed / unpacked zone data. */
16+ interface UnpackedZone {
17+ name : string ;
18+ abbrs : string [ ] ;
19+ untils : number [ ] ;
20+ offsets : number [ ] ;
21+ population ?: number ;
22+ }
23+
1424 interface MomentZone {
1525 name : string ;
1626 abbrs : string [ ] ;
@@ -19,9 +29,13 @@ declare module 'moment' {
1929 population : number ;
2030
2131 abbr ( timestamp : number ) : string ;
32+ /**
33+ * @deprecated use `.utcOffset()`
34+ */
2235 offset ( timestamp : number ) : number ;
2336 utcOffset ( timestamp : number ) : number ;
2437 parse ( timestamp : number ) : number ;
38+ countries ( ) : string [ ] ;
2539 }
2640
2741 interface MomentZoneOffset {
@@ -32,26 +46,27 @@ declare module 'moment' {
3246 interface MomentTimezone {
3347 ( ) : moment . Moment ;
3448 ( timezone : string ) : moment . Moment ;
35- ( date : number , timezone : string ) : moment . Moment ;
36- ( date : number [ ] , timezone : string ) : moment . Moment ;
37- ( date : string , timezone : string ) : moment . Moment ;
49+ ( date : moment . MomentInput , timezone : string ) : moment . Moment ;
3850 ( date : string , format : moment . MomentFormatSpecification , timezone : string ) : moment . Moment ;
3951 ( date : string , format : moment . MomentFormatSpecification , strict : boolean , timezone : string ) : moment . Moment ;
4052 ( date : string , format : moment . MomentFormatSpecification , language : string , timezone : string ) : moment . Moment ;
4153 ( date : string , format : moment . MomentFormatSpecification , language : string , strict : boolean , timezone : string ) : moment . Moment ;
42- ( date : Date , timezone : string ) : moment . Moment ;
43- ( date : moment . Moment , timezone : string ) : moment . Moment ;
44- ( date : any , timezone : string ) : moment . Moment ;
54+
55+ version : string ;
56+ dataVersion : string ;
57+ moveInvalidForward : boolean ;
58+ moveAmbiguousForward : boolean ;
4559
4660 zone ( timezone : string ) : MomentZone | null ;
61+ Zone ( packedZoneString ?: string ) : MomentZone ;
4762
4863 add ( packedZoneString : string ) : void ;
4964 add ( packedZoneString : string [ ] ) : void ;
5065
5166 link ( packedLinkString : string ) : void ;
5267 link ( packedLinkString : string [ ] ) : void ;
5368
54- load ( data : { version : string ; links : string [ ] ; zones : string [ ] } ) : void ;
69+ load ( data : { version : string ; links : string [ ] ; zones : string [ ] ; countries ?: string [ ] } ) : void ;
5570
5671 names ( ) : string [ ] ;
5772 zonesForCountry < T extends true > ( country : string , with_offset : T ) : T extends true ? MomentZoneOffset [ ] : never ;
@@ -60,8 +75,10 @@ declare module 'moment' {
6075 countries ( ) : string [ ] ;
6176 guess ( ignoreCache ?: boolean ) : string ;
6277
63- setDefault ( timezone ?: string ) : Moment ;
64- dataVersion : string ;
78+ setDefault ( timezone ?: string ) : typeof moment ;
79+
80+ unpack ( packedZoneString : string ) : UnpackedZone ;
81+ unpackBase60 ( packedString : string ) : number ;
6582 }
6683
6784 interface Moment {
0 commit comments