mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-10 04:00:10 +00:00
Merge branch 'master' of https://github.com/kingdango/DefinitelyTyped into momentjs-master
This commit is contained in:
100
moment/moment.d.ts
vendored
100
moment/moment.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for Moment.js 2.1.0
|
||||
// Type definitions for Moment.js 2.4.0
|
||||
// Project: https://github.com/timrwood/moment
|
||||
// Definitions by: Michael Lakerveld <https://github.com/Lakerfield>
|
||||
// 2.4.0 Aaron King <https://github.com/kingdango>
|
||||
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
@@ -165,6 +166,23 @@ interface Moment {
|
||||
lang(reset: boolean): void;
|
||||
lang(): string;
|
||||
|
||||
max(date: Date): Moment;
|
||||
max(date: number): Moment;
|
||||
max(date: Array): Moment;
|
||||
max(date: string): Moment;
|
||||
max(date: string, format: string): Moment;
|
||||
max(clone: Moment): Moment;
|
||||
|
||||
min(date: Date): Moment;
|
||||
min(date: number): Moment;
|
||||
min(date: Array): Moment;
|
||||
min(date: string): Moment;
|
||||
min(date: string, format: string): Moment;
|
||||
min(clone: Moment): Moment;
|
||||
|
||||
get(unit: string): number;
|
||||
set(unit: string, value: number): Moment;
|
||||
|
||||
}
|
||||
|
||||
interface MomentCalendar {
|
||||
@@ -229,12 +247,13 @@ interface MomentRelativeTime {
|
||||
interface MomentStatic {
|
||||
|
||||
(): Moment;
|
||||
(date: number): Moment;
|
||||
(date: string): Moment;
|
||||
(date: string, time: string): Moment;
|
||||
(date: Date): Moment;
|
||||
(date: string, formats: string[]): Moment;
|
||||
(date: number[]): Moment;
|
||||
(dateObject: Object, language?: string, strict?: boolean): Moment;
|
||||
(date: number, language?: string, strict?: boolean): Moment;
|
||||
(date: string, language?: string, strict?: boolean): Moment;
|
||||
(date: string, format: string, language?: string, strict?: boolean): Moment;
|
||||
(date: string, formats: string[], language?: string, strict?: boolean): Moment;
|
||||
(date: Date, language?: string, strict?: boolean): Moment;
|
||||
(date: number[], language?: string, strict?: boolean): Moment;
|
||||
(clone: Moment): Moment;
|
||||
|
||||
unix(timestamp: number): Moment;
|
||||
@@ -244,16 +263,13 @@ interface MomentStatic {
|
||||
utc(array: number[]): Moment; // parse an array of numbers matching Date.UTC() parameters
|
||||
utc(String: string): Moment; // parse string into UTC mode
|
||||
utc(String1: string, String2: string): Moment; // parse a string and format into UTC mode
|
||||
utc(date: Date): Moment;
|
||||
utc(clone: Moment): Moment;
|
||||
|
||||
isMoment(): boolean;
|
||||
isMoment(m: any): boolean;
|
||||
lang(language: string): any;
|
||||
lang(language: string, definition: MomentLanguage): any;
|
||||
months: string[];
|
||||
monthsShort: string[];
|
||||
weekdays: string[];
|
||||
weekdaysShort: string[];
|
||||
weekdaysMin: string[];
|
||||
longDateFormat: any;
|
||||
relativeTime: any;
|
||||
meridiem: (hour: number, minute: number, isLowercase: boolean) => string;
|
||||
@@ -265,39 +281,33 @@ interface MomentStatic {
|
||||
duration(input: MomentInput): Duration;
|
||||
duration(object: any): Duration;
|
||||
duration(): Duration;
|
||||
|
||||
isBefore(b: Moment): boolean;
|
||||
isBefore(b: string): boolean;
|
||||
isBefore(b: Number): boolean;
|
||||
isBefore(b: Date): boolean;
|
||||
isBefore(b: number[]): boolean;
|
||||
isBefore(b: Moment, granularity: string): boolean;
|
||||
isBefore(b: String, granularity: string): boolean;
|
||||
isBefore(b: Number, granularity: string): boolean;
|
||||
isBefore(b: Date, granularity: string): boolean;
|
||||
isBefore(b: number[], granularity: string): boolean;
|
||||
|
||||
isAfter(b: Moment): boolean;
|
||||
isAfter(b: string): boolean;
|
||||
isAfter(b: Number): boolean;
|
||||
isAfter(b: Date): boolean;
|
||||
isAfter(b: number[]): boolean;
|
||||
isAfter(b: Moment, granularity: string): boolean;
|
||||
isAfter(b: String, granularity: string): boolean;
|
||||
isAfter(b: Number, granularity: string): boolean;
|
||||
isAfter(b: Date, granularity: string): boolean;
|
||||
isAfter(b: number[], granularity: string): boolean;
|
||||
|
||||
isSame(b: Moment): boolean;
|
||||
isSame(b: string): boolean;
|
||||
isSame(b: Number): boolean;
|
||||
isSame(b: Date): boolean;
|
||||
isSame(b: number[]): boolean;
|
||||
isSame(b: Moment, granularity: string): boolean;
|
||||
isSame(b: String, granularity: string): boolean;
|
||||
isSame(b: Number, granularity: string): boolean;
|
||||
isSame(b: Date, granularity: string): boolean;
|
||||
isSame(b: number[], granularity: string): boolean;
|
||||
|
||||
parseZone(date: string): Moment;
|
||||
|
||||
months(): string[];
|
||||
months(index: number): string;
|
||||
months(format: string): string[];
|
||||
months(format: string, index: number): string;
|
||||
monthsShort(): string[];
|
||||
monthsShort(index: number): string;
|
||||
monthsShort(format: string): string[];
|
||||
monthsShort(format: string, index: number): string;
|
||||
weekdays(): string[];
|
||||
weekdays(index: number): string;
|
||||
weekdays(format: string): string[];
|
||||
weekdays(format: string, index: number): string;
|
||||
weekdaysShort(): string[];
|
||||
weekdaysShort(index: number): string;
|
||||
weekdaysShort(format: string): string[];
|
||||
weekdaysShort(format: string, index: number): string;
|
||||
weekdaysMin(): string[];
|
||||
weekdaysMin(index: number): string;
|
||||
weekdaysMin(format: string): string[];
|
||||
weekdaysMin(format: string, index: number): string;
|
||||
|
||||
normalizeUnits(unit: string): string;
|
||||
|
||||
invalid(parsingFlags?: Object): Moment;
|
||||
}
|
||||
|
||||
declare var moment: MomentStatic;
|
||||
|
||||
Reference in New Issue
Block a user