@@ -26,7 +26,7 @@ Also, when building a complex message object, you can make use of types for
2626its fields.
2727
2828``` typescript
29- const message: Line . TemplateMessage = {
29+ const message: TemplateMessage = {
3030 type: " template" ,
3131 altText: " cannot display template message" ,
3232 template: {
@@ -45,7 +45,7 @@ const message: Line.TemplateMessage = {
4545```
4646
4747The object above will be type-checked to have the type of
48- ` Line. TemplateMessage` , and thus ensured not to miss any required field.
48+ ` TemplateMessage ` , and thus ensured not to miss any required field.
4949
5050Also, [ literal type] ( https://www.typescriptlang.org/docs/handbook/advanced-types.html )
5151is used for ` type ` fields, which means the compiler will complain if a wrong
@@ -57,9 +57,21 @@ The library is built to just-work with TypeScript too, so import the library and
5757there you go.
5858
5959``` typescript
60- import { Client , validateSignature , middleware } from " @line/bot-sdk" ;
60+ import {
61+ // main APIs
62+ Client ,
63+ middleware ,
64+
65+ // exceptions
66+ JSONParseError ,
67+ SignatureValidationFailed ,
68+
69+ // types
70+ TemplateMessage ,
71+ WebhookEvent ,
72+ } from " @line/bot-sdk" ;
6173```
6274
63- Webhook event and message object types are defined in the ` Line ` namespace, e.g.
64- ` Line.WebhookEvent ` or ` Line.Message ` . For declarations of the types, please
65- refer to [ global.d. ts] ( https://github.com/line/line-bot-sdk-nodejs/blob/master/types/global.d .ts ) .
75+ Message object and webhook event types can be also imported from ` @line/bot-sdk ` ,
76+ e.g. ` TemplateMessage ` or ` WebhookEvent ` . For declarations of the types, please
77+ refer to [ types. ts] ( https://github.com/line/line-bot-sdk-nodejs/blob/master/lib/types .ts ) .
0 commit comments