You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// global.d.ts
declare module 'foo' {
// Some variable declarations
export var bar: number; /*sample*/
}
and
// anyOtherTsFileInYourProject.ts
import * as foo from 'foo';
// TypeScript assumes (without doing any lookup) that
// foo is {bar:number}
I can't achieve to make this work. I'm not quite sure this is a typo or something else or I don't understand the concept very well as a learner. But if I define the module like that, I can make it work:
declare module "foo" {
// Some variable declarations
export type bar = number; /*sample*/
}
The text was updated successfully, but these errors were encountered:
The section where the global module declaration explained there is an example like that:
and
I can't achieve to make this work. I'm not quite sure this is a typo or something else or I don't understand the concept very well as a learner. But if I define the module like that, I can make it work:
The text was updated successfully, but these errors were encountered: