mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
Added typings for the http-aws-es package.
This commit is contained in:
42
types/http-aws-es/http-aws-es-tests.ts
Normal file
42
types/http-aws-es/http-aws-es-tests.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { EnvironmentCredentials } from "aws-sdk/lib/core";
|
||||
import { Client } from "elasticsearch";
|
||||
import HttpAmazonESConnector = require("http-aws-es");
|
||||
|
||||
new Client({
|
||||
amazonES: {
|
||||
accessKey: "AKID",
|
||||
region: "us-east-1",
|
||||
secretKey: "secret",
|
||||
},
|
||||
connectionClass: HttpAmazonESConnector,
|
||||
host: "https://amazon-es-host.us-east-1.es.amazonaws.com",
|
||||
});
|
||||
|
||||
new Client({
|
||||
amazonES: {
|
||||
accessKey: "AKID",
|
||||
region: "us-east-1",
|
||||
secretKey: "secret",
|
||||
},
|
||||
connectionClass: require("http-aws-es"),
|
||||
host: "https://amazon-es-host.us-east-1.es.amazonaws.com",
|
||||
});
|
||||
|
||||
const myCredentials = new EnvironmentCredentials("AWS");
|
||||
new Client({
|
||||
amazonES: {
|
||||
credentials: myCredentials,
|
||||
region: "us-east-1",
|
||||
},
|
||||
connectionClass: HttpAmazonESConnector,
|
||||
host: "https://amazon-es-host.us-east-1.es.amazonaws.com",
|
||||
});
|
||||
|
||||
new Client({
|
||||
amazonES: {
|
||||
credentials: myCredentials,
|
||||
region: "us-east-1",
|
||||
},
|
||||
connectionClass: require("http-aws-es"),
|
||||
host: "https://amazon-es-host.us-east-1.es.amazonaws.com",
|
||||
});
|
||||
25
types/http-aws-es/index.d.ts
vendored
Normal file
25
types/http-aws-es/index.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// Type definitions for http-aws-es 1.1
|
||||
// Project: https://github.com/TheDeveloper/http-aws-es#readme
|
||||
// Definitions by: Marco Gonzalez <https://github.com/marcogrcr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as e from "elasticsearch";
|
||||
import { Credentials } from "aws-sdk/lib/core";
|
||||
|
||||
declare module "elasticsearch" {
|
||||
interface AmazonESOptions {
|
||||
accessKey?: string;
|
||||
credentials?: Credentials;
|
||||
region: string;
|
||||
secretKey?: string;
|
||||
}
|
||||
|
||||
interface ConfigOptions {
|
||||
amazonES?: AmazonESOptions;
|
||||
}
|
||||
}
|
||||
|
||||
declare const HttpAmazonESConnector: any;
|
||||
export = HttpAmazonESConnector;
|
||||
5
types/http-aws-es/package.json
Normal file
5
types/http-aws-es/package.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"aws-sdk": "^2.7.0"
|
||||
}
|
||||
}
|
||||
22
types/http-aws-es/tsconfig.json
Normal file
22
types/http-aws-es/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"http-aws-es-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/http-aws-es/tslint.json
Normal file
1
types/http-aws-es/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user