tony
tony

Reputation: 2392

Basic Typescript, external define

I have an object that is defined in an external JavaScript file

CompanyName.TypeB.SomeDate = new Date('...')

And just to make things more awkward CompanyName is also defined as a module in one of the typescript files.

module CompanyName
{
}

How can I access this javascript in typescript? I've tried some combinations of module and declare but I just don't know typescript well enough yet

Thanks

Upvotes: 1

Views: 85

Answers (1)

tony
tony

Reputation: 2392

Found it, courtesy of

https://www.stevefenton.co.uk/Content/Blog/Date/201301/Blog/Complex-TypeScript-Definitions-Made-Easy/

declare module CompanyName
{
    export class TypeB
    {
        static SomeData: Date;
    }
}

Upvotes: 2

Related Questions