export declare const pathSeparator = "/";
export interface FileSystemNode {
    type: 'dir' | 'file';
    name: string;
    fullPath: string;
}
export declare class ShallowDirectory implements FileSystemNode {
    name: string;
    fullPath: string;
    type: 'dir';
    constructor(name: string, fullPath: string);
}
export declare class Directory implements FileSystemNode {
    name: string;
    fullPath: string;
    children: Array<File | Directory>;
    type: 'dir';
    constructor(name: string, fullPath: string, children?: Array<File | Directory>);
}
export declare class File implements FileSystemNode {
    name: string;
    fullPath: string;
    type: 'file';
    content: string;
    constructor(name: string, fullPath: string, content?: string);
}
export declare function isFile(node?: FileSystemNode | null): node is File;
export declare function isDir(node?: FileSystemNode | null): node is Directory;
export interface UnexpectedErrorEvent {
    type: 'unexpectedError';
    stack?: string;
}
export interface FileCreatedEvent {
    type: 'fileCreated';
    fullPath: string;
    newContent: string;
}
export interface FileChangedEvent {
    type: 'fileChanged';
    fullPath: string;
    newContent: string;
}
export interface FileDeletedEvent {
    type: 'fileDeleted';
    fullPath: string;
}
export interface DirectoryCreatedEvent {
    type: 'directoryCreated';
    fullPath: string;
}
export interface DirectoryDeletedEvent {
    type: 'directoryDeleted';
    fullPath: string;
}
export interface Disposable {
    dispose(): void;
}
export declare function isDisposable(fs: any): fs is Disposable;
export declare type ListenerFn<T> = (event: T) => void;
export interface EventAspect<S, O> {
    listeners(event: S, exists: boolean): Array<ListenerFn<O>> | boolean;
    listeners(event: S): Array<ListenerFn<O>>;
    on(event: S, fn: ListenerFn<O>, context?: any): this;
    addListener(event: S, fn: ListenerFn<O>, context?: any): this;
    once(event: S, fn: ListenerFn<O>, context?: any): this;
    removeListener(event: S, fn?: ListenerFn<O>, context?: any, once?: boolean): this;
    removeAllListeners(event: S): this;
    off(event: S, fn?: ListenerFn<O>, context?: any, once?: boolean): this;
}
export declare type FileSystemEventName = 'unexpectedError' | 'fileCreated' | 'fileChanged' | 'fileDeleted' | 'directoryCreated' | 'directoryDeleted';
export declare const fileSystemEventNames: FileSystemEventName[];
export declare type FileSystemEventHandler = UnexpectedErrorEvent | FileCreatedEvent | FileChangedEvent | FileDeletedEvent | DirectoryCreatedEvent | DirectoryDeletedEvent;
export declare const fileSystemMethods: string[];
export declare type EventEmitter = EventAspect<'unexpectedError', UnexpectedErrorEvent> & EventAspect<'fileCreated', FileCreatedEvent> & EventAspect<'fileChanged', FileChangedEvent> & EventAspect<'fileDeleted', FileDeletedEvent> & EventAspect<'directoryCreated', DirectoryCreatedEvent> & EventAspect<'directoryDeleted', DirectoryDeletedEvent> & EventAspect<FileSystemEventName, FileSystemEventHandler> & {
    eventNames(): Array<FileSystemEventName>;
};
export interface FileSystem {
    saveFile(fullPath: string, newContent: string): Promise<void>;
    deleteFile(fullPath: string): Promise<void>;
    deleteDirectory(fullPath: string, recursive?: boolean): Promise<void>;
    loadTextFile(fullPath: string): Promise<string>;
    loadDirectoryTree(fullPath?: string): Promise<Directory>;
    loadDirectoryChildren(fullPath: string): Promise<(File | ShallowDirectory)[]>;
    ensureDirectory(fullPath: string): Promise<void>;
    readonly events: EventEmitter;
    readonly baseUrl: string;
}
