File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,24 @@ declare namespace Serverless {
4646 individually ?: boolean
4747 }
4848
49+ type CommandsDefinition = Record <
50+ string ,
51+ {
52+ lifecycleEvents ?: string [ ]
53+ commands ?: CommandsDefinition
54+ usage ?: string
55+ options ?: {
56+ [ name : string ] : {
57+ type : string
58+ usage : string
59+ required ?: boolean
60+ shortcut ?: string
61+ }
62+ }
63+ }
64+ >
65+
4966 interface PluginManager {
5067 spawn ( command : string ) : Promise < void >
5168 }
52- }
69+ }
Original file line number Diff line number Diff line change @@ -16,11 +16,27 @@ export class TypeScriptPlugin {
1616 serverless : Serverless . Instance
1717 options : Serverless . Options
1818 hooks : { [ key : string ] : Function }
19+ commands : Serverless . CommandsDefinition
1920
2021 constructor ( serverless : Serverless . Instance , options : Serverless . Options ) {
2122 this . serverless = serverless
2223 this . options = options
2324
25+ this . commands = {
26+ invoke : {
27+ commands : {
28+ local : {
29+ options : {
30+ watch : {
31+ type : 'boolean' ,
32+ usage : 'Watch file changes and re-invoke automatically the function'
33+ }
34+ }
35+ }
36+ }
37+ }
38+ }
39+
2440 this . hooks = {
2541 'before:run:run' : async ( ) => {
2642 await this . compileTs ( )
You can’t perform that action at this time.
0 commit comments