mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-21 13:27:15 +08:00
Type definitions for s3rver
This commit is contained in:
14
s3rver/s3rver-tests.ts
Normal file
14
s3rver/s3rver-tests.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/// <reference path="s3rver.d.ts" />
|
||||
|
||||
import S3rver = require('s3rver');
|
||||
|
||||
var s3rver = new S3rver({
|
||||
port: 5694,
|
||||
hostname: 'localhost',
|
||||
silent: true,
|
||||
indexDocument: 'index.html',
|
||||
errorDocument: '',
|
||||
directory: '/tmp/s3rver_test_directory'
|
||||
}).run((err, hostname, port, directory) => {});
|
||||
|
||||
s3rver.close();
|
||||
32
s3rver/s3rver.d.ts
vendored
Normal file
32
s3rver/s3rver.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
// Type definitions for S3rver
|
||||
// Project: https://github.com/jamhall/s3rver
|
||||
// Definitions by: David Broder-Rodgers <https://github.com/DavidBR-SW/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "s3rver" {
|
||||
import * as http from "http";
|
||||
|
||||
class S3rver {
|
||||
constructor(options: S3rverOptions)
|
||||
setPort(port: number): S3rver;
|
||||
setHostname(hostname: string): S3rver;
|
||||
setDirectory(directory: string): 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;
|
||||
}
|
||||
|
||||
interface S3rverOptions {
|
||||
port?: number;
|
||||
hostname?: string;
|
||||
silent?: boolean;
|
||||
indexDocument?: string;
|
||||
errorDocument?: string;
|
||||
directory: string;
|
||||
}
|
||||
|
||||
export = S3rver;
|
||||
}
|
||||
Reference in New Issue
Block a user