Add types for week module (#15148)

This commit is contained in:
Sindre Moen
2017-03-13 18:07:09 +01:00
committed by Mohamed Hegazy
parent b8207d7f73
commit aced389ca0
4 changed files with 39 additions and 0 deletions

8
week/index.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
// Type definitions for week 0.2
// Project: https://github.com/datetime/week
// Definitions by: Sindre Moen <https://github.com/sindrenm>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function week(date?: Date): string;
export = week;

22
week/tsconfig.json Normal file
View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"week-tests.ts"
]
}

3
week/tslint.json Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": "../tslint.json"
}

6
week/week-tests.ts Normal file
View File

@@ -0,0 +1,6 @@
import week = require('week');
let weekNumber: string;
weekNumber = week(new Date());
weekNumber = week();