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

    Interface ProgramHost<T>

    interface ProgramHost<T extends BuilderProgram> {
        createProgram: CreateProgram<T>;
        jsDocParsingMode?: JSDocParsingMode;
        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;
        hasInvalidatedResolutions?(filePath: tsc.Path): boolean;
        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)[];
        trace?(s: string): void;
        useCaseSensitiveFileNames(): boolean;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    createProgram: CreateProgram<T>

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

    jsDocParsingMode?: JSDocParsingMode

    Methods

    • 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

    • Parameters

      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 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, 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

    • If provided would be used to write log about compilation

      Parameters

      • s: string

      Returns void

    • Returns boolean