Angular Modernizer
    Preparing search index...

    Resolves TypeScript types at source positions via ts-morph. Uses the ts-morph language service and type checker.

    Useful in bug investigation to understand what type a variable holds at a specific location, including whether it is nullable, async, or wraps a generic parameter.

    const resolver = new TypeResolver(project);
    const info = resolver.resolveType('/src/app/user.service.ts', 42, 15);
    // info.typeString -> 'UserService'
    // info.isNullable -> false
    // info.isAsync -> false
    // info.declaredIn -> '/src/app/user.service.ts'
    Index

    Constructors

    Methods

    Constructors

    • Parameters

      • project: Project

        A ts-morph Project instance with source files already added.

      Returns TypeResolver

    Methods

    • Resolves the TypeScript type at the given 1-based position.

      Parameters

      • file: string

        Absolute path of the source file.

      • line: number

        1-based line number.

      • column: number

        1-based column number.

      Returns ResolvedTypeInfo

      Resolved type information, or a fallback with typeString: 'unknown'.