Improved Serverless types

This commit is contained in:
Jonathan M. Wilbur
2019-02-16 05:46:29 -05:00
parent 419d4edf69
commit e80d3467c5
3 changed files with 23 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ declare class PluginManager {
loadServicePlugins(servicePlugins: {}): void;
loadCommand(pluginName: string, details: {}, key: string): {};
loadCommands(pluginInstance: Plugin): void;
spawn(commandsArray: string | string[], options?: any): Promise<void>;
cliOptions: {};
cliCommands: {};

View File

@@ -15,6 +15,11 @@ declare class Service {
};
name: string;
stage: string;
region: string;
runtime?: string;
timeout?: number;
versionFunctions: boolean;
};
constructor(serverless: Serverless, data: {});

View File

@@ -1,6 +1,7 @@
// Type definitions for serverless 1.18
// Project: https://github.com/serverless/serverless#readme
// Definitions by: Hassan Khan <https://github.com/hassankhan>
// Jonathan M. Wilbur <https://github.com/JonathanWilbur>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import Service = require("./classes/Service");
@@ -12,6 +13,9 @@ import AwsProvider = require("./plugins/aws/provider/awsProvider");
declare namespace Serverless {
interface Options {
function?: string;
watch?: boolean;
extraServicePath?: string;
stage: string | null;
region: string | null;
noDeploy?: boolean;
@@ -23,11 +27,24 @@ declare namespace Serverless {
interface FunctionDefinition {
name: string;
package: Package;
runtime?: string;
handler: string;
timeout?: number;
memorySize?: number;
environment?: { [ name: string ]: string };
}
interface Event {
eventName: string;
}
interface Package {
include: string[];
exclude: string[];
artifact?: string;
individually?: boolean;
}
}
declare class Serverless {