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

    Interface SolutionBuilderWithWatchHost<T>

    Host that has watch functionality used in --watch mode

    interface SolutionBuilderWithWatchHost<T extends BuilderProgram> {
        createProgram: CreateProgram<T>;
        getCustomTransformers?: (project: string) => CustomTransformers | undefined;
        jsDocParsingMode?: JSDocParsingMode;
        reportDiagnostic: DiagnosticReporter;
        reportSolutionBuilderStatus: DiagnosticReporter;
        afterProgramEmitAndDiagnostics?(program: T): void;
        clearTimeout?(timeoutId: any): void;
        createDirectory?(path: string): void;
        createHash?(data: string): string;
        deleteFile(fileName: string): void;
        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;
        getModifiedTime(fileName: string): Date | 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)[];
        setModifiedTime(fileName: string, date: Date): void;
        setTimeout?(
            callback: (...args: any[]) => void,
            ms: number,
            ...args: any[],
        ): any;
        trace?(s: string): void;
        useCaseSensitiveFileNames(): boolean;
        watchDirectory(
            path: string,
            callback: DirectoryWatcherCallback,
            recursive?: boolean,
            options?: tsc.WatchOptions,
        ): FileWatcher;
        watchFile(
            path: string,
            callback: FileWatcherCallback,
            pollingInterval?: number,
            options?: tsc.WatchOptions,
        ): FileWatcher;
        writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    createProgram: CreateProgram<T>

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

    getCustomTransformers?: (project: string) => CustomTransformers | undefined
    jsDocParsingMode?: JSDocParsingMode
    reportDiagnostic: DiagnosticReporter
    reportSolutionBuilderStatus: DiagnosticReporter

    Methods

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

      Parameters

      • timeoutId: any

      Returns void

    • Parameters

      • path: string

      Returns void

    • Parameters

      • data: string

      Returns string

    • Parameters

      • fileName: string

      Returns void

    • 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

    • 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

    • Parameters

      • fileName: string

      Returns Date | 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 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

    • If provided, used to cache and handle directory structure modifications

      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

    • Parameters

      • fileName: string
      • date: Date

      Returns void

    • 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

    • Should provide create directory and writeFile if done of invalidatedProjects is not invoked with writeFileCallback

      Parameters

      • path: string
      • data: string
      • OptionalwriteByteOrderMark: boolean

      Returns void