Skip to content

Commit

Permalink
fix: updated typings
Browse files Browse the repository at this point in the history
  • Loading branch information
pkeuter authored and trs committed Nov 6, 2017
1 parent 1ba6703 commit 37f0a15
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions ftp-srv.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as tls from 'tls'
import { Stats } from 'fs'

export interface FileSystem {
export class FileSystem {
constructor(connection: any, {root, cwd}?: {
root: any;
cwd: any;
Expand Down Expand Up @@ -35,7 +35,7 @@ export interface FileSystem {
getUniqueName(): string;
}

export interface FtpConnection {
export class FtpConnection {
server: FtpServer;
id: string;
log: any;
Expand All @@ -54,16 +54,16 @@ export interface FtpConnection {

export interface FtpServerOptions {
pasv_range?: number | string,
greeting?: string,
greeting?: string | string[],
tls?: tls.SecureContext | false,
anonymous?: boolean,
blacklist?: Array<string>,
whitelist?: Array<string>,
file_format?: (stat: Stats) => string | Promise<string> | "ls" | "ep",
log: any
log?: any
}

export interface FtpServer {
export class FtpServer {
constructor(url: string, options?: FtpServerOptions);

readonly isTLS: boolean;
Expand Down Expand Up @@ -94,7 +94,13 @@ export interface FtpServer {
username: string,
password: string
},
resolve: (fs?: FileSystem, root?: string, cwd?: string, blacklist?: Array<string>, whitelist?: Array<string>) => void,
resolve: (config: {
fs?: FileSystem,
root?: string,
cwd?: string,
blacklist?: Array<string>,
whitelist?: Array<string>
}) => void,
reject: (err?: Error) => void
) => void)

Expand All @@ -107,5 +113,5 @@ export interface FtpServer {
) => void)
}

declare const FtpSrv: FtpServer;
export {FtpServer as FtpSrv};
export default FtpServer;

0 comments on commit 37f0a15

Please sign in to comment.