mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Add types for serverless-jest-plugin. (#42412)
* Add types for lambda-wrapper. * Add types for serverless-jest-plugin.
This commit is contained in:
+23
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user