I have an environment with several constants globally:

```
TOP = 1
TOP_RIGHT = 2
RIGHT = 3
BOTTOM_RIGHT = 4
BOTTOM = 5
BOTTOM_LEFT = 6
LEFT = 7
TOP_LEFT = 8

```

---

It is clear to me that these 8 constants are not just arbitrary constants, but actually a set of directions. Therefore, I would like to have them be of the `DIRECTION` type, so that I can do things like this:

```
let test: DIRECTION = TOP_LEFT;

```

An `enum` type seems to be the most logical way of accomplishing this, but I encountered the following problem:

---

I attempted to implement this behavior previously, with some difficulty.

```
src/main.ts(1,23): error TS2304: Cannot find name 'TOP_LEFT'.

```

Typescript Files:

main.ts:

```
let test: DIRECTION = TOP_LEFT;
console.log(test);

```

direction.d.ts:

```
declare enum DIRECTION {
    TOP = 1,
    TOP_RIGHT = 2,
    RIGHT = 3,
    BOTTOM_RIGHT = 4,
    BOTTOM = 5,
    BOTTOM_LEFT = 6,
    LEFT = 7,
    TOP_LEFT = 8,
}

```

Ignoring the compile error, the JavaScript result of running "tsc" (a.k.a. the transpiled code) looks like it it will access the pre-defined global property:

```
let test = TOP_LEFT;
console.log(test);

```

How can I obtain such output in a TypeScript-friendly way?