Files
vscode-extension-samples/tree-view-sample/src/jsftp.d.ts
Matt Bierner 73e249b3c1 Migrate all samples to eslint 9
Switches all samples to use eslint 9 with flat configs. I've tried to migrate existing settings as much as possible. However our eslint configs were also inconsistent so I've tried to align these too
2024-10-26 17:44:03 -07:00

43 lines
1.2 KiB
TypeScript

import { Readable } from 'stream';
import { EventEmitter } from 'events';
declare namespace JSFtp {
interface JSFtpOptions {
host: string;
port?: number | 21;
user?: string | 'anonymous';
pass?: string | '@anonymous';
useList?: boolean
}
type Callback<T> = (err: any, result: T) => void;
interface Entry {
name: string;
size: number;
time: number;
type: 0 | 1;
}
}
interface JSFtp extends EventEmitter {
auth(user: string, password: string, callback: JSFtp.Callback<void>): void
keepAlive(wait?: number): void;
ls(path: string, callback: JSFtp.Callback<JSFtp.Entry[]>): void;
list(path: string, callback: JSFtp.Callback<any>): void;
put(buffer: Buffer, path: string, callback: JSFtp.Callback<void>): void;
get(path: string, callback: JSFtp.Callback<Readable>): void;
setType(type: 'A' | 'AN' | 'AT' | 'AC' | 'E' | 'I' | 'L', callback: JSFtp.Callback<any>): void;
raw(command: string, args: any[], callback: JSFtp.Callback<void>): void;
raw<T>(command: string, args: any[], callback: JSFtp.Callback<T>): void;
}
type JSFtpConstructor = new(options: JSFtp.JSFtpOptions) => JSFtp;
declare const JSFtp: JSFtpConstructor;
export = JSFtp;