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

Dts writing#335

Merged
mhegazy merged 30 commits intorelease-2.0from
dtsWriting
Jul 8, 2016
Merged

Dts writing#335
mhegazy merged 30 commits intorelease-2.0from
dtsWriting

Conversation

@mhegazy
Copy link
Copy Markdown
Contributor

@mhegazy mhegazy commented Jul 4, 2016

Adding @RyanCavanaugh's documentation for writing declaration files.

@@ -1,268 +0,0 @@
# Introduction
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There needs to be some sort of redirect here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

You can also created nested namespaces in one declaration:

```ts
declare namespace GreetingLib.Options {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this was an anti-pattern.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

the [Deep Dive](./Deep Dive.md) section explains many advanced concepts in declaration writing,
and shows how to leverage these concepts to create cleaner and more intuitive declaration files.

## `/templates`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this even going to work on the website?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added a task to copy the templates.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the folder link does not seem to work now that you mention it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should remove it.


```ts
export var SomeVar: { a: SomeType };
export interface SomeVar {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be export interface SomeType, isn't it?


Please post a comment [here](https://github.com/Microsoft/TypeScript-Handbook/issues) if there's a pattern you'd like to see documented!
We'll add to this as we can.
> ## This page moved to [Publishing](./declaration files/Introduction.md) No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has been moved to

@DanielRosenwasser
Copy link
Copy Markdown
Member

Seems decent 👍

@mhegazy mhegazy merged commit 48f5296 into release-2.0 Jul 8, 2016
@mhegazy mhegazy deleted the dtsWriting branch July 8, 2016 21:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants