How to use the @tslab/typescript-for-tslab.SymbolFlags function in @tslab/typescript-for-tslab

To help you get started, we’ve selected a few @tslab/typescript-for-tslab examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yunabe / tslab / src / converter.ts View on Github external
return;
          }
          let aliased = checker.getAliasedSymbol(sym);
          if (!keep.value) {
            // Here, keep.type == true.
            if (aliased.flags & ts.SymbolFlags.Value) {
              // Overwritten with a new value.
              return;
            }
            if (aliased.flags && ts.SymbolFlags.Type) {
              addName(node, key);
            }
            return;
          }
          // Here, keep.value == true and keep.type == false.
          if (aliased.flags & ts.SymbolFlags.Type) {
            // Overwritten with a new type.
            if (
              aliased.flags & ts.SymbolFlags.Value &&
              !valueNames.has(aliased.escapedName)
            ) {
              anyVars.add(aliased.escapedName);
            }
            return;
          }
          addName(node, key);
          return;
        }
        if (ts.isFunctionDeclaration(node)) {
          if (keep.value) {
            addName(node, key);
          }
github yunabe / tslab / src / converter.ts View on Github external
function checkKeepDeclType(
    checker: ts.TypeChecker,
    symb: ts.Symbol
  ): { value: boolean; type: boolean } {
    const ret = { value: true, type: true };
    if (!symb) {
      return ret;
    }
    if (symb.flags & ts.SymbolFlags.Alias) {
      symb = checker.getAliasedSymbol(symb);
    }
    if (symb.flags & ts.SymbolFlags.Value) {
      ret.value = false;
    }
    if (symb.flags & ts.SymbolFlags.Type) {
      ret.type = false;
    }
    return ret;
  }
github yunabe / tslab / src / converter.ts View on Github external
function checkKeepDeclType(
    checker: ts.TypeChecker,
    symb: ts.Symbol
  ): { value: boolean; type: boolean } {
    const ret = { value: true, type: true };
    if (!symb) {
      return ret;
    }
    if (symb.flags & ts.SymbolFlags.Alias) {
      symb = checker.getAliasedSymbol(symb);
    }
    if (symb.flags & ts.SymbolFlags.Value) {
      ret.value = false;
    }
    if (symb.flags & ts.SymbolFlags.Type) {
      ret.type = false;
    }
    return ret;
  }