dagda1
dagda1

Reputation: 28790

how to include typescript module declarations

I have the following declarations:

declare var __DEV__: boolean;
declare var BROWSER: boolean;

If I have these in an index.d.ts file then how do I bring this into a project?

If I do this:

import '../../../../types/index.d.ts';

I get this error:

TypeScript declaration files should never be required

Upvotes: 0

Views: 200

Answers (1)

unional
unional

Reputation: 15589

Two ways, /// <reference path="..." /> or through tsconfig.json

{
  "files": [
    "..."
   ]
}

Upvotes: 1

Related Questions