UNPKG

@gebrai/gebrai

Version:

Model Context Protocol server for GeoGebra mathematical visualization

172 lines 4.79 kB
import { GeoGebraConfig, GeoGebraAPI, GeoGebraCommandResult, GeoGebraObject } from '../types/geogebra'; /** * Mock GeoGebra Instance for demonstration and testing * This provides the same interface as the full implementation * but uses in-memory simulation instead of a real browser instance */ export declare class MockGeoGebraInstance implements GeoGebraAPI { private isInitialized; private lastActivity; private objects; private animatingObjects; private animationSpeeds; private tracedObjects; private isAnimating; readonly id: string; readonly config: GeoGebraConfig; constructor(config?: GeoGebraConfig); /** * Initialize the mock instance */ initialize(): Promise<void>; /** * Execute a GeoGebra command (mock implementation) */ evalCommand(command: string): Promise<GeoGebraCommandResult>; /** * Parse and execute basic GeoGebra commands */ private parseCommand; /** * Execute command and get labels of created objects */ evalCommandGetLabels(command: string): Promise<string[]>; /** * Delete an object */ deleteObject(objName: string): Promise<boolean>; /** * Check if object exists */ exists(objName: string): Promise<boolean>; /** * Check if object is defined */ isDefined(objName: string): Promise<boolean>; /** * Get all object names */ getAllObjectNames(type?: string): Promise<string[]>; /** * Get object information */ getObjectInfo(objName: string): Promise<GeoGebraObject | null>; /** * Get X coordinate of object */ getXcoord(objName: string): Promise<number>; /** * Get Y coordinate of object */ getYcoord(objName: string): Promise<number>; /** * Get Z coordinate of object */ getZcoord(objName: string): Promise<number>; /** * Get value of object */ getValue(objName: string): Promise<number>; /** * Get value as string */ getValueString(objName: string): Promise<string>; /** * Create new construction */ newConstruction(): Promise<void>; /** * Reset to initial state */ reset(): Promise<void>; /** * Refresh all views */ refreshViews(): Promise<void>; /** * Set coordinate system bounds (mock implementation) */ setCoordSystem(xmin: number, xmax: number, ymin: number, ymax: number): Promise<void>; /** * Set axes visibility (mock implementation) */ setAxesVisible(xAxis: boolean, yAxis: boolean): Promise<void>; /** * Set grid visibility (mock implementation) */ setGridVisible(visible: boolean): Promise<void>; /** * Check if instance is ready */ isReady(): Promise<boolean>; /** * Export construction as PNG (base64) - Mock implementation with enhanced parameters */ exportPNG(scale?: number, transparent?: boolean, dpi?: number, width?: number, height?: number): Promise<string>; /** * Export construction as SVG - Mock implementation */ exportSVG(): Promise<string>; /** * Export construction as PDF (base64) - Mock implementation */ exportPDF(): Promise<string>; /** * Export animation as frames (GEB-17 enhancement) */ exportAnimation(options?: { duration?: number; frameRate?: number; format?: 'gif' | 'frames'; width?: number; height?: number; }): Promise<string | string[]>; /** * Cleanup resources */ cleanup(): Promise<void>; /** * Get instance state */ getState(): { id: string; isReady: boolean; lastActivity: Date; config: GeoGebraConfig; }; /** * Update last activity timestamp */ private updateActivity; /** * Ensure instance is initialized */ private ensureInitialized; /** * Mock implementation of equation solving */ private mockSolveEquation; /** * Mock implementation of differentiation */ private mockDifferentiate; /** * Mock implementation of integration */ private mockIntegrate; /** * Mock implementation of expression simplification */ private mockSimplify; /** * Animation Methods */ setAnimating(objName: string, animate: boolean): Promise<void>; setAnimationSpeed(objName: string, speed: number): Promise<void>; startAnimation(): Promise<void>; stopAnimation(): Promise<void>; isAnimationRunning(): Promise<boolean>; setTrace(objName: string, flag: boolean): Promise<void>; setValue(objName: string, value: number): Promise<void>; } //# sourceMappingURL=geogebra-mock.d.ts.map