@stacksjs/dtsx
Version:
A modern, fast .d.ts generation tool, powered by Bun.
56 lines (55 loc) • 2.28 kB
TypeScript
import type { DtsGenerationConfig } from './types';
export declare function loadCompilerOptions(path: string, overrides?: CompilerOptions): CompilerOptions;
export declare function typeCheck(files: string[], config?: TypeCheckConfig): Promise<TypeCheckResult>;
export declare function validateDeclarations(files: string[], config?: TypeCheckConfig): Promise<TypeCheckResult>;
export declare function checkIsolatedDeclarations(files: string[]): Promise<Map<string, IsolatedDeclarationsResult>>;
export declare function getTypeAtPosition(file: string, line: number, column: number): string | null;
export declare function getQuickInfo(file: string, line: number, column: number): { type: string, documentation?: string } | null;
export declare function formatTypeCheckResults(result: TypeCheckResult): string;
export declare function typeCheckWithConfig(config: DtsGenerationConfig): Promise<TypeCheckResult>;
export declare function validateGeneratedDeclarations(sourceFiles: string[], declarationFiles: string[]): Promise<{ valid: boolean, mismatches: Array<{ sourceName: string, sourceType: string, dtsType: string }> }>;
export declare interface TypeDiagnostic {
file: string
line: number
column: number
message: string
code: number
severity: DiagnosticSeverity
source?: string
suggestion?: string
category: string
}
export declare interface TypeCheckResult {
success: boolean
diagnostics: TypeDiagnostic[]
errorCount: number
warningCount: number
infoCount: number
filesChecked: string[]
durationMs: number
}
export declare interface TypeCheckConfig {
tsconfigPath?: string
rootDir?: string
strict?: boolean
declarationsOnly?: boolean
skipLibCheck?: boolean
include?: string[]
exclude?: string[]
warningsAsErrors?: boolean
maxErrors?: number
compilerOptions?: CompilerOptions
}
export declare interface IsolatedDeclarationsIssue {
line: number
column: number
message: string
declarationName?: string
missingAnnotation?: 'return' | 'parameter' | 'variable' | 'property'
}
export declare interface IsolatedDeclarationsResult {
compatible: boolean
issues: IsolatedDeclarationsIssue[]
}
export type DiagnosticSeverity = 'error' | 'warning' | 'info' | 'hint';
export type CompilerOptions = Record<string, unknown>;