Skip to content

Commit 28711ac

Browse files
CasperEnglddo
authored andcommitted
Added types for BodyHashFunction and HashFunction (#77)
My Vue with TypeScript application was throwing an error that `base_string` and `key` in the functions in question were being set implicitly to type `any`.
1 parent f17493b commit 28711ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

oauth-1.0a.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ declare namespace OAuth {
114114
* Note: the key is used for implementation HMAC algorithms for the body hash,
115115
* but typically it should return SHA1 hash of base_string.
116116
*/
117-
export type BodyHashFunction = (base_string, key) => string;
117+
export type BodyHashFunction = (base_string: string, key: string) => string;
118118

119119
/**
120120
* OAuth key/secret pair.
@@ -140,7 +140,7 @@ declare namespace OAuth {
140140
/**
141141
* Method used to hash the the OAuth and form/querystring data.
142142
*/
143-
export type HashFunction = (base_string, key) => string;
143+
export type HashFunction = (base_string: string, key: string) => string;
144144

145145
/**
146146
* Authorization header.

0 commit comments

Comments
 (0)