Merge pull request #15746 from TwoStone/moment-duration-fix

Fix and extend moment-duration-format types
This commit is contained in:
Yui
2017-04-13 09:16:58 -07:00
committed by GitHub
3 changed files with 19 additions and 5 deletions
+13 -5
View File
@@ -1,11 +1,19 @@
// Type definitions for moment-duration-format v1.3.0
// Type definitions for moment-duration-format 1.3
// Project: https://github.com/jsmreese/moment-duration-format
// Definitions by: Swint De Coninck <https://github.com/SwintDC>
// Definitions by: Swint De Coninck <https://github.com/SwintDC>, Niklas Walter <https://github.com/TwoStone>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as moment from "moment";
declare namespace moment {
declare module "moment" {
interface Duration {
format(template: string, precision?: string, settings?: any): string;
format(template: string, precision?: number, settings?: DurationFormatSettings): string;
}
}
interface DurationFormatSettings {
template: string;
precision: number;
trim: boolean;
forceLength: boolean;
}
}
@@ -0,0 +1,5 @@
{
"dependencies": {
"moment": ">=2.14.0"
}
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "../tslint.json" }