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

Commit e8bcd2e

Browse files
authored
Make link to templates absolute
1 parent 31fff55 commit e8bcd2e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pages/declaration files/Library Structures.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Broadly speaking, the way you *structure* your declaration file depends on how t
44
There are many ways of offering a library for consumption in JavaScript, and you'll need to write your declaration file to match it.
55
This guide covers how to identify common library patterns, and how to write declaration files which correspond to that pattern.
66

7-
Each type of major library structuring pattern has a corresponding file in the [`templates`](./templates) directory.
7+
Each type of major library structuring pattern has a corresponding file in the [`templates`](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/declaration%20files/templates) directory.
88
You can start with these templates to help you get going faster.
99

1010
# Identifying Kinds of Libraries
@@ -76,7 +76,7 @@ However, libraries that are small and require the DOM (or have *no* dependencies
7676

7777
### Global Library Template
7878

79-
The template file [`global.d.ts`](./templates/global.d.ts) defines an example library `myLib`.
79+
The template file [`global.d.ts`](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/declaration%20files/templates/global.d.ts) defines an example library `myLib`.
8080
Be sure to read the ["Preventing Name Conflicts" footnote](#preventing-name-conflicts).
8181

8282
## Modular Libraries
@@ -176,9 +176,9 @@ Examples include [jQuery](https://jquery.com/), [Moment.js](http://momentjs.com/
176176
### Template
177177
178178
There are three templates available for modules,
179-
[`module.d.ts`](./templates/module.d.ts), [`module-class.d.ts`](./templates/module-class.d.ts) and [`module-function.d.ts`](./templates/module-function.d.ts).
179+
[`module.d.ts`](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/declaration%20files/templates/module.d.ts), [`module-class.d.ts`](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/declaration%20files/templates/module-class.d.ts) and [`module-function.d.ts`](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/declaration%20files/templates/module-function.d.ts).
180180

181-
Use [`module-function.d.ts`](./templates/module-function.d.ts) if your module can be *called* like a function:
181+
Use [`module-function.d.ts`](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/declaration%20files/templates/module-function.d.ts) if your module can be *called* like a function:
182182

183183
```ts
184184
var x = require("foo");
@@ -188,7 +188,7 @@ var y = x(42);
188188

189189
Be sure to read the [footnote "The Impact of ES6 on Module Call Signatures"](#the-impact-of-es6-on-module-plugins)
190190

191-
Use [`module-class.d.ts`](./templates/module-class.d.ts) if your module can be *constructed* using `new`:
191+
Use [`module-class.d.ts`](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/declaration%20files/templates/module-class.d.ts) if your module can be *constructed* using `new`:
192192

193193
```ts
194194
var x = require("bar");
@@ -198,7 +198,7 @@ var y = new x("hello");
198198

199199
The same [footnote](#the-impact-of-es6-on-module-plugins) applies to these modules.
200200

201-
If your module is not callable or constructable, use the [`module.d.ts`](./templates/module.d.ts) file.
201+
If your module is not callable or constructable, use the [`module.d.ts`](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/declaration%20files/templates/module.d.ts) file.
202202

203203
## *Module Plugin* or *UMD Plugin*
204204

@@ -209,7 +209,7 @@ For the purposes of writing a declaration file, you'll write the same code wheth
209209
210210
### Template
211211
212-
Use the [`module-plugin.d.ts`](./templates/module-plugin.d.ts) template.
212+
Use the [`module-plugin.d.ts`](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/declaration%20files/templates/module-plugin.d.ts) template.
213213
214214
## *Global Plugin*
215215
@@ -236,7 +236,7 @@ console.log(y.reverseAndSort());
236236

237237
### Template
238238

239-
Use the [`global-plugin.d.ts`](./templates/global-plugin.d.ts) template.
239+
Use the [`global-plugin.d.ts`](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/declaration%20files/templates/global-plugin.d.ts) template.
240240

241241
## *Global-modifying Modules*
242242

@@ -269,7 +269,7 @@ console.log(y.reverseAndSort());
269269
270270
### Template
271271
272-
Use the [`global-modifying-module.d.ts`](./templates/global-modifying-module.d.ts) template.
272+
Use the [`global-modifying-module.d.ts`](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/declaration%20files/templates/global-modifying-module.d.ts) template.
273273
274274
# Consuming Dependencies
275275

0 commit comments

Comments
 (0)