Skip to content

Commit

Permalink
Merge pull request #34 from trs/add-typings
Browse files Browse the repository at this point in the history
feat(typings): add TypeScript .d.ts files
  • Loading branch information
trs authored Jul 24, 2017
2 parents 00af9e7 + dde7b36 commit f318331
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
62 changes: 62 additions & 0 deletions ftp-srv.d.ts
Original file line number Diff line number Diff line change
@@ -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;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f318331

Please sign in to comment.