mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Adding types for "hyper-aws4"
This commit is contained in:
parent
36a32d8a72
commit
dcda399637
12
types/hyper-aws4/hyper-aws4-tests.ts
Normal file
12
types/hyper-aws4/hyper-aws4-tests.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { sign, Request } from "hyper-aws4";
|
||||
|
||||
const signOption: Request = {
|
||||
url: "https://us-west-1.hyper.sh/version",
|
||||
method: "GET",
|
||||
credential: {
|
||||
accessKey: "6DPLADBPWYXDUVXLX34EJXBL",
|
||||
secretKey: "2ldD1Yz0nzATl9vvagBwYTjglXBjVOWU8gV8aMm5"
|
||||
}
|
||||
};
|
||||
|
||||
sign(signOption);
|
||||
25
types/hyper-aws4/index.d.ts
vendored
Normal file
25
types/hyper-aws4/index.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// Type definitions for hyper-aws4 1.1
|
||||
// Project: https://github.com/Tim-Zhang/hyper-aws4#readme
|
||||
// Definitions by: BamButz <https://github.com/bambutz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface Credentials {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
}
|
||||
|
||||
export interface Header {
|
||||
[header: string]: string;
|
||||
}
|
||||
|
||||
export type HttpMethods = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
||||
|
||||
export interface Request {
|
||||
url: string;
|
||||
method?: HttpMethods;
|
||||
body?: string;
|
||||
headers?: Header;
|
||||
credential?: Credentials;
|
||||
}
|
||||
|
||||
export function sign(request: Request, credential?: Credentials): Header;
|
||||
23
types/hyper-aws4/tsconfig.json
Normal file
23
types/hyper-aws4/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"hyper-aws4-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/hyper-aws4/tslint.json
Normal file
1
types/hyper-aws4/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user