Merge pull request #22158 from BlueHatbRit/mock-aws-s3

Add mock-aws-s3 typings
This commit is contained in:
Mine Starks
2017-12-13 10:27:59 -08:00
committed by GitHub
5 changed files with 56 additions and 0 deletions

15
types/mock-aws-s3/index.d.ts vendored Normal file
View File

@@ -0,0 +1,15 @@
// Type definitions for mock-aws-s3 2.6
// Project: https://github.com/MathieuLoutre/mock-aws-s3
// Definitions by: Elliot Blackburn <https://github.com/bluehatbrit>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mock-aws-s3
// TypeScript Version: 2.2
// This is a mocking library, types should reflect that of the actual library.
export * from "aws-sdk";
import { GlobalConfigInstance } from "aws-sdk/lib/config";
export interface MockConfigInstance extends GlobalConfigInstance {
basePath: string;
}
export let config: MockConfigInstance;

View File

@@ -0,0 +1,16 @@
import * as MockAWS from "mock-aws-s3";
const s3 = new MockAWS.S3({
params: { Bucket: "example" }
});
s3.putObject(
{
Bucket: "example",
Key: "sea/animal.json",
Body: '{"is dog":false,"name":"otter","stringified object?":true}'
},
(err: MockAWS.AWSError, data: MockAWS.S3.Types.PutObjectOutput) => {
s3.listObjects({ Bucket: 'example', Prefix: "sea" }, (err: any, data: any) => {});
}
);

View File

@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"aws-sdk": ">=2.169.0"
}
}

View File

@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "mock-aws-s3-tests.ts"]
}

View File

@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}