[leap-year] Add types

This commit is contained in:
Dimitri Benin 2018-12-15 21:33:20 +01:00
parent 39b514a4bb
commit ffbd3a9a55
4 changed files with 40 additions and 0 deletions

8
types/leap-year/index.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
// Type definitions for leap-year 2.0
// Project: https://github.com/sindresorhus/leap-year#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = leapYear;
declare function leapYear(year?: number | Date): boolean;

View File

@ -0,0 +1,8 @@
import leapYear = require('leap-year');
// $ExpectType boolean
leapYear();
// $ExpectType boolean
leapYear(2016);
// $ExpectType boolean
leapYear(new Date());

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",
"leap-year-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }