Skip to content

Commit b59a955

Browse files
Merge pull request cerebral#216 from hipertracker/patch-7
Update 03_typescript.md
2 parents 25db3dc + 7a29c0c commit b59a955

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/overmind-website/guides/intermediate/03_typescript.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@ Overmind is written in Typescript and it is written with a focus on your keeping
99
The most straight forward way to type your application is to use the **declare module** approach. This will work for most applications, but might make you feel uncomfortable as a harcore Typescripter. The reason is that we are overriding an internal type, meaning that you can only have one instance of Overmind running inside your application.
1010

1111
```marksy
12-
h(Example, { name: "guide/typescript/declare.ts" })
12+
h(Example, { name: "guide/typescript/declare" })
1313
```
1414

1515
Now you can import any type directly from Overmind and it will understand the configuration of your application. Even the operators are typed.
1616

1717
```marksy
18-
h(Example, { name: "guide/typescript/declare_imports.ts" })
18+
h(Example, { name: "guide/typescript/declare_imports" })
1919
```
2020

2121
### 2. Explicit typing
2222
You can also explicitly type your application. This gives more flexibility.
2323

2424
```marksy
25-
h(Example, { name: "guide/typescript/explicit.ts" })
25+
h(Example, { name: "guide/typescript/explicit" })
2626
```
2727

2828
You only have to set up these types once, where you instantiate Overmind. That means if you use multiple namespaced configuration you still only create one set of types, as shown above.
2929

3030
Now you only have to make sure that you import your types from this file, instead of directly from the Overmind package.
3131

3232
```marksy
33-
h(Example, { name: "guide/typescript/explicit_import.ts" })
33+
h(Example, { name: "guide/typescript/explicit_import" })
3434
```
3535

3636
```marksy
@@ -46,7 +46,7 @@ When you are using TSLint it is important that you use the official [Microsoft E
4646
The action type takes either no arguments or a single argument. If you give no arguments to the action it will be typed as not expecting an argument at all. When you do type with an argument that is the type of the **value** on the context. This value is populated when you call the action on the Overmind instance.
4747

4848
```marksy
49-
h(Example, { name: "guide/typescript/action.ts" })
49+
h(Example, { name: "guide/typescript/action" })
5050
```
5151

5252

@@ -105,4 +105,4 @@ h(Example, { name: "guide/typescript/operatorinfer_solution" })
105105

106106

107107
#### Summary
108-
Typescript is not functional, it is object oriented and it is very difficult to make it work with this kind of APIs. We have high hopes though cause Typescript is evolving rapidly and Microsoft is dedicated to make this an awesome type system for JavaScript. If you got mad Typescript skills, please contact us to iterate on the type system and make this stuff work :-)
108+
Typescript is not functional, it is object oriented and it is very difficult to make it work with this kind of APIs. We have high hopes though cause Typescript is evolving rapidly and Microsoft is dedicated to make this an awesome type system for JavaScript. If you got mad Typescript skills, please contact us to iterate on the type system and make this stuff work :-)

0 commit comments

Comments
 (0)