diff --git a/types/moment-duration-format/index.d.ts b/types/moment-duration-format/index.d.ts index eb81f2551a..34179e6dc4 100644 --- a/types/moment-duration-format/index.d.ts +++ b/types/moment-duration-format/index.d.ts @@ -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 +// Definitions by: Swint De Coninck , Niklas Walter // 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; } -} \ No newline at end of file + + interface DurationFormatSettings { + template: string; + precision: number; + trim: boolean; + forceLength: boolean; + } +} diff --git a/types/moment-duration-format/package.json b/types/moment-duration-format/package.json new file mode 100644 index 0000000000..4c6d24a445 --- /dev/null +++ b/types/moment-duration-format/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "moment": ">=2.14.0" + } +} \ No newline at end of file diff --git a/types/moment-duration-format/tslint.json b/types/moment-duration-format/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/types/moment-duration-format/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file