mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 11:02:11 +08:00
Merge pull request #14277 from jacobbaskin/moment-round
Typings for moment-round
This commit is contained in:
16
moment-round/index.d.ts
vendored
Normal file
16
moment-round/index.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// Type definitions for moment-round 1.0
|
||||
// Project: https://github.com/WebDevTmas/moment-round
|
||||
// Definitions by: Jacob Baskin <https://github.com/jacobbaskin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as moment from 'moment';
|
||||
|
||||
export = moment;
|
||||
|
||||
declare module 'moment' {
|
||||
interface Moment {
|
||||
round(precision: number, key: string, direction?: 'round' | 'ceil' | 'floor'): Moment;
|
||||
ceil(precision: number, key: string): Moment;
|
||||
floor(precision: number, key: string): Moment;
|
||||
}
|
||||
}
|
||||
8
moment-round/moment-round-tests.ts
Normal file
8
moment-round/moment-round-tests.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import * as moment from 'moment';
|
||||
|
||||
var m = moment();
|
||||
m.round(5, 'seconds');
|
||||
m.ceil(3, 'minutes');
|
||||
m.floor(16, 'hours');
|
||||
m.ceil(21, 'hours');
|
||||
m.ceil(20, 'hours');
|
||||
5
moment-round/package.json
Normal file
5
moment-round/package.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
20
moment-round/tsconfig.json
Normal file
20
moment-round/tsconfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"moment-round-tests.ts"
|
||||
]
|
||||
}
|
||||
1
moment-round/tslint.json
Normal file
1
moment-round/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user