1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | import Service = require('./classes/Service');
|
16 | import PluginManager = require('./classes/PluginManager');
|
17 | import Utils = require('./classes/Utils');
|
18 | import YamlParser = require('./classes/YamlParser');
|
19 | import AwsProvider = require('./plugins/aws/provider/awsProvider');
|
20 |
|
21 | declare namespace Serverless {
|
22 | interface Options {
|
23 | function?: string | undefined;
|
24 | watch?: boolean | undefined;
|
25 | verbose?: boolean | undefined;
|
26 | extraServicePath?: string | undefined;
|
27 | stage: string | null;
|
28 | region: string | null;
|
29 | noDeploy?: boolean | undefined;
|
30 | }
|
31 |
|
32 | interface Config {
|
33 | servicePath: string;
|
34 | }
|
35 |
|
36 | interface FunctionDefinition {
|
37 | name?: string | undefined;
|
38 | package?: Package | undefined;
|
39 | reservedConcurrency?: number | undefined;
|
40 | runtime?: string | undefined;
|
41 | timeout?: number | undefined;
|
42 | memorySize?: number | undefined;
|
43 | environment?: { [name: string]: string } | undefined;
|
44 | events: AwsProvider.Event[];
|
45 | tags?: { [key: string]: string } | undefined;
|
46 | }
|
47 |
|
48 | interface LogOptions {
|
49 | color?: string | undefined;
|
50 | bold?: boolean | undefined;
|
51 | underline?: boolean | undefined;
|
52 | entity?: string | undefined;
|
53 | }
|
54 |
|
55 | interface FunctionDefinitionHandler extends FunctionDefinition {
|
56 | handler: string;
|
57 | }
|
58 |
|
59 | interface FunctionDefinitionImage extends FunctionDefinition {
|
60 | image: string;
|
61 | }
|
62 |
|
63 | interface Package {
|
64 |
|
65 | include?: string[] | undefined;
|
66 |
|
67 | exclude?: string[] | undefined;
|
68 | patterns?: string[] | undefined;
|
69 | artifact?: string | undefined;
|
70 | individually?: boolean | undefined;
|
71 | }
|
72 |
|
73 | type Event = AwsProvider.Event | object;
|
74 | }
|
75 |
|
76 | declare class Serverless {
|
77 | constructor(config?: {});
|
78 |
|
79 | init(): Promise<any>;
|
80 | run(): Promise<any>;
|
81 |
|
82 | setProvider(name: string, provider: AwsProvider): null;
|
83 | getProvider(name: string): AwsProvider;
|
84 |
|
85 | getVersion(): string;
|
86 |
|
87 | cli: {
|
88 | |
89 |
|
90 |
|
91 | log(message: string, entity?: string, options?: Serverless.LogOptions): null;
|
92 | };
|
93 |
|
94 | providers: {};
|
95 | utils: Utils;
|
96 | variables: {
|
97 | populateService(): Promise<any>;
|
98 | };
|
99 | yamlParser: YamlParser;
|
100 | pluginManager: PluginManager;
|
101 |
|
102 | config: Serverless.Config;
|
103 | serverlessDirPath: string;
|
104 |
|
105 | service: Service;
|
106 | version: string;
|
107 |
|
108 | resources: AwsProvider.Resources;
|
109 |
|
110 | configSchemaHandler: {
|
111 | defineCustomProperties(schema: unknown): void;
|
112 | defineFunctionEvent(provider: string, event: string, schema: Record<string, unknown>): void;
|
113 | defineFunctionEventProperties(provider: string, existingEvent: string, schema: unknown): void;
|
114 | defineFunctionProperties(provider: string, schema: unknown): void;
|
115 | defineProvider(provider: string, options?: Record<string, unknown>): void;
|
116 | defineTopLevelProperty(provider: string, schema: Record<string, unknown>): void;
|
117 | };
|
118 | }
|
119 |
|
120 | export = Serverless;
|