aihu-tsc — `tsc` for projects containing .aihu Single File Components. Type-checks .aihu sources as virtual TypeScript, with no .aihu.ts files written to disk.
buildMappingsfunction buildMappings(source: string, generated: string): CodeMapping[]Map the generated surface back onto the source, line by line.
createAihuLanguagePluginfunction createAihuLanguagePlugin<T = string>( tsModule: typeof ts, options?: AihuLanguagePluginOptions, ): LanguagePlugin<T, AihuVirtualCode>getUncompilableFilesfunction getUncompilableFiles(): ReadonlySet<string>keepDiagnosticCodefunction keepDiagnosticCode( code: number | string | undefined, fileName: string | undefined, strictTemplates: boolean, ): booleanThe one diagnostic-suppression policy, shared with the language server (step 5): an editor squiggle and a CI failure must apply the SAME filter, or the split-brain this unification removes would creep back in as editor-only implicit-any noise.
runfunction run(options: RunOptions = {}): numberIMPLICIT_ANY_CODESconst IMPLICIT_ANY_CODESImplicit-`any` diagnostics, suppressed for `.aihu` files only.
AihuLanguagePluginOptionsinterface AihuLanguagePluginOptions {
/**
* #486 step 4 — switch the sidecar's attribute/component-prop type layer on
* (`aihu-tsc --strict-templates`). Default off: the virtual code is
* byte-identical to the pre-#486 surface.
*/
strictTemplates?: boolean
}AihuVirtualCodeinterface AihuVirtualCode extends VirtualCode {
id: 'main'
languageId: 'typescript'
}RunOptionsinterface RunOptions {
/** Path to a tsconfig.json, or a directory containing one. Defaults to cwd. */
project?: string
/** Report implicit-`any` inside .aihu files too. */
strictTemplates?: boolean
cwd?: string
}