import { FileSystemEntryKind, FileWatcherCallback, FileWatcherEventKind, FormatDiagnosticsHost, FsWatchCallback, HostWatchDirectory, HostWatchFile, ModuleImportResult, ModuleResolutionHost, Path, PollingInterval, server, SortedArray } from "../../_namespaces/ts";
export declare const libFile: File;
export interface TestServerHostCreationParameters {
    useCaseSensitiveFileNames?: boolean;
    executingFilePath?: string;
    currentDirectory?: string;
    newLine?: string;
    windowsStyleRoot?: string;
    environmentVariables?: Map<string, string>;
    runWithoutRecursiveWatches?: boolean;
    runWithFallbackPolling?: boolean;
    inodeWatching?: boolean;
}
export declare function createWatchedSystem(fileOrFolderList: FileOrFolderOrSymLinkMap | readonly FileOrFolderOrSymLink[], params?: TestServerHostCreationParameters): TestServerHost;
export declare function createServerHost(fileOrFolderList: FileOrFolderOrSymLinkMap | readonly FileOrFolderOrSymLink[], params?: TestServerHostCreationParameters): TestServerHost;
export interface File {
    path: string;
    content: string;
    fileSize?: number;
}
export interface Folder {
    path: string;
}
export interface SymLink {
    /** Location of the symlink. */
    path: string;
    /** Relative path to the real file. */
    symLink: string;
}
export type FileOrFolderOrSymLink = File | Folder | SymLink;
export interface FileOrFolderOrSymLinkMap {
    [path: string]: string | Omit<File, "path"> | Omit<SymLink, "path"> | undefined;
}
export declare function isFile(fileOrFolderOrSymLink: FileOrFolderOrSymLink): fileOrFolderOrSymLink is File;
export declare function isSymLink(fileOrFolderOrSymLink: FileOrFolderOrSymLink): fileOrFolderOrSymLink is SymLink;
interface FSEntryBase {
    path: Path;
    fullPath: string;
    modifiedTime: Date;
}
interface FsFile extends FSEntryBase {
    content: string;
    fileSize?: number;
}
interface FsFolder extends FSEntryBase {
    entries: SortedArray<FSEntry>;
}
interface FsSymLink extends FSEntryBase {
    symLink: string;
}
export type FSEntry = FsFile | FsFolder | FsSymLink;
interface CallbackData {
    cb: TimeOutCallback;
    args: any[];
    ms: number | undefined;
    time: number;
}
declare class Callbacks {
    private host;
    readonly callbackType: string;
    readonly map: CallbackData[];
    private nextId;
    constructor(host: TestServerHost, callbackType: string);
    getNextId(): number;
    register(cb: TimeOutCallback, args: any[], ms?: number): number;
    unregister(id: any): void;
    log(): string;
    private invokeCallback;
    invoke(invokeKey?: number): void;
}
type TimeOutCallback = (...args: any[]) => void;
export interface TestFileWatcher {
    cb: FileWatcherCallback;
    pollingInterval: PollingInterval;
}
export interface TestFsWatcher {
    cb: FsWatchCallback;
    inode: number | undefined;
}
export interface WatchInvokeOptions {
    /** Invokes the directory watcher for the parent instead of the file changed */
    invokeDirectoryWatcherInsteadOfFileChanged: boolean;
    /** When new file is created, do not invoke watches for it */
    ignoreWatchInvokedWithTriggerAsFileCreate: boolean;
    /** Invoke the file delete, followed by create instead of file changed */
    invokeFileDeleteCreateAsPartInsteadOfChange: boolean;
    /** Dont invoke delete watches */
    ignoreDelete: boolean;
    /** Skip inode check on file or folder create*/
    skipInodeCheckOnCreate: boolean;
    /** When invoking rename event on fs watch, send event with file name suffixed with tilde */
    useTildeAsSuffixInRenameEventFileName: boolean;
}
export declare enum Tsc_WatchFile {
    DynamicPolling = "DynamicPriorityPolling"
}
export declare enum Tsc_WatchDirectory {
    WatchFile = "RecursiveDirectoryUsingFsWatchFile",
    NonRecursiveWatchDirectory = "RecursiveDirectoryUsingNonRecursiveWatchDirectory",
    DynamicPolling = "RecursiveDirectoryUsingDynamicPriorityPolling"
}
export interface TestServerHostOptions {
    useCaseSensitiveFileNames: boolean;
    executingFilePath: string;
    currentDirectory: string;
    newLine?: string;
    useWindowsStylePaths?: boolean;
    environmentVariables?: Map<string, string>;
}
export declare class TestServerHost implements server.ServerHost, FormatDiagnosticsHost, ModuleResolutionHost {
    args: string[];
    private readonly output;
    private fs;
    private time;
    getCanonicalFileName: (s: string) => string;
    toPath: (f: string) => Path;
    readonly timeoutCallbacks: Callbacks;
    readonly immediateCallbacks: Callbacks;
    readonly screenClears: number[];
    readonly watchUtils: import("../../../harness/watchUtils").WatchUtils<TestFileWatcher, TestFsWatcher, Path>;
    runWithFallbackPolling: boolean;
    readonly useCaseSensitiveFileNames: boolean;
    readonly newLine: string;
    readonly windowsStyleRoot?: string;
    private readonly environmentVariables?;
    private readonly executingFilePath;
    private readonly currentDirectory;
    require?: (initialPath: string, moduleName: string) => ModuleImportResult;
    importPlugin?: (root: string, moduleName: string) => Promise<ModuleImportResult>;
    storeFilesChangingSignatureDuringEmit: boolean;
    watchFile: HostWatchFile;
    private inodeWatching;
    private readonly inodes?;
    watchDirectory: HostWatchDirectory;
    constructor(fileOrFolderorSymLinkList: FileOrFolderOrSymLinkMap | readonly FileOrFolderOrSymLink[], { useCaseSensitiveFileNames, executingFilePath, currentDirectory, newLine, windowsStyleRoot, environmentVariables, runWithoutRecursiveWatches, runWithFallbackPolling, inodeWatching, }?: TestServerHostCreationParameters);
    private nextInode;
    private setInode;
    writeOutputIsTTY(): boolean;
    getNewLine(): string;
    toNormalizedAbsolutePath(s: string): string;
    toFullPath(s: string): Path;
    getHostSpecificPath(s: string): string;
    now(): Date;
    getTime(): number;
    setTime(time: number): void;
    private reloadFS;
    modifyFile(filePath: string, content: string, options?: Partial<WatchInvokeOptions>): void;
    renameFile(fileName: string, newFileName: string): void;
    renameFolder(folderName: string, newFolderName: string): void;
    private renameFolderEntries;
    ensureFileOrFolder(fileOrDirectoryOrSymLink: FileOrFolderOrSymLink, ignoreWatchInvokedWithTriggerAsFileCreate?: boolean, ignoreParentWatch?: boolean, options?: Partial<WatchInvokeOptions>): void;
    private ensureFolder;
    private addFileOrFolderInFolder;
    private removeFileOrFolder;
    deleteFile(filePath: string): void;
    deleteFolder(folderPath: string, recursive?: boolean): void;
    private watchFileWorker;
    private fsWatchWorker;
    invokeFileWatcher(fileFullPath: string, eventKind: FileWatcherEventKind, modifiedTime: Date | undefined): void;
    private fsWatchCallback;
    invokeFsWatchesCallbacks(fullPath: string, eventName: "rename" | "change", modifiedTime?: Date, entryFullPath?: string, useTildeSuffix?: boolean): void;
    invokeFsWatchesRecursiveCallbacks(fullPath: string, eventName: "rename" | "change", modifiedTime?: Date, entryFullPath?: string, useTildeSuffix?: boolean): void;
    private getRelativePathToDirectory;
    private invokeRecursiveFsWatches;
    invokeFsWatches(fullPath: string, eventName: "rename" | "change", modifiedTime: Date | undefined, useTildeSuffix: boolean | undefined): void;
    private invokeFileAndFsWatches;
    private toFsEntry;
    private toFsFile;
    private toFsSymLink;
    private toFsFolder;
    private getRealFsEntry;
    private isFsFile;
    private getRealFile;
    private isFsFolder;
    private getRealFolder;
    fileSystemEntryExists(s: string, entryKind: FileSystemEntryKind): boolean;
    fileExists(s: string): boolean;
    getModifiedTime(s: string): Date;
    setModifiedTime(s: string, date: Date): void;
    readFile(s: string): string | undefined;
    getFileSize(s: string): number;
    directoryExists(s: string): boolean;
    getDirectories(s: string): string[];
    readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
    createHash(s: string): string;
    createSHA256Hash(s: string): string;
    setTimeout(callback: TimeOutCallback, ms: number, ...args: any[]): number;
    getNextTimeoutId(): number;
    clearTimeout(timeoutId: any): void;
    clearScreen(): void;
    runQueuedTimeoutCallbacks(timeoutId?: number): void;
    runQueuedImmediateCallbacks(): void;
    setImmediate(callback: TimeOutCallback, ...args: any[]): number;
    clearImmediate(timeoutId: any): void;
    createDirectory(directoryName: string): void;
    writeFile(path: string, content: string): void;
    prependFile(path: string, content: string, options?: Partial<WatchInvokeOptions>): void;
    appendFile(path: string, content: string, options?: Partial<WatchInvokeOptions>): void;
    replaceFileText(file: string, searchValue: string | RegExp, replaceValue: string): void;
    write(message: string): void;
    getOutput(): readonly string[];
    clearOutput(): void;
    serializeOutput(baseline: string[]): void;
    snap(): Map<Path, FSEntry>;
    writtenFiles?: Map<Path, number>;
    diff(baseline: string[], base?: Map<Path, FSEntry>): void;
    serializeWatches(baseline?: string[]): string[];
    realpath(s: string): string;
    readonly exitMessage = "System Exit";
    exitCode: number | undefined;
    readonly resolvePath: (s: string) => string;
    readonly getExecutingFilePath: () => string;
    readonly getCurrentDirectory: () => string;
    exit(exitCode?: number): void;
    getEnvironmentVariable(name: string): string;
}
export type TestServerHostTrackingWrittenFiles = TestServerHost & {
    writtenFiles: Map<Path, number>;
};
export declare function changeToHostTrackingWrittenFiles(inputHost: TestServerHost): TestServerHostTrackingWrittenFiles;
export {};
//# sourceMappingURL=virtualFileSystemWithWatch.d.ts.map