mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 07:40:10 +00:00
Add type definitions for cfn-response package.
This commit is contained in:
12
types/cfn-response/cfn-response-tests.ts
Normal file
12
types/cfn-response/cfn-response-tests.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import * as cfn from "cfn-response";
|
||||
import { CloudFormationCustomResourceEvent, Context } from "aws-lambda";
|
||||
|
||||
declare const event: CloudFormationCustomResourceEvent;
|
||||
declare const context: Context;
|
||||
|
||||
// $ExpectType void
|
||||
cfn.send(event, context, cfn.SUCCESS, { sample: 123 }, "abc");
|
||||
// $ExpectType void
|
||||
cfn.send(event, context, "SUCCESS");
|
||||
// $ExpectError
|
||||
cfn.send(event, context, "", {});
|
||||
19
types/cfn-response/index.d.ts
vendored
Normal file
19
types/cfn-response/index.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// Type definitions for cfn-response 1.0
|
||||
// Project: https://github.com/LukeMizuhashi/cfn-response
|
||||
// Definitions by: Ivo Murrell <https://github.com/ivoisbelongtous>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { CloudFormationCustomResourceEvent, Context } from "aws-lambda";
|
||||
|
||||
export type ResponseStatus = "SUCCESS" | "FAILED";
|
||||
export const SUCCESS: ResponseStatus;
|
||||
export const FAILED: ResponseStatus;
|
||||
|
||||
export function send(
|
||||
event: CloudFormationCustomResourceEvent,
|
||||
context: Context,
|
||||
responseStatus: ResponseStatus,
|
||||
responseData?: object,
|
||||
physicalResourceId?: string
|
||||
): void;
|
||||
23
types/cfn-response/tsconfig.json
Normal file
23
types/cfn-response/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cfn-response-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/cfn-response/tslint.json
Normal file
1
types/cfn-response/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user