---
title: "Declare Module for JavaScript Module in TypeScript"
date: 2022-08-18T23:16:46.000Z
author: Z.SHINCHVEN
tags: [TypeScript, JavaScript]
canonical: https://atlassc.net/2022/08/18/declare-module-for-javascript-module-in-typescript
---
Some JavaScript code doesn't come with type declarations.
In order to use them in TypeScript project, we can declare the `module` ourselves in a `<MODULE_NAME>.d.ts` file.

```TypeScript
declare module 'my-module' {
    export type MyType = string;
    const MyType: {
        show: () => void,
    }
    export default MyType;
}
```
