import type { CompilerOptions, ParseConfigHost } from 'typescript'; import ts from 'typescript'; /** * Default means reflection is enabled for this file. * Never means the whole reflection is disabled for this file. * Explicit means that reflection is per default disabled for this file, but each symbol/type * in it is allowed to enable it using jsdoc `@reflection`. */ export declare const reflectionModes: readonly ["default", "explicit", "never"]; export type Mode = (typeof reflectionModes)[number]; export type RawMode = Mode | '' | boolean | string | string[] | undefined; export declare function isObject(obj: any): obj is { [key: string]: any; }; /** * These are the values that can be in the tsconfig.json file. */ export interface TsConfigJson { extends?: string; compilerOptions?: any; reflection?: RawMode; deepkitCompilerOptions?: { /** * Either true to activate reflection for all files compiled using this tsconfig, * or a list of globs/file paths relative to this tsconfig.json. * Globs/file paths can be prefixed with a ! to exclude them. */ reflection?: RawMode; /** * If a tsconfig extends another tsconfig, this option defines how the reflection/exclude * options are merged. The default strategy is `merge`, which means that the reflection/exclude * options are merged with the parent tsconfig.json. If set to `replace`, the reflection/exclude * options are not merged, but the parent tsconfig.json is ignored. */ mergeStrategy?: 'merge' | 'replace'; /** * List of globs/file paths relative to this tsconfig.json * which are then excluded from the type compilation step. * Per default a few global .d.ts files are excluded like `lib.dom*.d.ts` and `*typedarrays.d.ts`. */ exclude?: string[]; }; } export interface ReflectionConfig { /** * Allows to exclude type definitions/TS files from being included in the type compilation step. * When a global .d.ts is matched, their types won't be embedded (useful to exclude DOM for example) */ exclude?: string[]; /** * Either a boolean indication general reflection mode, * or a list of globs to match against. */ reflection?: string[] | Mode; } export interface CurrentConfig extends ReflectionConfig { compilerOptions: ts.CompilerOptions; mergeStrategy?: 'merge' | 'replace'; extends?: string; } export interface ResolvedConfig extends ReflectionConfig { path: string; compilerOptions: ts.CompilerOptions; mergeStrategy: 'merge' | 'replace'; } export declare function reflectionModeMatcher(config: ReflectionConfig, filePath: string): Mode; export declare function parseRawMode(mode: RawMode): string[] | Mode; export interface MatchResult { tsConfigPath: string; mode: (typeof reflectionModes)[number]; } export declare const defaultExcluded: string[]; export type Matcher = (path: string) => MatchResult; export type ConfigResolver = { match: Matcher; config: ResolvedConfig; }; export type ReflectionConfigCache = { [path: string]: ConfigResolver; }; export declare function getConfigResolver(cache: ReflectionConfigCache, host: ParseConfigHost, compilerOptions: CompilerOptions, sourceFile: { fileName: string; }, tsConfigPath?: string): ConfigResolver;