Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Add documentation for shorthand ambient modules #317

Merged
2 commits merged into from
Jun 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions pages/Modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,23 @@ import * as URL from "url";
let myUrl = URL.parse("http://www.typescriptlang.org");
```

### Shorthand ambient modules

If you don't want to take the time to write out declarations before using a new module, you can use a shorthand declaration to get started quickly.

##### declarations.d.ts

```ts
declare module "hot-new-module";
```

All imports from a shorthand module will have the `any` type.

```ts
import x, {y} from "hot-new-module";
x(y);
```

# Guidance for structuring modules

## Export as close to top-level as possible
Expand Down