UNPKG

1.65 kBTypeScriptView Raw
1import * as ts from "typescript";
2export declare namespace TSHelpers {
3 type DeclarationWithTypeNode = ts.Declaration & {
4 type?: ts.TypeNode;
5 };
6 function GetTypeTextFromDeclaration(declaration: DeclarationWithTypeNode): string;
7 function GetReturnTypeTextFromDeclaration(declaration: ts.SignatureDeclaration, typeChecker: ts.TypeChecker): string;
8 /**
9 * Returns the string part of `export * from "./module";`
10 */
11 function GetExportDeclarationImportString(declaration: ts.ExportDeclaration): string | undefined;
12 /**
13 * Returns `ts.SourceFile` from `ts.ExportDeclaration`.
14 */
15 function GetSourceFileFromExport(declaration: ts.ExportDeclaration, program: ts.Program): ts.SourceFile | undefined;
16 /**
17 * Returns Symbol from declaration.
18 */
19 function GetSymbolFromDeclaration(declaration: ts.Declaration, typeChecker: ts.TypeChecker): ts.Symbol | undefined;
20 type TypeWithTypeArguments = ts.Type & {
21 typeArguments: ts.Type[];
22 };
23 function IsTypeWithTypeArguments(type: ts.Type): type is TypeWithTypeArguments;
24 function IsTypeUnionOrIntersectionType(type: ts.Type): type is ts.UnionOrIntersectionType;
25 function IsTypeUnionType(type: ts.Type): type is ts.UnionType;
26 function IsTypeIntersectionType(type: ts.Type): type is ts.IntersectionType;
27 function GetResolvedModule(sourceFile: ts.SourceFile, moduleNameText: string): ts.ResolvedModuleFull | undefined;
28 /**
29 * Source: @microsoft/api-extractor (MIT)
30 * Github: https://goo.gl/tLoJUe
31 */
32 function FollowSymbolAliases(symbol: ts.Symbol, typeChecker: ts.TypeChecker): ts.Symbol;
33}