Skip to content

Commit

Permalink
Merge pull request #33114 from JonathanWilbur/master
Browse files Browse the repository at this point in the history
Improved types/serverless types
  • Loading branch information
gabritto committed Feb 20, 2019
2 parents 95686f7 + e80d346 commit 8346ac0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions types/serverless/classes/PluginManager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {};
Expand Down
5 changes: 5 additions & 0 deletions types/serverless/classes/Service.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ declare class Service {
};

name: string;
stage: string;
region: string;
runtime?: string;
timeout?: number;
versionFunctions: boolean;
};
constructor(serverless: Serverless, data: {});

Expand Down
17 changes: 17 additions & 0 deletions types/serverless/index.d.ts
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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;
Expand All @@ -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 {
Expand Down

0 comments on commit 8346ac0

Please sign in to comment.