UNPKG

types-testing

Version:

Test TypeScript types at test runner runtime - Works seamlessly with Jest, Vitest, and Bun.

43 lines (42 loc) 1.17 kB
import type ts from 'typescript'; declare module 'typescript' { interface Type { intrinsicName?: string; value?: unknown; } } /** @internal */ export declare const compile: (options: CompileOptions) => CompileResult; /** @internal */ export type CompileResultError = { filePath: string; line: number; column: number; expectCallExpressionText?: string; assertionCallExpressionText?: string; receivedType?: string; expectedType?: string; isNegated?: boolean; need2TypeArguments?: boolean; }; /** @internal */ export type CompileResult = { files: readonly string[]; options: ts.CompilerOptions; errors: Map<string, CompileResultError>; }; /** @internal */ export type CompileOptions = { basePath: string; tsConfig: string; compilerOptions?: Partial<ts.CompilerOptions>; files?: readonly string[]; projectReferences?: readonly ts.ProjectReference[]; } | { basePath?: string; tsConfig?: string; compilerOptions: Partial<ts.CompilerOptions>; files: readonly string[]; projectReferences?: readonly ts.ProjectReference[]; }; export type Compile = typeof compile;