Add types for serverless-jest-plugin. (#42412)

* Add types for lambda-wrapper.

* Add types for serverless-jest-plugin.
This commit is contained in:
Gaelan
2020-02-19 11:58:07 -08:00
committed by GitHub
parent 4104952eb9
commit 9cf554891c
4 changed files with 55 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for serverless-jest-plugin 0.3
// Project: https://github.com/nordcloud/serverless-jest-plugin#readme
// Definitions by: Gaelan Steele <https://github.com/Gaelan>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.3
import Serverless = require('serverless');
import Plugin = require('serverless/classes/Plugin');
import lw = require('lambda-wrapper');
export = ServerlessJestPlugin;
declare class ServerlessJestPlugin implements Plugin {
constructor(serverless: Serverless, options: Serverless.Options);
hooks: Plugin.Hooks;
commands: Plugin.Commands;
}
declare namespace ServerlessJestPlugin {
function getWrapper(modName: string, modPath: string, handler: string): lw.Wrapped<any, any>;
const lambdaWrapper: typeof lw;
}
@@ -0,0 +1,8 @@
import { lambdaWrapper, getWrapper } from 'serverless-jest-plugin';
let lambda = lambdaWrapper.wrap({
region: 'eu-west-1',
lambdaFunction: 'myFunctionName',
});
lambda = getWrapper('foo', 'foo/bar.js', 'fooHandler');
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"serverless-jest-plugin-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }