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

Document UMD module definitions #322

Merged
1 commit 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
13 changes: 6 additions & 7 deletions pages/Writing Declaration Files.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ declare var widget: WidgetFactory;

## Global / External-agnostic Libraries

These libraries can be used as either globals or imports.
In a module file (one with any imports/exports), using these as globals is not allowed.
These are also known as [UMD](https://github.com/umdjs/umd) modules.

#### Usage

```ts
Expand All @@ -187,13 +191,8 @@ zoo.open();
#### Typing

```ts
declare namespace zoo {
function open(): void;
}

declare module "zoo" {
export = zoo;
}
export function open(): void;
export as namespace zoo;
```

## Single Complex Object in Modules
Expand Down