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

    Interface BuilderProgram

    Builder to manage the program state changes

    interface BuilderProgram {
        emit(
            targetSourceFile?: tsc.SourceFile,
            writeFile?: WriteFileCallback,
            cancellationToken?: CancellationToken,
            emitOnlyDtsFiles?: boolean,
            customTransformers?: CustomTransformers,
        ): tsc.EmitResult;
        getAllDependencies(sourceFile: tsc.SourceFile): readonly string[];
        getCompilerOptions(): tsc.CompilerOptions;
        getConfigFileParsingDiagnostics(): readonly tsc.Diagnostic[];
        getCurrentDirectory(): string;
        getDeclarationDiagnostics(
            sourceFile?: tsc.SourceFile,
            cancellationToken?: CancellationToken,
        ): readonly tsc.DiagnosticWithLocation[];
        getGlobalDiagnostics(
            cancellationToken?: CancellationToken,
        ): readonly tsc.Diagnostic[];
        getOptionsDiagnostics(
            cancellationToken?: CancellationToken,
        ): readonly tsc.Diagnostic[];
        getProgram(): tsc.Program;
        getSemanticDiagnostics(
            sourceFile?: tsc.SourceFile,
            cancellationToken?: CancellationToken,
        ): readonly tsc.Diagnostic[];
        getSourceFile(fileName: string): tsc.SourceFile | undefined;
        getSourceFiles(): readonly tsc.SourceFile[];
        getSyntacticDiagnostics(
            sourceFile?: tsc.SourceFile,
            cancellationToken?: CancellationToken,
        ): readonly tsc.Diagnostic[];
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Emits the JavaScript and declaration files. When targetSource file is specified, emits the files corresponding to that source file, otherwise for the whole program. In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified, it is assumed that that file is handled from affected file list. If targetSourceFile is not specified, it will only emit all the affected files instead of whole program

      The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host in that order would be used to write the files

      Parameters

      Returns tsc.EmitResult

    • Get all the dependencies of the file

      Parameters

      Returns readonly string[]

    • Get compiler options of the program

      Returns tsc.CompilerOptions

    • Get the diagnostics from config file parsing

      Returns readonly tsc.Diagnostic[]

    • Get the current directory of the program

      Returns string

    • Get the diagnostics that dont belong to any file

      Parameters

      Returns readonly tsc.Diagnostic[]

    • Get the diagnostics for compiler options

      Parameters

      Returns readonly tsc.Diagnostic[]

    • Returns current program

      Returns tsc.Program

    • Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program The semantic diagnostics are cached and managed here Note that it is assumed that when asked about semantic diagnostics through this API, the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics In case of SemanticDiagnosticsBuilderProgram if the source file is not provided, it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics

      Parameters

      Returns readonly tsc.Diagnostic[]

    • Get the source file in the program with file name

      Parameters

      • fileName: string

      Returns tsc.SourceFile | undefined

    • Get a list of files in the program

      Returns readonly tsc.SourceFile[]

    • Get the syntax diagnostics, for all source files if source file is not supplied

      Parameters

      Returns readonly tsc.Diagnostic[]