Skip to content

Commit

Permalink
Fix TypeScript types
Browse files Browse the repository at this point in the history
Fixes #33
  • Loading branch information
sindresorhus committed Sep 27, 2020
1 parent 20e5dd3 commit ef81e41
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ declare const hasha: {
@param stream - A stream you want to hash.
@returns The calculated hash.
*/
fromStream(stream: NodeJS.ReadableStream): Promise<string | null>;
fromStream(stream: NodeJS.ReadableStream): Promise<string>;
fromStream(
stream: NodeJS.ReadableStream,
options?: hasha.Options<hasha.ToStringEncoding>
): Promise<string | null>;
): Promise<string>;
fromStream(
stream: NodeJS.ReadableStream,
options?: hasha.Options<'buffer'>
): Promise<Buffer | null>;
): Promise<Buffer>;

/**
Calculate the hash for a file.
Expand All @@ -140,15 +140,15 @@ declare const hasha: {
})();
```
*/
fromFile(filePath: string): Promise<string | null>;
fromFile(filePath: string): Promise<string>;
fromFile(
filePath: string,
options: hasha.Options<hasha.ToStringEncoding>
): Promise<string | null>;
): Promise<string>;
fromFile(
filePath: string,
options: hasha.Options<'buffer'>
): Promise<Buffer | null>;
): Promise<Buffer>;

/**
Synchronously calculate the hash for a file.
Expand Down

0 comments on commit ef81e41

Please sign in to comment.