1- import RNHash from "." ;
1+ declare namespace RNHash {
22
3- export as namespace RNHash ;
3+ function hashFile ( uri : string , algorithm : string ) : Promise < string > ;
4+ /**
5+ *
6+ * @param uri uri pointing to File or directory
7+ * @param algorithm algorithm to be used for hashing
8+ * @param minFileSize minimum file size to be hashed in bytes
9+ * @param maxFileSize maximum file size to be hashed in bytes
10+ * @param extensionFilter extension of files to be hashed, pass "" to ignore this option
11+ * @param batchSize event batch size, pass -1 to retrieve all results on .then instead of events
12+ * @returns Promise -- if batchSize is set to -1, the promise.resolve contains all the hashes, otherwise, it resolves to null.
13+ */
14+ function hashFilesForFolder (
15+ uri : string , algorithm : string , minFileSize : number , maxFileSize : number , extensionFilter : string , batchSize : number , delay : number
16+ ) : Promise < { FilesCount : number , isFinalBatch : boolean , batchNumber : number , results : Record < string , string > } > ;
417
5- export function hashFile ( uri : string , algorithm : string ) : Promise < string > ;
6- /**
7- *
8- * @param uri uri pointing to File or directory
9- * @param algorithm algorithm to be used for hashing
10- * @param minFileSize minimum file size to be hashed in bytes
11- * @param maxFileSize maximum file size to be hashed in bytes
12- * @param extensionFilter extension of files to be hashed, pass "" to ignore this option
13- * @param batchSize event batch size, pass -1 to retrieve all results on .then instead of events
14- * @returns Promise -- if batchSize is set to -1, the promise.resolve contains all the hashes, otherwise, it resolves to null.
15- */
16- export function hashFilesForFolder (
17- uri : string , algorithm : string , minFileSize : number , maxFileSize : number , extensionFilter : string , batchSize : number , delay : number
18- ) : Promise < { FilesCount : number , isFinalBatch : bool , batchNumber : number , results : Record < string , string > } > ;
18+ function hashFilesForFolders (
19+ uri : Array < string > , algorithm : string , minFileSize : number , maxFileSize : number , extensionFilter : string , batchSize : number , delay : number
20+ ) : Promise < { FilesCount : number , isFinalBatch : boolean , batchNumber : number , results : Record < string , string > } > ;
1921
20- export function hashFilesForFolders (
21- uri : Array < string > , algorithm : string , minFileSize : number , maxFileSize : number , extensionFilter : string , batchSize : number , delay : number
22- ) : Promise < { FilesCount : number , isFinalBatch : bool , batchNumber : number , results : Record < string , string > } > ;
22+
23+ function hashUrl ( url : string , HTTPMethod : string , headers : Record < string , string > , algorithm : string ) : Promise < string > ;
24+ function hashString ( message : string , algorithm : string ) : Promise < string > ;
25+ function generateHmac ( message : string , key : string , algorithm : string ) : Promise < string > ;
26+ }
2327
2428
25- export function hashUrl ( url : string , HTTPMethod : string , headers : Record < string , string > , algorithm : string ) : Promise < string > ;
26- export function hashString ( message : string , algorithm : string ) : Promise < string > ;
27- export function generateHmac ( message : string , key : string , algorithm : string ) : Promise < string > ;
2829
2930export namespace CONSTANTS {
3031 export namespace HashAlgorithms {
3132 export const md2 : string ;
32- export const md5 : String ;
33- export const sha1 : String ;
34- export const sha224 : String ;
35- export const sha256 : String ;
36- export const sha384 : String ;
37- export const sha512 : String ;
38- export const keccak : String ;
33+ export const md5 : string ;
34+ export const sha1 : string ;
35+ export const sha224 : string ;
36+ export const sha256 : string ;
37+ export const sha384 : string ;
38+ export const sha512 : string ;
39+ export const keccak : string ;
3940 }
4041 export namespace HmacAlgorithms {
41- export const HmacMD5 : String ;
42- export const HmacSHA1 : String ;
43- export const HmacSHA224 : String ;
44- export const HmacSHA256 : String ;
45- export const HmacSHA384 : String ;
46- export const HmacSHA512 : String ;
47- export const PBEwithHmacSHA : String ;
48- export const PBEwithHmacSHA1 : String ;
49- export const PBEwithHmacSHA224 : String ;
50- export const PBEwithHmacSHA256 : String ;
51- export const PBEwithHmacSHA384 : String ;
52- export const PBEwithHmacSHA512 : String ;
42+ export const HmacMD5 : string ;
43+ export const HmacSHA1 : string ;
44+ export const HmacSHA224 : string ;
45+ export const HmacSHA256 : string ;
46+ export const HmacSHA384 : string ;
47+ export const HmacSHA512 : string ;
48+ export const PBEwithHmacSHA : string ;
49+ export const PBEwithHmacSHA1 : string ;
50+ export const PBEwithHmacSHA224 : string ;
51+ export const PBEwithHmacSHA256 : string ;
52+ export const PBEwithHmacSHA384 : string ;
53+ export const PBEwithHmacSHA512 : string ;
5354 }
5455 export namespace Events {
55- export const onBatchReccieved : String ;
56+ export const onBatchReccieved : string ;
5657 }
5758}
5859
59- export namespace JSHash {
60- export function hashString ( message : string , algorithm : string ) : Promise < string > ;
61- }
6260
63- export namespace JSHmac {
64- export function hashString ( message : string , secret : string , algorithm : string ) : Promise < string > ;
65- }
61+ export default RNHash ;
62+
63+ export function JSHash ( message : string , algorithm : string ) : Promise < string > ;
64+
65+ export function JSHmac ( message : string , secret : string , algorithm : string ) : Promise < string > ;
0 commit comments