@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
42 lines • 1.57 kB
text/typescript
import type { CompilerOptions } from 'typescript';
import { type ExportNode } from 'typescript-api-extractor';
import { type PerformanceLog } from "./performanceTracking.mjs";
export interface VariantResult {
exports: ExportNode[];
allTypes: ExportNode[];
namespaces: string[];
typeNameMap?: Record<string, string>;
}
export interface WorkerRequest {
requestId?: number;
projectPath: string;
compilerOptions: CompilerOptions;
/** All files for the TypeScript program (entrypoints + meta files) */
allEntrypoints: string[];
/** Meta files (DataAttributes, CssVars) - not entrypoints, just additional type info */
metaFiles: string[];
/** Map serialized as array of [variantName, fileUrl] tuples where fileUrl uses file:// protocol */
resolvedVariantMap: Array<[string, string]>;
/** Dependency paths (filesystem paths, not URLs) */
dependencies: string[];
/** Root context directory path (must end with /) */
rootContextDir: string;
relativePath: string;
}
export interface WorkerResponse {
requestId?: number;
success: boolean;
variantData?: Record<string, VariantResult>;
/** All dependencies as filesystem paths (from TypeScript's program.getSourceFiles()) */
allDependencies?: string[];
performanceLogs?: PerformanceLog[];
error?: string;
debug?: {
metaFilesCount?: number;
};
}
/**
* Process TypeScript types for the given request.
* This function creates a TypeScript program, parses exports, and returns type metadata.
*/
export declare function processTypes(request: WorkerRequest): Promise<WorkerResponse>;