当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Context.getSymbolID方法代码示例

本文整理汇总了TypeScript中typedoc/dist/lib/converter.Context.getSymbolID方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Context.getSymbolID方法的具体用法?TypeScript Context.getSymbolID怎么用?TypeScript Context.getSymbolID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在typedoc/dist/lib/converter.Context的用法示例。


在下文中一共展示了Context.getSymbolID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: onCreateDeclaration

 private onCreateDeclaration(context: Context, reflection: DeclarationReflection, node: ts.Node | undefined) {
     if (node && ts.isExportSpecifier(node)) {
         return;
     }
     if (node && node.parent && ts.isSourceFile(node.parent) && !ts.isExternalModule(node.parent)) {
         // ignore globals
         return;
     }
     if (reflection.kindOf(ReflectionKind.ExternalModule) && node && ts.isSourceFile(node) && node.symbol) {
         const renameTo = getRename(node);
         if (renameTo) {
             this.renames.push({ symbolID: context.getSymbolID(node.symbol), renameTo });
         }
     }
     if (reflection.kindOf(ReflectionKind.Method) && reflection.flags.isExported && node && ts.isFunctionDeclaration(node) && !(ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export)) {
         // A function in a module that merges with a class declaration should *not* be explicitly exported.
         reflection.setFlag(ReflectionFlag.Exported, false);
     }
     if (reflection.kindOf(ReflectionKind.ModuleMember | ReflectionKind.ClassMember) && !reflection.flags.isExported) {
         this.notExported.add(reflection);
     }
 }
开发者ID:rbuckton,项目名称:QueryJS,代码行数:22,代码来源:exports.ts

示例2: convert

 convert(context: Context, node: ts.ExportDeclaration) {
     if (node.exportClause) {
         for (const specifier of node.exportClause.elements) {
             const exportedName = ts.unescapeLeadingUnderscores(specifier.name.escapedText);
             const localName = specifier.propertyName ? ts.unescapeLeadingUnderscores(specifier.propertyName.escapedText) : exportedName;
             const symbol = getTargetSymbol(context, context.checker.getExportSpecifierLocalTargetSymbol(specifier));
             // const kind = !symbol ? ReflectionKind.Variable :
             //     symbol.flags & ts.SymbolFlags.Function ? ReflectionKind.Function :
             //     symbol.flags & ts.SymbolFlags.Class ? ReflectionKind.Class :
             //     symbol.flags & ts.SymbolFlags.Interface ? ReflectionKind.Interface :
             //     symbol.flags & ts.SymbolFlags.Enum ? ReflectionKind.Enum :
             //     symbol.flags & ts.SymbolFlags.TypeAlias ? ReflectionKind.TypeAlias :
             //     symbol.flags & ts.SymbolFlags.Variable ? ReflectionKind.Variable :
             //     // symbol.flags & ts.SymbolFlags.Module ? ReflectionKind.Module :
             //     ReflectionKind.Variable;
             const kind = ReflectionKind.Export;
             const reflection = createDeclaration(context, specifier, kind, exportedName);
             if (reflection) {
                 reflection.exportOf = new ExportBinding(localName, symbol && context.getSymbolID(symbol));
             }
         }
     }
     return context.scope;
 }
开发者ID:rbuckton,项目名称:QueryJS,代码行数:24,代码来源:exportDeclaration.ts


注:本文中的typedoc/dist/lib/converter.Context.getSymbolID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。