Skip to content

Commit 98fc424

Browse files
author
Hyunje Jun
committed
Update docs to cover literal type
1 parent 21e475a commit 98fc424

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/pages/guide/typescript.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ const message: Line.TemplateMessage = {
4747
The object above will be type-checked to have the type of
4848
`Line.TemplateMessage`, and thus ensured not to miss any required field.
4949

50+
Also, [literal type](https://www.typescriptlang.org/docs/handbook/advanced-types.html)
51+
is used for `type` fields, which means the compiler will complain if a wrong
52+
type string is used, and also inference the type of objects by its `type` field.
53+
5054
## How to use
5155

5256
The library is built to just-work with TypeScript too, so import the library and

0 commit comments

Comments
 (0)