diff --git a/index.d.ts b/index.d.ts index 1affdfbaf..b74710926 100644 --- a/index.d.ts +++ b/index.d.ts @@ -294,6 +294,7 @@ export interface Net { removeCookies(domain?: string): Promise; } +type HashAlgorithm = "md5" | "sha1" | "sha224" | "sha256" | "sha384" | "sha512"; export interface FS { RNFetchBlobSession: RNFetchBlobSession; @@ -317,6 +318,14 @@ export interface FS { ls(path: string): Promise; + /** + * Read the file from the given path and calculate a cryptographic hash sum over its contents. + * + * @param path Path to the file + * @param algorithm The hash algorithm to use + */ + hash(path: string, algorithm: HashAlgorithm): Promise; + /** * Create file stream from file at `path`. * @param path The file path.