@types/globalize package and had problems.Definitions by: in index.d.ts) so they can respond.In the Globalize documentation, there is
var Globalize = require( "globalize" );
but when I try to do
import * as Globalize from "globalize";
// OR
import Globalize = require("globalize");
I have the error : @types/globalize/index.d.ts is not a module.
But if I ignore the error, it works in runtime.
Here's what to do:
declare var Globalize: GlobalizeStatic;.declare namespace globalize {
interface DateFormatterOptions { ... }
...other interfaces...
}
/// <reference types="cldrjs" /> and use:declare var globalize: globalize.Static;
export as namespace Globalize;
export = globalize;
You should now be able to import Globalize = require("globalize");.
Also, could you fix the tests? Apparently they were commented out in #4872. No idea what they should be like now since they don't work any more.
Just ran into this
me too, can someone fix this in the npm package?
+1
Most helpful comment
Here's what to do:
declare var Globalize: GlobalizeStatic;./// <reference types="cldrjs" />and use:You should now be able to
import Globalize = require("globalize");.Also, could you fix the tests? Apparently they were commented out in #4872. No idea what they should be like now since they don't work any more.