diff --git a/types/s3rver/index.d.ts b/types/s3rver/index.d.ts
index c417aefab6..49ad8e3822 100644
--- a/types/s3rver/index.d.ts
+++ b/types/s3rver/index.d.ts
@@ -7,9 +7,6 @@
///
-
-import * as http from "http";
-
declare class S3rver {
constructor(options: S3rverOptions)
setPort(port: number): S3rver;
@@ -18,8 +15,12 @@ declare class S3rver {
setSilent(silent: boolean): S3rver;
setIndexDocument(indexDocument: string): S3rver;
setErrorDocument(errorDocument: string): S3rver;
- run(callback: (error: Error, hostname: string, port: number, directory: string) => void): http.Server;
+ run(callback: (error: Error | null, hostname: string, port: number, directory: string) => void): S3rver;
run(): Promise;
+ close(): Promise;
+ // Should return S3rver, but doesn't in all cases, currently
+ // See https://github.com/jamhall/s3rver/pull/571
+ close(callback: (error: Error | null) => void): void;
}
interface S3rverOptions {
diff --git a/types/s3rver/s3rver-tests.ts b/types/s3rver/s3rver-tests.ts
index 8e565ef14b..efd68514eb 100644
--- a/types/s3rver/s3rver-tests.ts
+++ b/types/s3rver/s3rver-tests.ts
@@ -10,6 +10,7 @@ var s3rver = new S3rver({
}).run((err, hostname, port, directory) => {});
s3rver.close();
+s3rver.close(e => console.log(e));
// using new options
import fs = require('fs');