mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 20:21:46 +00:00
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:
Vendored
+4
-10
@@ -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';
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user