Function symbolHasReadonlyDeclaration

  • Test if the given symbol has a readonly declaration.

    Parameters

    • symbol: Symbol
    • typeChecker: TypeChecker

    Returns boolean

    Example

    declare const symbol: ts.Symbol;
    declare const typeChecker: ts.TypeChecker;

    if (symbolHasReadonlyDeclaration(symbol, typeChecker)) {
    // ...
    }