Merge pull request #34 from trs/add-typings

feat(typings): add TypeScript .d.ts files
This commit is contained in:
Tyler Stewart
2017-07-24 11:00:13 -06:00
committed by GitHub
2 changed files with 63 additions and 0 deletions

62
ftp-srv.d.ts vendored Normal file
View File

@@ -0,0 +1,62 @@
declare class FileSystem {
constructor(connection: any, {root, cwd}?: {
root: any;
cwd: any;
});
currentDirectory(): string;
get(fileName: string): Promise<any>;
list(path?: string): Promise<any>;
chdir(path?: string): Promise<string>;
write(fileName: string, {append, start}?: {
append?: boolean;
start?: any;
}): any;
read(fileName: string, {start}?: {
start?: any;
}): Promise<any>;
delete(path: string): Promise<any>;
mkdir(path: string): Promise<any>;
rename(from: string, to: string): Promise<any>;
chmod(path: string, mode: string): Promise<any>;
getUniqueName(): string;
}
declare class FtpServer {
constructor(url: string, options?: {});
readonly isTLS: boolean;
listen(): any;
emitPromise(action: any, ...data: any[]): Promise<any>;
emit(action: any, ...data: any[]): void;
setupTLS(_tls: boolean): boolean | {
cert: string;
key: string;
ca: string
};
setupGreeting(greet: string): string[];
setupFeaturesMessage(): string;
disconnectClient(id: string): Promise<any>;
close(): any;
}
declare const FtpSrv: FtpServer;
export default FtpServer;

View File

@@ -41,6 +41,7 @@
"verify:js:watch": "chokidar 'src/**/*.js' 'test/**/*.js' 'config/**/*.js' -c 'npm run verify:js:fix' --initial --silent",
"verify:watch": "npm run verify:js:watch --silent"
},
"types": "./ftp-srv.d.ts",
"config": {
"commitizen": {
"path": "node_modules/cz-customizable"