File tree 2 files changed +26
-3
lines changed
packages/serverless-runtime-types
2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 1
- import { RuntimeInstance , TwilioResponse , GlobalTwilio } from './types' ;
1
+ import * as twilio from 'twilio' ;
2
+ import {
3
+ GlobalTwilio ,
4
+ ResourceMap ,
5
+ ResponseConstructor ,
6
+ RuntimeInstance ,
7
+ } from './types' ;
2
8
3
9
declare global {
4
10
var Twilio : GlobalTwilio ;
5
11
var Runtime : RuntimeInstance ;
12
+ var Functions : ResourceMap ;
13
+ var twilioClient : null | twilio . Twilio ;
6
14
7
15
namespace NodeJS {
8
16
interface Global {
9
17
Twilio : GlobalTwilio ;
10
18
Runtime : RuntimeInstance ;
19
+ Functions : ResourceMap ;
20
+ Response : ResponseConstructor ;
21
+ twilioClient : null | twilio . Twilio ;
11
22
}
12
23
}
13
24
}
Original file line number Diff line number Diff line change 1
1
import * as twilio from 'twilio' ;
2
2
import { ServiceContext } from 'twilio/lib/rest/sync/v1/service' ;
3
+ import { TwilioClientOptions } from 'twilio/lib/rest/Twilio' ;
3
4
4
5
export type EnvironmentVariables = {
5
6
[ key : string ] : string | undefined ;
@@ -11,17 +12,28 @@ export type ResourceMap = {
11
12
} ;
12
13
} ;
13
14
15
+ export type AssetResourceMap = {
16
+ [ name : string ] : {
17
+ path : string ;
18
+ open ( ) : string ;
19
+ } ;
20
+ } ;
21
+
14
22
export interface TwilioResponse {
15
23
setStatusCode ( code : number ) : void ;
16
24
setBody ( body : string | object ) : void ;
17
25
appendHeader ( key : string , value : string ) : void ;
18
26
setHeaders ( headers : { [ key : string ] : string } ) : void ;
19
27
}
20
28
29
+ export type RuntimeSyncClientOptions = TwilioClientOptions & {
30
+ serviceName ?: string ;
31
+ } ;
32
+
21
33
export type RuntimeInstance = {
22
- getAssets ( ) : ResourceMap ;
34
+ getAssets ( ) : AssetResourceMap ;
23
35
getFunctions ( ) : ResourceMap ;
24
- getSync ( config ?: { serviceName : string } ) : ServiceContext ;
36
+ getSync ( options ?: RuntimeSyncClientOptions ) : ServiceContext ;
25
37
} ;
26
38
27
39
export type Context < T = { } > = {
You can’t perform that action at this time.
0 commit comments