File tree 2 files changed +21
-3
lines changed
packages/serverless-runtime-types
2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,19 @@ If you want to use the types in JavaScript to get autocomplete in VS Code and
30
30
other editors using the TypeScript language server:
31
31
32
32
``` js
33
- // / <reference path="../node_modules/@twilio-labs/serverless-runtime-types/index.d.ts"/>
34
-
35
- exports .handler = function (context , event , callback ) {
33
+ // / <reference path="../../node_modules/@twilio-labs/serverless-runtime-types/index.d.ts"/>
34
+
35
+ /**
36
+ * @param {import('@twilio-labs/serverless-runtime-types').Context} context
37
+ * @param {{}} event
38
+ * @param {import('@twilio-labs/serverless-runtime-types').ServerlessCallback} callback
39
+ */
40
+ exports .handler = function (context , event , callback ) {
36
41
let twiml = new Twilio.twiml.MessagingResponse ();
37
42
twiml .message (' Hello World' );
38
43
callback (null , twiml);
39
44
};
45
+
40
46
```
41
47
42
48
### In TypeScript
Original file line number Diff line number Diff line change
1
+ /// <reference path="../../node_modules/@twilio-labs/serverless-runtime-types/index.d.ts"/>
2
+
3
+ /**
4
+ * @param {import('@twilio-labs/serverless-runtime-types').Context } context
5
+ * @param {{} } event
6
+ * @param {import('@twilio-labs/serverless-runtime-types').ServerlessCallback } callback
7
+ */
8
+ exports . handler = function ( context , event , callback ) {
9
+ let twiml = new Twilio . twiml . MessagingResponse ( ) ;
10
+ twiml . message ( 'Hello World' ) ;
11
+ callback ( null , twiml ) ;
12
+ } ;
You can’t perform that action at this time.
0 commit comments