UNPKG

1.41 kBTypeScriptView Raw
1import type { Program } from 'typescript';
2import * as ts from 'typescript';
3import type { ParseSettings } from '../parseSettings';
4interface ASTAndNoProgram {
5 ast: ts.SourceFile;
6 program: null;
7}
8interface ASTAndDefiniteProgram {
9 ast: ts.SourceFile;
10 program: ts.Program;
11}
12type ASTAndProgram = ASTAndDefiniteProgram | ASTAndNoProgram;
13/**
14 * Compiler options required to avoid critical functionality issues
15 */
16declare const CORE_COMPILER_OPTIONS: ts.CompilerOptions;
17declare function createDefaultCompilerOptionsFromExtra(parseSettings: ParseSettings): ts.CompilerOptions;
18type CanonicalPath = string & {
19 __brand: unknown;
20};
21declare function getCanonicalFileName(filePath: string): CanonicalPath;
22declare function ensureAbsolutePath(p: string, tsconfigRootDir: string): string;
23declare function canonicalDirname(p: CanonicalPath): CanonicalPath;
24declare function getAstFromProgram(currentProgram: Program, filePath: string): ASTAndDefiniteProgram | undefined;
25/**
26 * Hash content for compare content.
27 * @param content hashed contend
28 * @returns hashed result
29 */
30declare function createHash(content: string): string;
31export { ASTAndDefiniteProgram, ASTAndNoProgram, ASTAndProgram, CORE_COMPILER_OPTIONS, canonicalDirname, CanonicalPath, createDefaultCompilerOptionsFromExtra, createHash, ensureAbsolutePath, getCanonicalFileName, getAstFromProgram, };
32//# sourceMappingURL=shared.d.ts.map
\No newline at end of file