UNPKG

1.62 kBTypeScriptView Raw
1import * as ts from 'typescript';
2import { PluginOptions } from '../merge-options';
3export declare function getTypeReferenceAsString(type: ts.Type, typeChecker: ts.TypeChecker, arrayDepth?: number): {
4 typeName: string;
5 isArray?: boolean;
6 arrayDepth?: number;
7};
8export declare function isPromiseOrObservable(type: string): boolean;
9export declare function replaceImportPath(typeReference: string, fileName: string, options: PluginOptions): {
10 typeReference: string;
11 typeName: string;
12 importPath: string;
13} | {
14 typeReference: string;
15 importPath: string;
16 typeName?: undefined;
17};
18export declare function insertAt(string: string, index: number, substring: string): string;
19export declare function isDynamicallyAdded(identifier: ts.Node): boolean;
20/**
21 * when "strict" mode enabled, TypeScript transform the enum type to a union composed of
22 * the enum values and the undefined type. Hence, we have to lookup all the union types to get the original type
23 * @param type
24 * @param typeChecker
25 */
26export declare function isAutoGeneratedEnumUnion(type: ts.Type, typeChecker: ts.TypeChecker): ts.Type;
27/**
28 * when "strict" mode enabled, TypeScript transform the type signature of optional properties to
29 * the {undefined | T} where T is the original type. Hence, we have to extract the last type of type union
30 * @param type
31 */
32export declare function isAutoGeneratedTypeUnion(type: ts.Type): boolean;
33/**
34 * Converts Windows specific file paths to posix
35 * @param windowsPath
36 */
37export declare function convertPath(windowsPath: string): string;
38//# sourceMappingURL=plugin-utils.d.ts.map
\No newline at end of file