export type GenericRecord = Record; export interface ReplicadLike extends GenericRecord { setOC?: (oc: any) => void; setManifold?: (manifold: any) => void; getFont?: () => unknown; loadFont?: (fontData: string | ArrayBuffer, fontName?: string, forceUpdate?: boolean) => Promise; exportSTEP?: (shapes: any[]) => Blob; MeshShape?: new (...args: any[]) => any; Sketch?: new (...args: any[]) => any; Sketches?: new (...args: any[]) => any; CompoundSketch?: new (...args: any[]) => any; Blueprint?: new (...args: any[]) => any; Blueprints?: new (...args: any[]) => any; CompoundBlueprint?: new (...args: any[]) => any; Drawing?: new (...args: any[]) => any; Vertex?: new (...args: any[]) => any; EdgeFinder?: new (...args: any[]) => any; FaceFinder?: new (...args: any[]) => any; } export interface RuntimeContext { replicad: ReplicadLike; oc: any; manifold?: any; fontPath?: string; } export type RuntimeResolver = () => Promise; export interface EvaluateModuleOptions { filename?: string; globals?: Record; } export interface CodeEvaluator { runInContext(code: string, context?: Record): T | Promise; evaluateModule(code: string, options?: EvaluateModuleOptions): Promise; } export interface CreateEvaluatorOptions { replicad: ReplicadLike; oc?: any | Promise; manifold?: any | Promise; fontPath?: string; runtime?: RuntimeResolver; codeEvaluator?: CodeEvaluator; fetch?: typeof fetch; tempDir?: string; } export interface OpenCascadeCompatibilityReplacement { legacy: string; replacement: string; } export interface EvaluatorService { ready: () => Promise; buildShapesFromCode: (code: string, params?: GenericRecord) => Promise; computeLabels: (code: string, params?: GenericRecord) => Promise; extractDefaultParamsFromCode: (code: string) => Promise; extractDefaultNameFromCode: (code: string) => Promise; extractDefaultParams: (code: string) => Promise; extractDefaultName: (code: string) => Promise; exportShape: (fileType?: string, shapeId?: string, meshConfig?: GenericRecord) => Promise; getShapeEntries: (shapeId?: string) => any[]; getCompatibilityReplacements: () => OpenCascadeCompatibilityReplacement[]; loadFont: (fontData: string | ArrayBuffer, fontName?: string, forceUpdate?: boolean) => Promise; faceInfo: (subshapeIndex: number, faceIndex: number, shapeId?: string) => GenericRecord | null; edgeInfo: (subshapeIndex: number, edgeIndex: number, shapeId?: string) => GenericRecord | null; }