@servicenow/sdk - v4.4.1
    Preparing search index...

    Interface WatchCompilerHostOfConfigFile<T>

    Host to create watch with config file

    interface WatchCompilerHostOfConfigFile<T extends BuilderProgram> {
        configFileName: string;
        createProgram: CreateProgram<T>;
        extraFileExtensions?: readonly FileExtensionInfo[];
        jsDocParsingMode?: JSDocParsingMode;
        onUnRecoverableConfigFileDiagnostic: DiagnosticReporter;
        optionsToExtend?: tsc.CompilerOptions;
        watchOptionsToExtend?: tsc.WatchOptions;
        afterProgramCreate?(program: T): void;
        clearTimeout?(timeoutId: any): void;
        createHash?(data: string): string;
        directoryExists?(path: string): boolean;
        fileExists(path: string): boolean;
        getCurrentDirectory(): string;
        getDefaultLibFileName(options: tsc.CompilerOptions): string;
        getDefaultLibLocation?(): string;
        getDirectories?(path: string): string[];
        getEnvironmentVariable?(name: string): string | undefined;
        getModuleResolutionCache?(): ModuleResolutionCache | undefined;
        getNewLine(): string;
        getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
        hasInvalidatedResolutions?(filePath: tsc.Path): boolean;
        onWatchStatusChange?(
            diagnostic: tsc.Diagnostic,
            newLine: string,
            options: tsc.CompilerOptions,
            errorCount?: number,
        ): void;
        readDirectory(
            path: string,
            extensions?: readonly string[],
            exclude?: readonly string[],
            include?: readonly string[],
            depth?: number,
        ): string[];
        readFile(path: string, encoding?: string): string | undefined;
        realpath?(path: string): string;
        resolveModuleNameLiterals?(
            moduleLiterals: readonly tsc.StringLiteralLike[],
            containingFile: string,
            redirectedReference: ResolvedProjectReference | undefined,
            options: tsc.CompilerOptions,
            containingSourceFile: tsc.SourceFile,
            reusedNames: readonly tsc.StringLiteralLike[] | undefined,
        ): readonly ResolvedModuleWithFailedLookupLocations[];
        resolveModuleNames?(
            moduleNames: string[],
            containingFile: string,
            reusedNames: string[] | undefined,
            redirectedReference: ResolvedProjectReference | undefined,
            options: tsc.CompilerOptions,
            containingSourceFile?: tsc.SourceFile,
        ): (ResolvedModule | undefined)[];
        resolveTypeReferenceDirectiveReferences?<
            T extends string
            | tsc.FileReference,
        >(
            typeDirectiveReferences: readonly T[],
            containingFile: string,
            redirectedReference: ResolvedProjectReference | undefined,
            options: tsc.CompilerOptions,
            containingSourceFile: tsc.SourceFile | undefined,
            reusedNames: readonly T[] | undefined,
        ): readonly ResolvedTypeReferenceDirectiveWithFailedLookupLocations[];
        resolveTypeReferenceDirectives?(
            typeReferenceDirectiveNames: string[] | readonly tsc.FileReference[],
            containingFile: string,
            redirectedReference: ResolvedProjectReference | undefined,
            options: tsc.CompilerOptions,
            containingFileMode?: ResolutionMode,
        ): (ResolvedTypeReferenceDirective | undefined)[];
        setTimeout?(
            callback: (...args: any[]) => void,
            ms: number,
            ...args: any[],
        ): any;
        trace?(s: string): void;
        useCaseSensitiveFileNames(): boolean;
        useSourceOfProjectReferenceRedirect?(): boolean;
        watchDirectory(
            path: string,
            callback: DirectoryWatcherCallback,
            recursive?: boolean,
            options?: tsc.WatchOptions,
        ): FileWatcher;
        watchFile(
            path: string,
            callback: FileWatcherCallback,
            pollingInterval?: number,
            options?: tsc.WatchOptions,
        ): FileWatcher;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    configFileName: string

    Name of the config file to compile

    createProgram: CreateProgram<T>

    Used to create the program when need for program creation or recreation detected

    extraFileExtensions?: readonly FileExtensionInfo[]
    jsDocParsingMode?: JSDocParsingMode
    onUnRecoverableConfigFileDiagnostic: DiagnosticReporter

    Reports unrecoverable error when parsing config file

    optionsToExtend?: tsc.CompilerOptions

    Options to extend

    watchOptionsToExtend?: tsc.WatchOptions

    Methods

    • If provided, callback to invoke after every new program creation

      Parameters

      • program: T

      Returns void

    • If provided, will be used to reset existing delayed compilation

      Parameters

      • timeoutId: any

      Returns void

    • Parameters

      • data: string

      Returns string

    • If provided, used for module resolution as well as to handle directory structure

      Parameters

      • path: string

      Returns boolean

    • Use to check file presence for source files and if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well

      Parameters

      • path: string

      Returns boolean

    • Returns string

    • Returns string

    • If provided, used in resolutions as well as handling directory structure

      Parameters

      • path: string

      Returns string[]

    • If provided is used to get the environment variable

      Parameters

      • name: string

      Returns string | undefined

    • Returns the module resolution cache used by a provided resolveModuleNames implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it

      Returns ModuleResolutionCache | undefined

    • Returns string

    • If provided, use this method to get parsed command lines for referenced projects

      Parameters

      • fileName: string

      Returns ParsedCommandLine | undefined

    • If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives

      Parameters

      Returns boolean

    • If provided, called with Diagnostic message that informs about change in watch status

      Parameters

      Returns void

    • Used to generate source file names from the config file and its include, exclude, files rules and also to cache the directory stucture

      Parameters

      • path: string
      • Optionalextensions: readonly string[]
      • Optionalexclude: readonly string[]
      • Optionalinclude: readonly string[]
      • Optionaldepth: number

      Returns string[]

    • Use to read file text for source files and if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well

      Parameters

      • path: string
      • Optionalencoding: string

      Returns string | undefined

    • Symbol links resolution

      Parameters

      • path: string

      Returns string

    • Parameters

      Returns (ResolvedModule | undefined)[]

      supply resolveModuleNameLiterals instead for resolution that can handle newer resolution modes like nodenext

      If provided, used to resolve the module names, otherwise typescript's default module resolution

    • If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together

      Parameters

      • callback: (...args: any[]) => void
      • ms: number
      • ...args: any[]

      Returns any

    • If provided would be used to write log about compilation

      Parameters

      • s: string

      Returns void

    • Returns boolean

    • Instead of using output d.ts file from project reference, use its source file

      Returns boolean