Merge pull request #31431 from BendingBender/year-days

[year-days] Add types
This commit is contained in:
Nathan Shively-Sanders
2018-12-17 09:37:46 -08:00
committed by GitHub
4 changed files with 40 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for year-days 2.0
// Project: https://github.com/sindresorhus/year-days#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = yearDays;
declare function yearDays(year?: number | Date): number;
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"year-days-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+8
View File
@@ -0,0 +1,8 @@
import yearDays = require('year-days');
// $ExpectType number
yearDays();
// $ExpectType number
yearDays(2016);
// $ExpectType number
yearDays(new Date());