mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-12 08:05:12 +08:00
Merge pull request #22158 from BlueHatbRit/mock-aws-s3
Add mock-aws-s3 typings
This commit is contained in:
15
types/mock-aws-s3/index.d.ts
vendored
Normal file
15
types/mock-aws-s3/index.d.ts
vendored
Normal 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;
|
||||
16
types/mock-aws-s3/mock-aws-s3-tests.ts
Normal file
16
types/mock-aws-s3/mock-aws-s3-tests.ts
Normal 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) => {});
|
||||
}
|
||||
);
|
||||
6
types/mock-aws-s3/package.json
Normal file
6
types/mock-aws-s3/package.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"aws-sdk": ">=2.169.0"
|
||||
}
|
||||
}
|
||||
16
types/mock-aws-s3/tsconfig.json
Normal file
16
types/mock-aws-s3/tsconfig.json
Normal 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"]
|
||||
}
|
||||
3
types/mock-aws-s3/tslint.json
Normal file
3
types/mock-aws-s3/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user