Improve jstimezonedetect types

* Global is named `jstz`, not `jstimezonedetect`
* Use `export function` syntax rather than exporting an object with properties
This commit is contained in:
Andy Hanson
2016-11-07 10:10:00 -08:00
parent ba5d738c52
commit 1510f150cf
3 changed files with 23 additions and 12 deletions
+4 -10
View File
@@ -1,16 +1,10 @@
// Type definitions for jsTimezoneDetect
// Type definitions for jsTimezoneDetect 1.0
// Project: https://bitbucket.org/pellepim/jstimezonedetect
// Definitions by: Olivier Lamothe <https://github.com/olamothe/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface JsTimezoneDetect {
determine: ()=> {
name: ()=> string;
}
export function determine(): {
name(): string;
}
declare var jstimezonedetect: JsTimezoneDetect;
declare module "jstimezonedetect" {
export = jstimezonedetect;
}
export as namespace jstz;
@@ -1,5 +1,3 @@
/// <reference path="jstimezonedetect.d.ts" />
import * as jstz from 'jstimezonedetect';
jstz.determine().name() === 'America/Montreal';
+19
View File
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"jstimezonedetect-tests.ts"
]
}